@alfalab/core-components-input-autocomplete 7.2.7 → 7.3.3

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 (96) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/dist/Component-7ca84eff.d.ts +227 -0
  3. package/dist/Component.d.ts +3 -3
  4. package/dist/Component.js +6 -5
  5. package/dist/Component.mobile.d.ts +91 -0
  6. package/dist/Component.mobile.js +82 -0
  7. package/dist/autocomplete-field/Component.d.ts +6 -0
  8. package/dist/autocomplete-field/Component.js +39 -6
  9. package/dist/autocomplete-field/index.css +2 -2
  10. package/dist/autocomplete-field/index.d.ts +1 -1
  11. package/dist/autocomplete-field/index.js +4 -3
  12. package/dist/autocomplete-mobile-field/Component.d.ts +7 -0
  13. package/dist/autocomplete-mobile-field/Component.js +37 -0
  14. package/dist/autocomplete-mobile-field/index.css +49 -0
  15. package/dist/autocomplete-mobile-field/index.d.ts +1 -0
  16. package/dist/autocomplete-mobile-field/index.js +14 -0
  17. package/dist/cssm/Component-7ca84eff.d.ts +227 -0
  18. package/dist/cssm/Component.d.ts +3 -3
  19. package/dist/cssm/Component.js +6 -5
  20. package/dist/cssm/Component.mobile.d.ts +91 -0
  21. package/dist/cssm/Component.mobile.js +82 -0
  22. package/dist/cssm/autocomplete-field/Component.d.ts +6 -0
  23. package/dist/cssm/autocomplete-field/Component.js +38 -7
  24. package/dist/cssm/autocomplete-field/index.d.ts +1 -1
  25. package/dist/cssm/autocomplete-field/index.js +4 -3
  26. package/dist/cssm/autocomplete-mobile-field/Component.d.ts +7 -0
  27. package/dist/cssm/autocomplete-mobile-field/Component.js +36 -0
  28. package/dist/cssm/autocomplete-mobile-field/index.d.ts +1 -0
  29. package/dist/cssm/autocomplete-mobile-field/index.js +15 -0
  30. package/dist/cssm/autocomplete-mobile-field/index.module.css +48 -0
  31. package/dist/cssm/index-7ca84eff.d.ts +178 -0
  32. package/dist/cssm/index-bdb4c6b9.d.ts +193 -0
  33. package/dist/cssm/index-ebda875c.d.ts +36 -0
  34. package/dist/cssm/index.js +4 -3
  35. package/dist/cssm/mobile.d.ts +1 -0
  36. package/dist/cssm/mobile.js +22 -0
  37. package/dist/cssm/mobile.module.css +18 -0
  38. package/dist/{Component-7d703cac.d.ts → cssm/tslib.es6-ce870b46.d.ts} +1 -6
  39. package/dist/cssm/tslib.es6-ce870b46.js +42 -0
  40. package/dist/esm/Component-7ca84eff.d.ts +227 -0
  41. package/dist/esm/Component.d.ts +3 -3
  42. package/dist/esm/Component.js +4 -3
  43. package/dist/esm/Component.mobile.d.ts +91 -0
  44. package/dist/esm/Component.mobile.js +71 -0
  45. package/dist/esm/autocomplete-field/Component.d.ts +6 -0
  46. package/dist/esm/autocomplete-field/Component.js +36 -5
  47. package/dist/esm/autocomplete-field/index.css +2 -2
  48. package/dist/esm/autocomplete-field/index.d.ts +1 -1
  49. package/dist/esm/autocomplete-field/index.js +4 -3
  50. package/dist/esm/autocomplete-mobile-field/Component.d.ts +7 -0
  51. package/dist/esm/autocomplete-mobile-field/Component.js +28 -0
  52. package/dist/esm/autocomplete-mobile-field/index.css +49 -0
  53. package/dist/esm/autocomplete-mobile-field/index.d.ts +1 -0
  54. package/dist/esm/autocomplete-mobile-field/index.js +6 -0
  55. package/dist/esm/index-7ca84eff.d.ts +178 -0
  56. package/dist/esm/index-bdb4c6b9.d.ts +193 -0
  57. package/dist/esm/index-ebda875c.d.ts +36 -0
  58. package/dist/esm/index.js +4 -3
  59. package/dist/esm/mobile.css +19 -0
  60. package/dist/esm/mobile.d.ts +1 -0
  61. package/dist/esm/mobile.js +12 -0
  62. package/dist/esm/{Component-077ac41e.d.ts → tslib.es6-3a1f3171.d.ts} +1 -6
  63. package/dist/esm/tslib.es6-3a1f3171.js +40 -0
  64. package/dist/index-7ca84eff.d.ts +178 -0
  65. package/dist/index-bdb4c6b9.d.ts +193 -0
  66. package/dist/index-ebda875c.d.ts +36 -0
  67. package/dist/index.js +4 -3
  68. package/dist/mobile.css +19 -0
  69. package/dist/mobile.d.ts +1 -0
  70. package/dist/mobile.js +20 -0
  71. package/dist/modern/Component-7ca84eff.d.ts +227 -0
  72. package/dist/modern/Component.d.ts +3 -3
  73. package/dist/modern/Component.js +2 -2
  74. package/dist/modern/Component.mobile.d.ts +91 -0
  75. package/dist/modern/Component.mobile.js +80 -0
  76. package/dist/modern/autocomplete-field/Component.js +3 -3
  77. package/dist/modern/autocomplete-field/index.css +2 -2
  78. package/dist/modern/autocomplete-field/index.js +2 -2
  79. package/dist/modern/autocomplete-mobile-field/Component.d.ts +7 -0
  80. package/dist/modern/autocomplete-mobile-field/Component.js +25 -0
  81. package/dist/modern/autocomplete-mobile-field/index.css +49 -0
  82. package/dist/modern/autocomplete-mobile-field/index.d.ts +1 -0
  83. package/dist/modern/autocomplete-mobile-field/index.js +5 -0
  84. package/dist/modern/index-7ca84eff.d.ts +178 -0
  85. package/dist/modern/index-bdb4c6b9.d.ts +193 -0
  86. package/dist/modern/index-ebda875c.d.ts +36 -0
  87. package/dist/modern/index.js +2 -2
  88. package/dist/modern/mobile.css +19 -0
  89. package/dist/modern/mobile.d.ts +1 -0
  90. package/dist/modern/mobile.js +11 -0
  91. package/dist/{cssm/Component-a04a9434.d.ts → tslib.es6-4ca60f38.d.ts} +1 -6
  92. package/dist/tslib.es6-4ca60f38.js +42 -0
  93. package/package.json +13 -5
  94. package/dist/Component-7d703cac.js +0 -83
  95. package/dist/cssm/Component-a04a9434.js +0 -82
  96. package/dist/esm/Component-077ac41e.js +0 -74
