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

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 +11 -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 +96 -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 +96 -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 +96 -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-675ade68.d.ts} +1 -6
  63. package/dist/esm/tslib.es6-675ade68.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 +96 -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-2cf95ef9.d.ts} +1 -6
  92. package/dist/tslib.es6-2cf95ef9.js +42 -0
  93. package/package.json +12 -4
  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,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: sxoev */
2
+ :root {
3
+
4
+ /* Hard */
5
+
6
+ /* Up */
7
+
8
+ /* Hard up */
9
+ }
10
+ :root {
11
+ --gap-xs: 8px;
12
+ }
13
+ .input-autocomplete__bottomSheetInput_16le9 {
14
+ padding: 0 var(--gap-xs) var(--gap-xs);
15
+ box-sizing: border-box;
16
+ }
17
+ .input-autocomplete__footer_16le9 {
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.0",
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-button": "^5.1.6",
23
+ "@alfalab/core-components-form-control": "^7.4.3",
22
24
  "@alfalab/core-components-input": "^8.1.6",
23
- "@alfalab/core-components-select": "^10.8.2",
24
- "classnames": "2.2.6"
25
+ "@alfalab/core-components-select": "^10.9.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": "e4ba71a96bcbca182a7c25d0ed89b82c1d33fa98"
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;
@@ -1,82 +0,0 @@
1
- 'use strict';
2
-
3
- var React = require('react');
4
- var cn = require('classnames');
5
- var coreComponentsInput = require('@alfalab/core-components-input/dist/cssm');
6
- var mergeRefs = require('react-merge-refs');
7
- var styles = require('./autocomplete-field/index.module.css');
8
-
9
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
10
-
11
- var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
12
- var cn__default = /*#__PURE__*/_interopDefaultLegacy(cn);
13
- var mergeRefs__default = /*#__PURE__*/_interopDefaultLegacy(mergeRefs);
14
- var styles__default = /*#__PURE__*/_interopDefaultLegacy(styles);
15
-
16
- /*! *****************************************************************************
17
- Copyright (c) Microsoft Corporation.
18
-
19
- Permission to use, copy, modify, and/or distribute this software for any
20
- purpose with or without fee is hereby granted.
21
-
22
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
23
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
24
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
25
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
26
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
27
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
28
- PERFORMANCE OF THIS SOFTWARE.
29
- ***************************************************************************** */
30
- exports.__assign = function () {
31
- exports.__assign = Object.assign || function __assign(t) {
32
- for (var s, i = 1, n = arguments.length; i < n; i++) {
33
- s = arguments[i];
34
- for (var p in s)
35
- if (Object.prototype.hasOwnProperty.call(s, p))
36
- t[p] = s[p];
37
- }
38
- return t;
39
- };
40
- return exports.__assign.apply(this, arguments);
41
- };
42
- function __rest(s, e) {
43
- var t = {};
44
- for (var p in s)
45
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
46
- t[p] = s[p];
47
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
48
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
49
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
50
- t[p[i]] = s[p[i]];
51
- }
52
- return t;
53
- }
54
-
55
- var AutocompleteField = function (_a) {
56
- var _b;
57
- 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;
58
- var inputRef = React.useRef(null);
59
- var onClick = innerProps.onClick, onFocus = innerProps.onFocus;
60
- var inputDisabled = disabled || readOnly;
61
- var handleClick = React.useCallback(function (event) {
62
- if (onClick)
63
- onClick(event);
64
- if (inputRef.current) {
65
- inputRef.current.focus();
66
- }
67
- }, [onClick]);
68
- return (React__default['default'].createElement(Input, exports.__assign({}, inputProps, innerProps, {
69
- // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
70
- // @ts-ignore
71
- wrapperRef: mergeRefs__default['default']([innerProps.ref, inputProps.wrapperRef]),
72
- // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
73
- // @ts-ignore
74
- 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,
75
- inputProps.rightAddons,
76
- Arrow && (React__default['default'].createElement("span", { className: cn__default['default'](styles__default['default'].arrow, (_b = {},
77
- _b[styles__default['default'].error] = error,
78
- _b)) }, Arrow)))) })));
79
- };
80
-
81
- exports.AutocompleteField = AutocompleteField;
82
- exports.__rest = __rest;
@@ -1,74 +0,0 @@
1
- import React, { useRef, useCallback } from 'react';
2
- import cn from 'classnames';
3
- import { Input } from '@alfalab/core-components-input/dist/esm';
4
- import mergeRefs from 'react-merge-refs';
5
-
6
- /*! *****************************************************************************
7
- Copyright (c) Microsoft Corporation.
8
-
9
- Permission to use, copy, modify, and/or distribute this software for any
10
- purpose with or without fee is hereby granted.
11
-
12
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
13
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
14
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
15
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
16
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
17
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
18
- PERFORMANCE OF THIS SOFTWARE.
19
- ***************************************************************************** */
20
- var __assign = function () {
21
- __assign = Object.assign || function __assign(t) {
22
- for (var s, i = 1, n = arguments.length; i < n; i++) {
23
- s = arguments[i];
24
- for (var p in s)
25
- if (Object.prototype.hasOwnProperty.call(s, p))
26
- t[p] = s[p];
27
- }
28
- return t;
29
- };
30
- return __assign.apply(this, arguments);
31
- };
32
- function __rest(s, e) {
33
- var t = {};
34
- for (var p in s)
35
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
36
- t[p] = s[p];
37
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
38
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
39
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
40
- t[p[i]] = s[p[i]];
41
- }
42
- return t;
43
- }
44
-
45
- var styles = {"arrow":"input-autocomplete__arrow_1h5uf","error":"input-autocomplete__error_1h5uf"};
46
- require('./autocomplete-field/index.css')
47
-
48
- var AutocompleteField = function (_a) {
49
- var _b;
50
- var label = _a.label, placeholder = _a.placeholder, size = _a.size, Arrow = _a.Arrow, _c = _a.Input, Input$1 = _c === void 0 ? 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;
51
- var inputRef = useRef(null);
52
- var onClick = innerProps.onClick, onFocus = innerProps.onFocus;
53
- var inputDisabled = disabled || readOnly;
54
- var handleClick = useCallback(function (event) {
55
- if (onClick)
56
- onClick(event);
57
- if (inputRef.current) {
58
- inputRef.current.focus();
59
- }
60
- }, [onClick]);
61
- return (React.createElement(Input$1, __assign({}, inputProps, innerProps, {
62
- // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
63
- // @ts-ignore
64
- wrapperRef: mergeRefs([innerProps.ref, inputProps.wrapperRef]),
65
- // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
66
- // @ts-ignore
67
- ref: mergeRefs([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.createElement(React.Fragment, null,
68
- inputProps.rightAddons,
69
- Arrow && (React.createElement("span", { className: cn(styles.arrow, (_b = {},
70
- _b[styles.error] = error,
71
- _b)) }, Arrow)))) })));
72
- };
73
-
74
- export { AutocompleteField as A, __rest as _, __assign as a };