@@ -0,0 +1,178 @@
1
+ /// <reference types="react-transition-group" />
2
+ /// <reference types="react" />
3
+ import React from "react";
4
+ import { HTMLAttributes, ReactNode, FC } from "react";
5
+ import { TransitionProps } from "react-transition-group/Transition";
6
+ import { BackdropProps } from "./index-ebda875c";
7
+ import { SwipeableHandlers } from "react-swipeable/types";
8
+ type BottomSheetTitleAlign = "center" | "left";
9
+ type BottomSheetProps = {
10
+ /**
11
+ * Контент
12
+ */
13
+ children?: ReactNode;
14
+ /**
15
+ * Управление видимостью
16
+ */
17
+ open: boolean;
18
+ /**
19
+ * Заголовок
20
+ */
21
+ title?: ReactNode;
22
+ /**
23
+ * Кнопка действия (обычно, это кнопка закрытия)
24
+ */
25
+ actionButton?: ReactNode;
26
+ /**
27
+ * Дополнительный класс
28
+ */
29
+ className?: string;
30
+ /**
31
+ * Дополнительный класс
32
+ */
33
+ contentClassName?: string;
34
+ /**
35
+ * Дополнительные пропсы на контейнер.
36
+ */
37
+ containerProps?: HTMLAttributes<HTMLDivElement>;
38
+ /**
39
+ * Дополнительный класс
40
+ */
41
+ containerClassName?: string;
42
+ /**
43
+ * Дополнительный класс шапки
44
+ */
45
+ headerClassName?: string;
46
+ /**
47
+ * Дополнительный класс футера
48
+ */
49
+ footerClassName?: string;
50
+ /**
51
+ * Дополнительный класс для аддонов
52
+ */
53
+ addonClassName?: string;
54
+ /**
55
+ * Дополнительный класс для компонента крестика
56
+ */
57
+ closerClassName?: string;
58
+ /**
59
+ * Дополнительный класс для компонента стрелки назад
60
+ */
61
+ backerClassName?: string;
62
+ /**
63
+ * TransitionProps, прокидываются в компонент CSSTransitionProps.
64
+ */
65
+ transitionProps?: Partial<TransitionProps>;
66
+ /**
67
+ * Идентификатор для систем автоматизированного тестирования
68
+ */
69
+ dataTestId?: string;
70
+ /**
71
+ * z-index компонента
72
+ */
73
+ zIndex?: number;
74
+ /**
75
+ * Будет ли свайпаться шторка
76
+ * @default true
77
+ */
78
+ swipeable?: boolean;
79
+ /**
80
+ * Слот слева
81
+ */
82
+ leftAddons?: ReactNode;
83
+ /**
84
+ * Слот справа
85
+ */
86
+ rightAddons?: ReactNode;
87
+ /**
88
+ * Слот снизу
89
+ */
90
+ bottomAddons?: ReactNode;
91
+ /**
92
+ * Наличие компонента крестика
93
+ */
94
+ hasCloser?: boolean;
95
+ /**
96
+ * Наличие компонента стрелки назад
97
+ */
98
+ hasBacker?: boolean;
99
+ /**
100
+ * Выравнивание заголовка
101
+ */
102
+ titleAlign?: BottomSheetTitleAlign;
103
+ /**
104
+ * Фиксирует шапку
105
+ */
106
+ stickyHeader?: boolean;
107
+ /**
108
+ * Фиксирует футер
109
+ */
110
+ stickyFooter?: boolean;
111
+ /**
112
+ * Высота шторки
113
+ */
114
+ initialHeight?: "default" | "full";
115
+ /**
116
+ * Будет ли виден оверлэй
117
+ */
118
+ hideOverlay?: boolean;
119
+ /**
120
+ * Будет ли видна шапка
121
+ */
122
+ hideHeader?: boolean;
123
+ /**
124
+ * Будет ли обрезан заголовок
125
+ */
126
+ trimTitle?: boolean;
127
+ /**
128
+ * Запретить закрытие шторки кликом на оверлэй
129
+ */
130
+ disableOverlayClick?: boolean;
131
+ /**
132
+ * Не анимировать шторку при изменении размера вьюпорта
133
+ */
134
+ ignoreScreenChange?: boolean;
135
+ /**
136
+ * Обработчик закрытия
137
+ */
138
+ onClose: () => void;
139
+ /**
140
+ * Обработчик нажатия на стрелку назад
141
+ */
142
+ onBack?: () => void;
143
+ };
144
+ /* Верхний отступ шторки, если она открыта на максимальную высоту */
145
+ declare const HEADER_OFFSET = 24;
146
+ declare const CLOSE_OFFSET = 0.2;
147
+ declare const BottomSheet: React.ForwardRefExoticComponent<BottomSheetProps & React.RefAttributes<HTMLDivElement>>;
148
+ type FooterProps = {
149
+ /**
150
+ * Контент футера
151
+ */
152
+ children?: ReactNode;
153
+ /**
154
+ * Фиксирует футер
155
+ */
156
+ sticky?: boolean;
157
+ /**
158
+ * Дополнительный класс
159
+ */
160
+ className?: string;
161
+ };
162
+ declare const Footer: FC<FooterProps>;
163
+ type SwipeableBackdropProps = BackdropProps & {
164
+ /**
165
+ * Прозрачность бэкдропа
166
+ */
167
+ opacity?: number;
168
+ /**
169
+ * Обработчики свайпа
170
+ */
171
+ handlers?: SwipeableHandlers;
172
+ /**
173
+ * Время анимации opacity
174
+ */
175
+ opacityTimeout?: number;
176
+ };
177
+ declare const SwipeableBackdrop: FC<SwipeableBackdropProps>;
178
+ export { BottomSheetTitleAlign, BottomSheetProps, HEADER_OFFSET, CLOSE_OFFSET, BottomSheet, FooterProps, Footer, SwipeableBackdropProps, SwipeableBackdrop };
@@ -0,0 +1,193 @@
1
+ /// <reference types="react-transition-group" />
2
+ /// <reference types="react" />
3
+ /* eslint-disable jsx-a11y/no-noninteractive-element-interactions */
4
+ import React from "react";
5
+ import { MouseEvent, KeyboardEvent, ReactNode, Ref, FC, MutableRefObject, RefObject } from "react";
6
+ import { TransitionProps } from "react-transition-group/Transition";
7
+ import { BackdropProps } from "./index-ebda875c";
8
+ type PortalProps = {
9
+ /** Контент */
10
+ children?: ReactNode;
11
+ /**
12
+ * Функция, возвращающая контейнер, в который будут рендериться дочерние элементы
13
+ */
14
+ getPortalContainer?: () => Element;
15
+ };
16
+ type BaseModalProps = {
17
+ /**
18
+ * Контент
19
+ */
20
+ children?: ReactNode;
21
+ /**
22
+ * Компонент бэкдропа
23
+ */
24
+ Backdrop?: FC<BackdropProps>;
25
+ /**
26
+ * Свойства для Бэкдропа
27
+ */
28
+ backdropProps?: Partial<BackdropProps> & Record<string, unknown>;
29
+ /**
30
+ * Нода, компонент или функция возвращающая их
31
+ *
32
+ * Контейнер к которому будут добавляться порталы
33
+ */
34
+ container?: PortalProps["getPortalContainer"];
35
+ /**
36
+ * Отключает автоматический перевод фокуса на модалку при открытии
37
+ * @default false
38
+ */
39
+ disableAutoFocus?: boolean;
40
+ /**
41
+ * Отключает ловушку фокуса
42
+ * @default false
43
+ */
44
+ disableFocusLock?: boolean;
45
+ /**
46
+ * Отключает восстановление фокуса на предыдущем элементе после закрытия модалки
47
+ * @default false
48
+ */
49
+ disableRestoreFocus?: boolean;
50
+ /**
51
+ * Отключает вызов `callback` при нажатии Escape
52
+ * @default false
53
+ */
54
+ disableEscapeKeyDown?: boolean;
55
+ /**
56
+ * Отключает вызов `callback` при клике на бэкдроп
57
+ * @default false
58
+ */
59
+ disableBackdropClick?: boolean;
60
+ /**
61
+ * Содержимое модалки всегда в DOM
62
+ * @default false
63
+ */
64
+ keepMounted?: boolean;
65
+ /**
66
+ * Управление видимостью модалки
67
+ */
68
+ open: boolean;
69
+ /**
70
+ * Дополнительный класс
71
+ */
72
+ className?: string;
73
+ /**
74
+ * Дополнительный класс
75
+ */
76
+ contentClassName?: string;
77
+ /**
78
+ * Дополнительный класс для обертки (Modal)
79
+ */
80
+ wrapperClassName?: string;
81
+ /**
82
+ * Обработчик скролла контента
83
+ */
84
+ scrollHandler?: "wrapper" | "content" | MutableRefObject<HTMLDivElement | null>;
85
+ /**
86
+ * Пропсы для анимации (CSSTransition)
87
+ */
88
+ transitionProps?: Partial<TransitionProps>;
89
+ /**
90
+ * Обработчик события нажатия на бэкдроп
91
+ */
92
+ onBackdropClick?: (event: MouseEvent) => void;
93
+ /**
94
+ * Обработчик события нажатия на Escape
95
+ *
96
+ * Если `disableEscapeKeyDown` - false и модальное окно в фокусе
97
+ */
98
+ onEscapeKeyDown?: (event: KeyboardEvent) => void;
99
+ /**
100
+ * Обработчик закрытия
101
+ */
102
+ onClose?: (event: MouseEvent<HTMLElement> | KeyboardEvent<HTMLElement>, reason?: "backdropClick" | "escapeKeyDown" | "closerClick") => void;
103
+ /**
104
+ * Обработчик события onEntered компонента Transition
105
+ */
106
+ onMount?: () => void;
107
+ /**
108
+ * Обработчик события onExited компонента Transition
109
+ */
110
+ onUnmount?: () => void;
111
+ /**
112
+ * Идентификатор для систем автоматизированного тестирования
113
+ */
114
+ dataTestId?: string;
115
+ /**
116
+ * z-index компонента
117
+ */
118
+ zIndex?: number;
119
+ /**
120
+ * Реф, который должен быть установлен компонентной области
121
+ */
122
+ componentRef?: MutableRefObject<HTMLDivElement | null>;
123
+ };
124
+ type BaseModalContext = {
125
+ hasFooter?: boolean;
126
+ hasHeader?: boolean;
127
+ hasScroll?: boolean;
128
+ headerHighlighted?: boolean;
129
+ footerHighlighted?: boolean;
130
+ headerOffset?: number;
131
+ setHeaderOffset: (offset: number) => void;
132
+ contentRef: Ref<HTMLElement>;
133
+ setHasHeader: (exists: boolean) => void;
134
+ setHasFooter: (exists: boolean) => void;
135
+ onClose: Required<BaseModalProps>["onClose"];
136
+ };
137
+ declare const BaseModalContext: React.Context<BaseModalContext>;
138
+ declare const BaseModal: React.ForwardRefExoticComponent<BaseModalProps & React.RefAttributes<HTMLDivElement>>;
139
+ declare function isScrolledToTop(target: HTMLElement): boolean;
140
+ declare function isScrolledToBottom(target: HTMLElement): boolean;
141
+ declare function hasScrollbar(target: HTMLElement): boolean;
142
+ declare const restoreContainerStyles: (container: HTMLElement) => void;
143
+ declare const handleContainer: (container?: HTMLElement | undefined) => void;
144
+ /**
145
+ * Набор констант для z-index соответствующих классов компонентов.
146
+ * Значения выбраны по приоритету.
147
+ */
148
+ declare const stackingOrder: {
149
+ FOCUSED: number;
150
+ DEFAULT: number;
151
+ POPOVER: number;
152
+ MODAL: number;
153
+ TOAST: number;
154
+ };
155
+ declare const StackingContext: import("react").Context<number>;
156
+ type StackProps = {
157
+ /**
158
+ * Render prop, в который передается функция.
159
+ * Функция принимает аргумент со значением z-index из текущего контекста.
160
+ */
161
+ children: (value: number) => ReactNode;
162
+ /**
163
+ * Исходное значение для z-index.
164
+ * @default 5
165
+ */
166
+ value?: number;
167
+ };
168
+ declare const Stack: FC<StackProps>;
169
+ declare const PORTAL_CONTAINER_ATTRIBUTE = "alfa-portal-container";
170
+ declare const getDefaultPortalContainer: () => Element;
171
+ declare function setRef<T>(ref: RefObject<T> | ((instance: T | null) => void) | null | undefined, value: T | null): void;
172
+ type SavedStyle = {
173
+ value: string;
174
+ key: string;
175
+ el: HTMLElement;
176
+ };
177
+ type RestoreStyle = {
178
+ container: HTMLElement;
179
+ modals: number;
180
+ styles: SavedStyle[];
181
+ };
182
+ declare class ModalStore {
183
+ private readonly restoreStyles;
184
+ constructor();
185
+ getRestoreStyles: () => RestoreStyle[];
186
+ }
187
+ declare const getModalStore: () => ModalStore;
188
+ declare class GlobalStore {
189
+ private readonly modalStore;
190
+ constructor();
191
+ getModalStore: () => ModalStore;
192
+ }
193
+ export { BaseModalProps, BaseModalContext, BaseModal, isScrolledToTop, isScrolledToBottom, hasScrollbar, restoreContainerStyles, handleContainer, stackingOrder, StackingContext, StackProps, Stack, PORTAL_CONTAINER_ATTRIBUTE, getDefaultPortalContainer, setRef, SavedStyle, getModalStore, GlobalStore };
@@ -0,0 +1,36 @@
1
+ /// <reference types="react-transition-group" />
2
+ /// <reference types="react" />
3
+ import React from "react";
4
+ import { MouseEvent } from "react";
5
+ import { TransitionProps } from "react-transition-group/Transition";
6
+ import { CSSTransitionClassNames } from "react-transition-group/CSSTransition";
7
+ type BackdropProps = Partial<TransitionProps> & {
8
+ /**
9
+ * Прозрачный бэкдроп
10
+ */
11
+ invisible?: boolean;
12
+ /**
13
+ * Управляет видимостью компонента
14
+ */
15
+ open: boolean;
16
+ /**
17
+ * Обработчик клика по бэкдропу
18
+ */
19
+ onClose?: (event: MouseEvent<HTMLElement>) => void;
20
+ /**
21
+ * Дополнительный класс
22
+ */
23
+ className?: string;
24
+ /**
25
+ * Классы анимации
26
+ *
27
+ * http://reactcommunity.org/react-transition-group/css-transition#CSSTransition-prop-classNames
28
+ */
29
+ transitionClassNames?: string | CSSTransitionClassNames;
30
+ /**
31
+ * Идентификатор для систем автоматизированного тестирования
32
+ */
33
+ dataTestId?: string;
34
+ };
35
+ declare const Backdrop: React.FC<BackdropProps>;
36
+ export { BackdropProps, Backdrop };
@@ -1,7 +1,7 @@
1
+ import 'classnames';
1
2
  import 'react';
3
+ import 'react-merge-refs';
2
4
  import '@alfalab/core-components-select/dist/modern';
3
- import 'classnames';
4
5
  import '@alfalab/core-components-input/dist/modern';
5
- import 'react-merge-refs';
6
6
  import './autocomplete-field/Component.js';
7
7
  export { InputAutocomplete } from './Component.js';
@@ -0,0 +1,19 @@
1
+ /* hash: ifvmf */
2
+ :root {
3
+
4
+ /* Hard */
5
+
6
+ /* Up */
7
+
8
+ /* Hard up */
9
+ }
10
+ :root {
11
+ --gap-xs: 8px;
12
+ }
13
+ .input-autocomplete__bottomSheetInput_6as0y {
14
+ padding: 0 var(--gap-xs) var(--gap-xs);
15
+ box-sizing: border-box;
16
+ }
17
+ .input-autocomplete__footer_6as0y {
18
+ display: flex
19
+ }
@@ -0,0 +1 @@
1
+ export * from "./Component.mobile";
@@ -0,0 +1,11 @@
1
+ import 'classnames';
2
+ import 'react';
3
+ import 'react-merge-refs';
4
+ import 'lodash.throttle';
5
+ import '@alfalab/core-components-select/dist/modern';
6
+ import '@alfalab/core-components-button/dist/modern';
7
+ import '@alfalab/core-components-input/dist/modern';
8
+ import '@alfalab/hooks';
9
+ import '@alfalab/core-components-form-control/dist/modern';
10
+ import './autocomplete-mobile-field/Component.js';
11
+ export { InputAutocompleteMobile } from './Component.mobile.js';
@@ -1,6 +1,3 @@
1
- /// <reference types="react" />
2
- import { FieldProps } from "@alfalab/core-components-select";
3
- import { InputAutocompleteProps } from "./Component";
4
1
  declare function __extends(d: any, b: any): void;
5
2
  declare function __rest(s: any, e: any): {};
6
3
  declare function __decorate(decorators: any, target: any, key: any, desc: any, ...args: any[]): any;
@@ -32,6 +29,4 @@ declare function __classPrivateFieldGet(receiver: any, privateMap: any): any;
32
29
  declare function __classPrivateFieldSet(receiver: any, privateMap: any, value: any): any;
33
30
  declare function __assign(...args: any[]): any;
34
31
  declare function __createBinding(o: any, m: any, k: any, k2: any): void;
35
- type AutocompleteFieldProps = FieldProps & Pick<InputAutocompleteProps, 'Input' | 'inputProps' | 'value' | 'onInput' | 'readOnly'>;
36
- declare const AutocompleteField: ({ label, placeholder, size, Arrow, Input, value, error, success, hint, disabled, readOnly, onInput, inputProps, innerProps, }: AutocompleteFieldProps) => JSX.Element;
37
- export { __extends, __rest, __decorate, __param, __metadata, __awaiter, __generator, __exportStar, __values, __read, __spread, __spreadArrays, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault, __classPrivateFieldGet, __classPrivateFieldSet, __assign, __createBinding, AutocompleteFieldProps, AutocompleteField };
32
+ export { __extends, __rest, __decorate, __param, __metadata, __awaiter, __generator, __exportStar, __values, __read, __spread, __spreadArrays, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault, __classPrivateFieldGet, __classPrivateFieldSet, __assign, __createBinding };
@@ -0,0 +1,42 @@
1
+ 'use strict';
2
+
3
+ /*! *****************************************************************************
4
+ Copyright (c) Microsoft Corporation.
5
+
6
+ Permission to use, copy, modify, and/or distribute this software for any
7
+ purpose with or without fee is hereby granted.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
10
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
11
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
12
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
13
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
14
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15
+ PERFORMANCE OF THIS SOFTWARE.
16
+ ***************************************************************************** */
17
+ exports.__assign = function () {
18
+ exports.__assign = Object.assign || function __assign(t) {
19
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
20
+ s = arguments[i];
21
+ for (var p in s)
22
+ if (Object.prototype.hasOwnProperty.call(s, p))
23
+ t[p] = s[p];
24
+ }
25
+ return t;
26
+ };
27
+ return exports.__assign.apply(this, arguments);
28
+ };
29
+ function __rest(s, e) {
30
+ var t = {};
31
+ for (var p in s)
32
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
33
+ t[p] = s[p];
34
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
35
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
36
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
37
+ t[p[i]] = s[p[i]];
38
+ }
39
+ return t;
40
+ }
41
+
42
+ exports.__rest = __rest;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alfalab/core-components-input-autocomplete",
3
- "version": "7.2.7",
3
+ "version": "7.3.3",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "license": "MIT",
@@ -19,9 +19,17 @@
19
19
  "react": "^16.9.0 || ^17.0.1"
20
20
  },
21
21
  "dependencies": {
22
- "@alfalab/core-components-input": "^8.1.6",
23
- "@alfalab/core-components-select": "^10.8.2",
24
- "classnames": "2.2.6"
22
+ "@alfalab/core-components-button": "^5.2.0",
23
+ "@alfalab/core-components-form-control": "^7.5.0",
24
+ "@alfalab/core-components-input": "^8.2.0",
25
+ "@alfalab/core-components-select": "^10.10.0",
26
+ "@alfalab/hooks": "^1.4.1",
27
+ "classnames": "^2.2.6",
28
+ "lodash.throttle": "^4.1.1",
29
+ "react-merge-refs": "^1.1.0"
25
30
  },
26
- "gitHead": "7b9b0bbb422c34b432003ddc335fe15f596ad6d5"
31
+ "devDependencies": {
32
+ "@types/lodash.throttle": "^4.1.7"
33
+ },
34
+ "gitHead": "dcd5c0c8e25b7c374ff9311505ccf738a82e22c0"
27
35
  }
@@ -1,83 +0,0 @@
1
- 'use strict';
2
-
3
- var React = require('react');
4
- var cn = require('classnames');
5
- var coreComponentsInput = require('@alfalab/core-components-input');
6
- var mergeRefs = require('react-merge-refs');
7
-
8
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
9
-
10
- var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
11
- var cn__default = /*#__PURE__*/_interopDefaultLegacy(cn);
12
- var mergeRefs__default = /*#__PURE__*/_interopDefaultLegacy(mergeRefs);
13
-
14
- /*! *****************************************************************************
15
- Copyright (c) Microsoft Corporation.
16
-
17
- Permission to use, copy, modify, and/or distribute this software for any
18
- purpose with or without fee is hereby granted.
19
-
20
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
21
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
22
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
23
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
24
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
25
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
26
- PERFORMANCE OF THIS SOFTWARE.
27
- ***************************************************************************** */
28
- exports.__assign = function () {
29
- exports.__assign = Object.assign || function __assign(t) {
30
- for (var s, i = 1, n = arguments.length; i < n; i++) {
31
- s = arguments[i];
32
- for (var p in s)
33
- if (Object.prototype.hasOwnProperty.call(s, p))
34
- t[p] = s[p];
35
- }
36
- return t;
37
- };
38
- return exports.__assign.apply(this, arguments);
39
- };
40
- function __rest(s, e) {
41
- var t = {};
42
- for (var p in s)
43
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
44
- t[p] = s[p];
45
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
46
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
47
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
48
- t[p[i]] = s[p[i]];
49
- }
50
- return t;
51
- }
52
-
53
- var styles = {"arrow":"input-autocomplete__arrow_1h5uf","error":"input-autocomplete__error_1h5uf"};
54
- require('./autocomplete-field/index.css')
55
-
56
- var AutocompleteField = function (_a) {
57
- var _b;
58
- var label = _a.label, placeholder = _a.placeholder, size = _a.size, Arrow = _a.Arrow, _c = _a.Input, Input = _c === void 0 ? coreComponentsInput.Input : _c, value = _a.value, error = _a.error, success = _a.success, hint = _a.hint, disabled = _a.disabled, readOnly = _a.readOnly, onInput = _a.onInput, _d = _a.inputProps, inputProps = _d === void 0 ? {} : _d, innerProps = _a.innerProps;
59
- var inputRef = React.useRef(null);
60
- var onClick = innerProps.onClick, onFocus = innerProps.onFocus;
61
- var inputDisabled = disabled || readOnly;
62
- var handleClick = React.useCallback(function (event) {
63
- if (onClick)
64
- onClick(event);
65
- if (inputRef.current) {
66
- inputRef.current.focus();
67
- }
68
- }, [onClick]);
69
- return (React__default['default'].createElement(Input, exports.__assign({}, inputProps, innerProps, {
70
- // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
71
- // @ts-ignore
72
- wrapperRef: mergeRefs__default['default']([innerProps.ref, inputProps.wrapperRef]),
73
- // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
74
- // @ts-ignore
75
- ref: mergeRefs__default['default']([inputRef, inputProps.ref]), disabled: disabled, readOnly: readOnly, block: true, label: label, placeholder: placeholder, size: size, error: error, success: success, hint: hint, onChange: onInput, onClick: inputDisabled ? undefined : handleClick, onFocus: inputDisabled ? undefined : onFocus, autoComplete: 'off', value: value, rightAddons: (Arrow || inputProps.rightAddons) && (React__default['default'].createElement(React__default['default'].Fragment, null,
76
- inputProps.rightAddons,
77
- Arrow && (React__default['default'].createElement("span", { className: cn__default['default'](styles.arrow, (_b = {},
78
- _b[styles.error] = error,
79
- _b)) }, Arrow)))) })));
80
- };
81
-
82
- exports.AutocompleteField = AutocompleteField;
83
- exports.__rest = __rest;