@alfalab/core-components-input-autocomplete 9.2.0 → 9.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.
- package/{Component.d.ts → Component.desktop.d.ts} +7 -7
- package/{Component.js → Component.desktop.js} +8 -4
- package/Component.mobile.js +15 -8
- package/Component.responsive.d.ts +13 -0
- package/Component.responsive.js +31 -0
- package/autocomplete-field/Component.d.ts +2 -2
- package/autocomplete-field/Component.js +11 -5
- package/autocomplete-field/index.css +2 -2
- package/autocomplete-field/index.js +1 -1
- package/autocomplete-mobile-field/Component.js +12 -7
- package/autocomplete-mobile-field/index.css +8 -8
- package/autocomplete-mobile-field/index.js +1 -1
- package/{esm/Component.d.ts → cssm/Component.desktop.d.ts} +7 -7
- package/cssm/{Component.js → Component.desktop.js} +7 -3
- package/cssm/Component.mobile.js +14 -6
- package/cssm/Component.responsive.d.ts +13 -0
- package/cssm/Component.responsive.js +34 -0
- package/cssm/autocomplete-field/Component.d.ts +2 -2
- package/cssm/autocomplete-field/Component.js +11 -4
- package/cssm/autocomplete-mobile-field/Component.js +13 -7
- package/cssm/desktop.d.ts +2 -0
- package/cssm/desktop.js +15 -0
- package/cssm/index.d.ts +2 -1
- package/cssm/index.js +12 -2
- package/cssm/responsive.d.ts +2 -0
- package/cssm/responsive.js +24 -0
- package/desktop.d.ts +2 -0
- package/desktop.js +14 -0
- package/{cssm/Component.d.ts → esm/Component.desktop.d.ts} +7 -7
- package/esm/{Component.js → Component.desktop.js} +3 -3
- package/esm/Component.mobile.js +2 -2
- package/esm/Component.responsive.d.ts +13 -0
- package/esm/Component.responsive.js +25 -0
- package/esm/autocomplete-field/Component.d.ts +2 -2
- package/esm/autocomplete-field/Component.js +2 -2
- package/esm/autocomplete-field/index.css +2 -2
- package/esm/autocomplete-field/index.js +1 -1
- package/esm/autocomplete-mobile-field/Component.js +2 -2
- package/esm/autocomplete-mobile-field/index.css +8 -8
- package/esm/autocomplete-mobile-field/index.js +1 -1
- package/esm/desktop.d.ts +2 -0
- package/esm/desktop.js +8 -0
- package/esm/index.d.ts +2 -1
- package/esm/index.js +9 -2
- package/esm/mobile.css +4 -4
- package/esm/mobile.js +1 -1
- package/esm/responsive.d.ts +2 -0
- package/esm/responsive.js +15 -0
- package/esm/{tslib.es6-18b090e0.d.ts → tslib.es6-4587d140.d.ts} +0 -0
- package/esm/{tslib.es6-18b090e0.js → tslib.es6-4587d140.js} +0 -0
- package/index.d.ts +2 -1
- package/index.js +11 -3
- package/mobile.css +4 -4
- package/mobile.js +1 -1
- package/modern/{Component.d.ts → Component.desktop.d.ts} +7 -7
- package/modern/{Component.js → Component.desktop.js} +2 -2
- package/modern/Component.mobile.js +1 -1
- package/modern/Component.responsive.d.ts +13 -0
- package/modern/Component.responsive.js +23 -0
- package/modern/autocomplete-field/Component.d.ts +2 -2
- package/modern/autocomplete-field/Component.js +1 -1
- package/modern/autocomplete-field/index.css +2 -2
- package/modern/autocomplete-mobile-field/Component.js +1 -1
- package/modern/autocomplete-mobile-field/index.css +8 -8
- package/modern/desktop.d.ts +2 -0
- package/modern/desktop.js +7 -0
- package/modern/index.d.ts +2 -1
- package/modern/index.js +8 -1
- package/modern/mobile.css +4 -4
- package/modern/responsive.d.ts +2 -0
- package/modern/responsive.js +14 -0
- package/package.json +5 -5
- package/responsive.d.ts +2 -0
- package/responsive.js +21 -0
- /package/{tslib.es6-62ba2400.d.ts → tslib.es6-89e6fcc2.d.ts} +0 -0
- /package/{tslib.es6-62ba2400.js → tslib.es6-89e6fcc2.js} +0 -0
|
@@ -7,6 +7,12 @@ var coreComponentsFormControl = require('@alfalab/core-components-form-control/c
|
|
|
7
7
|
var hooks = require('@alfalab/hooks');
|
|
8
8
|
var styles = require('./index.module.css');
|
|
9
9
|
|
|
10
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
11
|
+
|
|
12
|
+
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
13
|
+
var cn__default = /*#__PURE__*/_interopDefaultCompat(cn);
|
|
14
|
+
var styles__default = /*#__PURE__*/_interopDefaultCompat(styles);
|
|
15
|
+
|
|
10
16
|
var AutocompleteMobileField = function (_a) {
|
|
11
17
|
var _b;
|
|
12
18
|
var _c = _a.size, size = _c === void 0 ? 'm' : _c; _a.open; var error = _a.error, hint = _a.hint, disabled = _a.disabled, label = _a.label, _d = _a.labelView, labelView = _d === void 0 ? 'inner' : _d, placeholder = _a.placeholder, value = _a.value, innerProps = _a.innerProps, dataTestId = _a.dataTestId, fieldClassName = _a.fieldClassName, Arrow = _a.Arrow; _a.valueRenderer; _a.toggleMenu; _a.setSelectedItems; _a.selectedMultiple; var restProps = tslib_es6.__rest(_a, ["size", "open", "error", "hint", "disabled", "label", "labelView", "placeholder", "value", "innerProps", "dataTestId", "fieldClassName", "Arrow", "valueRenderer", "toggleMenu", "setSelectedItems", "selectedMultiple"]);
|
|
@@ -15,14 +21,14 @@ var AutocompleteMobileField = function (_a) {
|
|
|
15
21
|
var focusVisible = hooks.useFocus(wrapperRef, 'keyboard')[0];
|
|
16
22
|
var filled = Boolean(value);
|
|
17
23
|
var showLabel = !!label && (filled || !placeholder || labelView === 'outer');
|
|
18
|
-
return (
|
|
19
|
-
|
|
20
|
-
_b[
|
|
21
|
-
_b[
|
|
24
|
+
return (React__default.default.createElement("div", { className: styles__default.default.component, ref: wrapperRef, onFocus: function () { return setFocused(true); }, onBlur: function () { return setFocused(false); } },
|
|
25
|
+
React__default.default.createElement(coreComponentsFormControl.FormControl, tslib_es6.__assign({ fieldClassName: cn__default.default(styles__default.default.field, fieldClassName, (_b = {},
|
|
26
|
+
_b[styles__default.default.disabled] = disabled,
|
|
27
|
+
_b[styles__default.default.focusVisible] = focusVisible,
|
|
22
28
|
_b)), block: true, size: size, focused: focused, disabled: disabled, filled: filled, label: showLabel && label, labelView: labelView, error: error, hint: hint, rightAddons: Arrow, "data-test-id": dataTestId }, restProps, innerProps),
|
|
23
|
-
|
|
24
|
-
placeholder && !filled && (
|
|
25
|
-
filled &&
|
|
29
|
+
React__default.default.createElement("div", { className: styles__default.default.contentWrapper },
|
|
30
|
+
placeholder && !filled && (React__default.default.createElement("span", { className: styles__default.default.placeholder }, placeholder)),
|
|
31
|
+
filled && React__default.default.createElement("div", { className: styles__default.default.value }, value)))));
|
|
26
32
|
};
|
|
27
33
|
|
|
28
34
|
exports.AutocompleteMobileField = AutocompleteMobileField;
|
package/cssm/desktop.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var Component_desktop = require('./Component.desktop.js');
|
|
4
|
+
require('./tslib.es6-bbd6cd2a.js');
|
|
5
|
+
require('react');
|
|
6
|
+
require('@alfalab/core-components-select/cssm');
|
|
7
|
+
require('./autocomplete-field/Component.js');
|
|
8
|
+
require('react-merge-refs');
|
|
9
|
+
require('classnames');
|
|
10
|
+
require('@alfalab/core-components-input/cssm');
|
|
11
|
+
require('./autocomplete-field/index.module.css');
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
exports.InputAutocompleteDesktop = Component_desktop.InputAutocompleteDesktop;
|
package/cssm/index.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { InputAutocompleteDesktop as InputAutocomplete, InputAutocompleteDesktopProps as InputAutocompleteProps } from "./Component.desktop";
|
|
2
|
+
export * from "./responsive";
|
package/cssm/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var Component_desktop = require('./Component.desktop.js');
|
|
4
|
+
var Component_responsive = require('./Component.responsive.js');
|
|
4
5
|
require('./tslib.es6-bbd6cd2a.js');
|
|
5
6
|
require('react');
|
|
6
7
|
require('@alfalab/core-components-select/cssm');
|
|
@@ -9,7 +10,16 @@ require('react-merge-refs');
|
|
|
9
10
|
require('classnames');
|
|
10
11
|
require('@alfalab/core-components-input/cssm');
|
|
11
12
|
require('./autocomplete-field/index.module.css');
|
|
13
|
+
require('@alfalab/hooks');
|
|
14
|
+
require('./Component.mobile.js');
|
|
15
|
+
require('lodash.throttle');
|
|
16
|
+
require('@alfalab/core-components-button/cssm');
|
|
17
|
+
require('./autocomplete-mobile-field/Component.js');
|
|
18
|
+
require('@alfalab/core-components-form-control/cssm');
|
|
19
|
+
require('./autocomplete-mobile-field/index.module.css');
|
|
20
|
+
require('./mobile.module.css');
|
|
12
21
|
|
|
13
22
|
|
|
14
23
|
|
|
15
|
-
exports.InputAutocomplete =
|
|
24
|
+
exports.InputAutocomplete = Component_desktop.InputAutocompleteDesktop;
|
|
25
|
+
exports.InputAutocompleteResponsive = Component_responsive.InputAutocompleteResponsive;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var Component_responsive = require('./Component.responsive.js');
|
|
4
|
+
require('./tslib.es6-bbd6cd2a.js');
|
|
5
|
+
require('react');
|
|
6
|
+
require('@alfalab/hooks');
|
|
7
|
+
require('./Component.desktop.js');
|
|
8
|
+
require('@alfalab/core-components-select/cssm');
|
|
9
|
+
require('./autocomplete-field/Component.js');
|
|
10
|
+
require('react-merge-refs');
|
|
11
|
+
require('classnames');
|
|
12
|
+
require('@alfalab/core-components-input/cssm');
|
|
13
|
+
require('./autocomplete-field/index.module.css');
|
|
14
|
+
require('./Component.mobile.js');
|
|
15
|
+
require('lodash.throttle');
|
|
16
|
+
require('@alfalab/core-components-button/cssm');
|
|
17
|
+
require('./autocomplete-mobile-field/Component.js');
|
|
18
|
+
require('@alfalab/core-components-form-control/cssm');
|
|
19
|
+
require('./autocomplete-mobile-field/index.module.css');
|
|
20
|
+
require('./mobile.module.css');
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
exports.InputAutocompleteResponsive = Component_responsive.InputAutocompleteResponsive;
|
package/desktop.d.ts
ADDED
package/desktop.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var Component_desktop = require('./Component.desktop.js');
|
|
4
|
+
require('./tslib.es6-89e6fcc2.js');
|
|
5
|
+
require('react');
|
|
6
|
+
require('@alfalab/core-components-select');
|
|
7
|
+
require('./autocomplete-field/Component.js');
|
|
8
|
+
require('react-merge-refs');
|
|
9
|
+
require('classnames');
|
|
10
|
+
require('@alfalab/core-components-input');
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
exports.InputAutocompleteDesktop = Component_desktop.InputAutocompleteDesktop;
|
|
@@ -3,7 +3,7 @@ import React from 'react';
|
|
|
3
3
|
import { ChangeEvent, FC, RefAttributes } from "react";
|
|
4
4
|
import { InputProps } from "@alfalab/core-components-input";
|
|
5
5
|
import { BaseSelectProps } from "@alfalab/core-components-select";
|
|
6
|
-
type
|
|
6
|
+
type InputAutocompleteDesktopProps = Omit<BaseSelectProps, 'Field' | 'nativeSelect'> & {
|
|
7
7
|
/**
|
|
8
8
|
* Компонент ввода значения
|
|
9
9
|
*/
|
|
@@ -33,11 +33,11 @@ type InputAutocompleteProps = Omit<BaseSelectProps, 'Field' | 'nativeSelect'> &
|
|
|
33
33
|
*/
|
|
34
34
|
updatePopover?: BaseSelectProps['updatePopover'];
|
|
35
35
|
};
|
|
36
|
-
declare const
|
|
36
|
+
declare const InputAutocompleteDesktop: React.ForwardRefExoticComponent<Omit<BaseSelectProps, "nativeSelect" | "Field"> & {
|
|
37
37
|
/**
|
|
38
38
|
* Компонент ввода значения
|
|
39
39
|
*/
|
|
40
|
-
Input?: React.FC<Omit<React.InputHTMLAttributes<HTMLInputElement>, "
|
|
40
|
+
Input?: React.FC<Omit<React.InputHTMLAttributes<HTMLInputElement>, "size" | "type" | "defaultValue" | "onChange" | "onClick" | "onMouseDown" | "value" | "enterKeyHint"> & {
|
|
41
41
|
value?: string | undefined;
|
|
42
42
|
defaultValue?: string | undefined;
|
|
43
43
|
block?: boolean | undefined;
|
|
@@ -49,7 +49,7 @@ declare const InputAutocomplete: React.ForwardRefExoticComponent<Omit<BaseSelect
|
|
|
49
49
|
hint?: React.ReactNode;
|
|
50
50
|
label?: React.ReactNode;
|
|
51
51
|
labelView?: "inner" | "outer" | undefined;
|
|
52
|
-
type?: "number" | "text" | "tel" | "email" | "
|
|
52
|
+
type?: "number" | "text" | "tel" | "email" | "card" | "money" | "password" | undefined;
|
|
53
53
|
wrapperRef?: React.Ref<HTMLDivElement> | undefined;
|
|
54
54
|
leftAddons?: React.ReactNode;
|
|
55
55
|
rightAddons?: React.ReactNode;
|
|
@@ -73,7 +73,7 @@ declare const InputAutocomplete: React.ForwardRefExoticComponent<Omit<BaseSelect
|
|
|
73
73
|
/**
|
|
74
74
|
* Пропсы, которые будут прокинуты в инпут
|
|
75
75
|
*/
|
|
76
|
-
inputProps?: (Omit<React.InputHTMLAttributes<HTMLInputElement>, "
|
|
76
|
+
inputProps?: (Omit<React.InputHTMLAttributes<HTMLInputElement>, "size" | "type" | "defaultValue" | "onChange" | "onClick" | "onMouseDown" | "value" | "enterKeyHint"> & {
|
|
77
77
|
value?: string | undefined;
|
|
78
78
|
defaultValue?: string | undefined;
|
|
79
79
|
block?: boolean | undefined;
|
|
@@ -85,7 +85,7 @@ declare const InputAutocomplete: React.ForwardRefExoticComponent<Omit<BaseSelect
|
|
|
85
85
|
hint?: React.ReactNode;
|
|
86
86
|
label?: React.ReactNode;
|
|
87
87
|
labelView?: "inner" | "outer" | undefined;
|
|
88
|
-
type?: "number" | "text" | "tel" | "email" | "
|
|
88
|
+
type?: "number" | "text" | "tel" | "email" | "card" | "money" | "password" | undefined;
|
|
89
89
|
wrapperRef?: React.Ref<HTMLDivElement> | undefined;
|
|
90
90
|
leftAddons?: React.ReactNode;
|
|
91
91
|
rightAddons?: React.ReactNode;
|
|
@@ -127,4 +127,4 @@ declare const InputAutocomplete: React.ForwardRefExoticComponent<Omit<BaseSelect
|
|
|
127
127
|
*/
|
|
128
128
|
updatePopover?: BaseSelectProps['updatePopover'];
|
|
129
129
|
} & React.RefAttributes<HTMLInputElement>>;
|
|
130
|
-
export {
|
|
130
|
+
export { InputAutocompleteDesktopProps, InputAutocompleteDesktop };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as __rest, a as __assign } from './tslib.es6-
|
|
1
|
+
import { _ as __rest, a as __assign } from './tslib.es6-4587d140.js';
|
|
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';
|
|
@@ -6,7 +6,7 @@ import 'react-merge-refs';
|
|
|
6
6
|
import 'classnames';
|
|
7
7
|
import '@alfalab/core-components-input/esm';
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var InputAutocompleteDesktop = forwardRef(function (_a, ref) {
|
|
10
10
|
var _b = _a.OptionsList, OptionsList$1 = _b === void 0 ? OptionsList : _b, _c = _a.Optgroup, Optgroup$1 = _c === void 0 ? Optgroup : _c, _d = _a.Option, Option$1 = _d === void 0 ? Option : _d, Input = _a.Input, _e = _a.inputProps, inputProps = _e === void 0 ? {} : _e, onInput = _a.onInput, value = _a.value, success = _a.success, readOnly = _a.readOnly, _f = _a.closeOnSelect, closeOnSelect = _f === void 0 ? false : _f, options = _a.options, restProps = __rest(_a, ["OptionsList", "Optgroup", "Option", "Input", "inputProps", "onInput", "value", "success", "readOnly", "closeOnSelect", "options"]);
|
|
11
11
|
return (React.createElement(BaseSelect, __assign({ ref: ref, autocomplete: true, options: options, closeOnSelect: closeOnSelect, Option: Option$1, Field: AutocompleteField, fieldProps: {
|
|
12
12
|
Input: Input,
|
|
@@ -18,4 +18,4 @@ var InputAutocomplete = forwardRef(function (_a, ref) {
|
|
|
18
18
|
}, Optgroup: Optgroup$1, OptionsList: OptionsList$1 }, restProps)));
|
|
19
19
|
});
|
|
20
20
|
|
|
21
|
-
export {
|
|
21
|
+
export { InputAutocompleteDesktop };
|
package/esm/Component.mobile.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as __rest, a as __assign } from './tslib.es6-
|
|
1
|
+
import { _ as __rest, a as __assign } from './tslib.es6-4587d140.js';
|
|
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-
|
|
13
|
+
var styles = {"bottomSheetInput":"input-autocomplete__bottomSheetInput_1hvu9","footer":"input-autocomplete__footer_1hvu9"};
|
|
14
14
|
require('./mobile.css')
|
|
15
15
|
|
|
16
16
|
var SELECTED = [];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { InputAutocompleteDesktopProps } from "./Component.desktop";
|
|
3
|
+
import { InputAutocompleteMobileProps } from "./Component.mobile";
|
|
4
|
+
type InputAutocompleteResponsiveProps = InputAutocompleteDesktopProps & InputAutocompleteMobileProps & {
|
|
5
|
+
/**
|
|
6
|
+
* Контрольная точка, с нее начинается desktop версия
|
|
7
|
+
* @default 1024
|
|
8
|
+
*/
|
|
9
|
+
breakpoint?: number;
|
|
10
|
+
};
|
|
11
|
+
type InputAutocompleteMedia = 'desktop' | 'mobile';
|
|
12
|
+
declare const InputAutocompleteResponsive: FC<InputAutocompleteResponsiveProps>;
|
|
13
|
+
export { InputAutocompleteResponsiveProps, InputAutocompleteMedia, InputAutocompleteResponsive };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { _ as __rest, a as __assign } from './tslib.es6-4587d140.js';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { useMedia } from '@alfalab/hooks';
|
|
4
|
+
import { InputAutocompleteDesktop } from './Component.desktop.js';
|
|
5
|
+
import { InputAutocompleteMobile } from './Component.mobile.js';
|
|
6
|
+
import '@alfalab/core-components-select/esm';
|
|
7
|
+
import './autocomplete-field/Component.js';
|
|
8
|
+
import 'react-merge-refs';
|
|
9
|
+
import 'classnames';
|
|
10
|
+
import '@alfalab/core-components-input/esm';
|
|
11
|
+
import 'lodash.throttle';
|
|
12
|
+
import '@alfalab/core-components-button/esm';
|
|
13
|
+
import './autocomplete-mobile-field/Component.js';
|
|
14
|
+
import '@alfalab/core-components-form-control/esm';
|
|
15
|
+
|
|
16
|
+
var InputAutocompleteResponsive = function (_a) {
|
|
17
|
+
var _b = _a.breakpoint, breakpoint = _b === void 0 ? 1024 : _b, restProps = __rest(_a, ["breakpoint"]);
|
|
18
|
+
var view = useMedia([
|
|
19
|
+
['mobile', "(max-width: ".concat(breakpoint - 1, "px)")],
|
|
20
|
+
['desktop', "(min-width: ".concat(breakpoint, "px)")],
|
|
21
|
+
], 'desktop')[0];
|
|
22
|
+
return view === 'desktop' ? (React.createElement(InputAutocompleteDesktop, __assign({}, restProps))) : (React.createElement(InputAutocompleteMobile, __assign({}, restProps)));
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export { InputAutocompleteResponsive };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { FieldProps } from "@alfalab/core-components-select";
|
|
3
|
-
import {
|
|
4
|
-
type AutocompleteFieldProps = FieldProps & Pick<
|
|
3
|
+
import { InputAutocompleteDesktopProps } from "../Component.desktop";
|
|
4
|
+
type AutocompleteFieldProps = FieldProps & Pick<InputAutocompleteDesktopProps, 'Input' | 'inputProps' | 'value' | 'onInput' | 'readOnly'>;
|
|
5
5
|
declare const AutocompleteField: ({ label, labelView, placeholder, size, Arrow, Input, value, error, success, hint, disabled, readOnly, onInput, inputProps, innerProps, }: AutocompleteFieldProps) => JSX.Element;
|
|
6
6
|
export { AutocompleteFieldProps, AutocompleteField };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { a as __assign } from '../tslib.es6-
|
|
1
|
+
import { a as __assign } from '../tslib.es6-4587d140.js';
|
|
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-
|
|
7
|
+
var styles = {"arrow":"input-autocomplete__arrow_1ff63","error":"input-autocomplete__error_1ff63"};
|
|
8
8
|
require('./index.css')
|
|
9
9
|
|
|
10
10
|
var AutocompleteField = function (_a) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { _ as __rest, a as __assign } from '../tslib.es6-
|
|
1
|
+
import { _ as __rest, a as __assign } from '../tslib.es6-4587d140.js';
|
|
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-
|
|
7
|
+
var styles = {"component":"input-autocomplete__component_vxtnq","field":"input-autocomplete__field_vxtnq","disabled":"input-autocomplete__disabled_vxtnq","placeholder":"input-autocomplete__placeholder_vxtnq","contentWrapper":"input-autocomplete__contentWrapper_vxtnq","value":"input-autocomplete__value_vxtnq","focusVisible":"input-autocomplete__focusVisible_vxtnq"};
|
|
8
8
|
require('./index.css')
|
|
9
9
|
|
|
10
10
|
var AutocompleteMobileField = function (_a) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: ezeif */
|
|
2
2
|
:root {
|
|
3
3
|
--color-light-border-link: #007aff;
|
|
4
4
|
--color-light-text-secondary: rgba(11, 31, 53, 0.7);
|
|
@@ -15,20 +15,20 @@
|
|
|
15
15
|
--focus-color: var(--color-light-border-link);
|
|
16
16
|
--disabled-cursor: not-allowed;
|
|
17
17
|
}
|
|
18
|
-
.input-
|
|
18
|
+
.input-autocomplete__component_vxtnq {
|
|
19
19
|
width: 100%;
|
|
20
20
|
outline: none;
|
|
21
21
|
}
|
|
22
|
-
.input-
|
|
22
|
+
.input-autocomplete__field_vxtnq:not(.input-autocomplete__disabled_vxtnq) {
|
|
23
23
|
cursor: pointer;
|
|
24
24
|
}
|
|
25
|
-
.input-
|
|
25
|
+
.input-autocomplete__disabled_vxtnq {
|
|
26
26
|
cursor: var(--disabled-cursor);
|
|
27
27
|
}
|
|
28
|
-
.input-
|
|
28
|
+
.input-autocomplete__placeholder_vxtnq {
|
|
29
29
|
color: var(--color-light-text-secondary);
|
|
30
30
|
}
|
|
31
|
-
.input-
|
|
31
|
+
.input-autocomplete__contentWrapper_vxtnq {
|
|
32
32
|
font-size: 16px;
|
|
33
33
|
line-height: 20px;
|
|
34
34
|
font-weight: 400;
|
|
@@ -38,12 +38,12 @@
|
|
|
38
38
|
overflow: hidden;
|
|
39
39
|
width: 100%;
|
|
40
40
|
}
|
|
41
|
-
.input-
|
|
41
|
+
.input-autocomplete__value_vxtnq {
|
|
42
42
|
overflow: hidden;
|
|
43
43
|
text-overflow: ellipsis;
|
|
44
44
|
text-align: left;
|
|
45
45
|
}
|
|
46
|
-
.input-
|
|
46
|
+
.input-autocomplete__focusVisible_vxtnq {
|
|
47
47
|
outline: 2px solid var(--focus-color);
|
|
48
48
|
outline-offset: 2px;
|
|
49
49
|
}
|
package/esm/desktop.d.ts
ADDED
package/esm/desktop.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { InputAutocompleteDesktop } from './Component.desktop.js';
|
|
2
|
+
import './tslib.es6-4587d140.js';
|
|
3
|
+
import 'react';
|
|
4
|
+
import '@alfalab/core-components-select/esm';
|
|
5
|
+
import './autocomplete-field/Component.js';
|
|
6
|
+
import 'react-merge-refs';
|
|
7
|
+
import 'classnames';
|
|
8
|
+
import '@alfalab/core-components-input/esm';
|
package/esm/index.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { InputAutocompleteDesktop as InputAutocomplete, InputAutocompleteDesktopProps as InputAutocompleteProps } from "./Component.desktop";
|
|
2
|
+
export * from "./responsive";
|
package/esm/index.js
CHANGED
|
@@ -1,8 +1,15 @@
|
|
|
1
|
-
export { InputAutocomplete } from './Component.js';
|
|
2
|
-
|
|
1
|
+
export { InputAutocompleteDesktop as InputAutocomplete } from './Component.desktop.js';
|
|
2
|
+
export { InputAutocompleteResponsive } from './Component.responsive.js';
|
|
3
|
+
import './tslib.es6-4587d140.js';
|
|
3
4
|
import 'react';
|
|
4
5
|
import '@alfalab/core-components-select/esm';
|
|
5
6
|
import './autocomplete-field/Component.js';
|
|
6
7
|
import 'react-merge-refs';
|
|
7
8
|
import 'classnames';
|
|
8
9
|
import '@alfalab/core-components-input/esm';
|
|
10
|
+
import '@alfalab/hooks';
|
|
11
|
+
import './Component.mobile.js';
|
|
12
|
+
import 'lodash.throttle';
|
|
13
|
+
import '@alfalab/core-components-button/esm';
|
|
14
|
+
import './autocomplete-mobile-field/Component.js';
|
|
15
|
+
import '@alfalab/core-components-form-control/esm';
|
package/esm/mobile.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 9d86v */
|
|
2
2
|
:root {
|
|
3
3
|
|
|
4
4
|
/* Hard */
|
|
@@ -11,13 +11,13 @@
|
|
|
11
11
|
--gap-xs: 8px;
|
|
12
12
|
--gap-m: 16px;
|
|
13
13
|
}
|
|
14
|
-
.input-
|
|
14
|
+
.input-autocomplete__bottomSheetInput_1hvu9 {
|
|
15
15
|
padding: 0 var(--gap-xs) var(--gap-xs);
|
|
16
16
|
box-sizing: border-box;
|
|
17
17
|
}
|
|
18
|
-
.input-
|
|
18
|
+
.input-autocomplete__footer_1hvu9 {
|
|
19
19
|
display: flex
|
|
20
20
|
}
|
|
21
|
-
.input-
|
|
21
|
+
.input-autocomplete__footer_1hvu9 > button + button {
|
|
22
22
|
margin-left: var(--gap-m);
|
|
23
23
|
}
|
package/esm/mobile.js
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export { InputAutocompleteResponsive } from './Component.responsive.js';
|
|
2
|
+
import './tslib.es6-4587d140.js';
|
|
3
|
+
import 'react';
|
|
4
|
+
import '@alfalab/hooks';
|
|
5
|
+
import './Component.desktop.js';
|
|
6
|
+
import '@alfalab/core-components-select/esm';
|
|
7
|
+
import './autocomplete-field/Component.js';
|
|
8
|
+
import 'react-merge-refs';
|
|
9
|
+
import 'classnames';
|
|
10
|
+
import '@alfalab/core-components-input/esm';
|
|
11
|
+
import './Component.mobile.js';
|
|
12
|
+
import 'lodash.throttle';
|
|
13
|
+
import '@alfalab/core-components-button/esm';
|
|
14
|
+
import './autocomplete-mobile-field/Component.js';
|
|
15
|
+
import '@alfalab/core-components-form-control/esm';
|
|
File without changes
|
|
File without changes
|
package/index.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { InputAutocompleteDesktop as InputAutocomplete, InputAutocompleteDesktopProps as InputAutocompleteProps } from "./Component.desktop";
|
|
2
|
+
export * from "./responsive";
|
package/index.js
CHANGED
|
@@ -1,14 +1,22 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./
|
|
3
|
+
var Component_desktop = require('./Component.desktop.js');
|
|
4
|
+
var Component_responsive = require('./Component.responsive.js');
|
|
5
|
+
require('./tslib.es6-89e6fcc2.js');
|
|
5
6
|
require('react');
|
|
6
7
|
require('@alfalab/core-components-select');
|
|
7
8
|
require('./autocomplete-field/Component.js');
|
|
8
9
|
require('react-merge-refs');
|
|
9
10
|
require('classnames');
|
|
10
11
|
require('@alfalab/core-components-input');
|
|
12
|
+
require('@alfalab/hooks');
|
|
13
|
+
require('./Component.mobile.js');
|
|
14
|
+
require('lodash.throttle');
|
|
15
|
+
require('@alfalab/core-components-button');
|
|
16
|
+
require('./autocomplete-mobile-field/Component.js');
|
|
17
|
+
require('@alfalab/core-components-form-control');
|
|
11
18
|
|
|
12
19
|
|
|
13
20
|
|
|
14
|
-
exports.InputAutocomplete =
|
|
21
|
+
exports.InputAutocomplete = Component_desktop.InputAutocompleteDesktop;
|
|
22
|
+
exports.InputAutocompleteResponsive = Component_responsive.InputAutocompleteResponsive;
|
package/mobile.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 9d86v */
|
|
2
2
|
:root {
|
|
3
3
|
|
|
4
4
|
/* Hard */
|
|
@@ -11,13 +11,13 @@
|
|
|
11
11
|
--gap-xs: 8px;
|
|
12
12
|
--gap-m: 16px;
|
|
13
13
|
}
|
|
14
|
-
.input-
|
|
14
|
+
.input-autocomplete__bottomSheetInput_1hvu9 {
|
|
15
15
|
padding: 0 var(--gap-xs) var(--gap-xs);
|
|
16
16
|
box-sizing: border-box;
|
|
17
17
|
}
|
|
18
|
-
.input-
|
|
18
|
+
.input-autocomplete__footer_1hvu9 {
|
|
19
19
|
display: flex
|
|
20
20
|
}
|
|
21
|
-
.input-
|
|
21
|
+
.input-autocomplete__footer_1hvu9 > button + button {
|
|
22
22
|
margin-left: var(--gap-m);
|
|
23
23
|
}
|
package/mobile.js
CHANGED
|
@@ -3,7 +3,7 @@ import React from 'react';
|
|
|
3
3
|
import { ChangeEvent, FC, RefAttributes } from "react";
|
|
4
4
|
import { InputProps } from "@alfalab/core-components-input";
|
|
5
5
|
import { BaseSelectProps } from "@alfalab/core-components-select";
|
|
6
|
-
type
|
|
6
|
+
type InputAutocompleteDesktopProps = Omit<BaseSelectProps, 'Field' | 'nativeSelect'> & {
|
|
7
7
|
/**
|
|
8
8
|
* Компонент ввода значения
|
|
9
9
|
*/
|
|
@@ -33,11 +33,11 @@ type InputAutocompleteProps = Omit<BaseSelectProps, 'Field' | 'nativeSelect'> &
|
|
|
33
33
|
*/
|
|
34
34
|
updatePopover?: BaseSelectProps['updatePopover'];
|
|
35
35
|
};
|
|
36
|
-
declare const
|
|
36
|
+
declare const InputAutocompleteDesktop: React.ForwardRefExoticComponent<Omit<BaseSelectProps, "nativeSelect" | "Field"> & {
|
|
37
37
|
/**
|
|
38
38
|
* Компонент ввода значения
|
|
39
39
|
*/
|
|
40
|
-
Input?: React.FC<Omit<React.InputHTMLAttributes<HTMLInputElement>, "
|
|
40
|
+
Input?: React.FC<Omit<React.InputHTMLAttributes<HTMLInputElement>, "size" | "type" | "defaultValue" | "onChange" | "onClick" | "onMouseDown" | "value" | "enterKeyHint"> & {
|
|
41
41
|
value?: string | undefined;
|
|
42
42
|
defaultValue?: string | undefined;
|
|
43
43
|
block?: boolean | undefined;
|
|
@@ -49,7 +49,7 @@ declare const InputAutocomplete: React.ForwardRefExoticComponent<Omit<BaseSelect
|
|
|
49
49
|
hint?: React.ReactNode;
|
|
50
50
|
label?: React.ReactNode;
|
|
51
51
|
labelView?: "inner" | "outer" | undefined;
|
|
52
|
-
type?: "number" | "text" | "tel" | "email" | "
|
|
52
|
+
type?: "number" | "text" | "tel" | "email" | "card" | "money" | "password" | undefined;
|
|
53
53
|
wrapperRef?: React.Ref<HTMLDivElement> | undefined;
|
|
54
54
|
leftAddons?: React.ReactNode;
|
|
55
55
|
rightAddons?: React.ReactNode;
|
|
@@ -73,7 +73,7 @@ declare const InputAutocomplete: React.ForwardRefExoticComponent<Omit<BaseSelect
|
|
|
73
73
|
/**
|
|
74
74
|
* Пропсы, которые будут прокинуты в инпут
|
|
75
75
|
*/
|
|
76
|
-
inputProps?: (Omit<React.InputHTMLAttributes<HTMLInputElement>, "
|
|
76
|
+
inputProps?: (Omit<React.InputHTMLAttributes<HTMLInputElement>, "size" | "type" | "defaultValue" | "onChange" | "onClick" | "onMouseDown" | "value" | "enterKeyHint"> & {
|
|
77
77
|
value?: string | undefined;
|
|
78
78
|
defaultValue?: string | undefined;
|
|
79
79
|
block?: boolean | undefined;
|
|
@@ -85,7 +85,7 @@ declare const InputAutocomplete: React.ForwardRefExoticComponent<Omit<BaseSelect
|
|
|
85
85
|
hint?: React.ReactNode;
|
|
86
86
|
label?: React.ReactNode;
|
|
87
87
|
labelView?: "inner" | "outer" | undefined;
|
|
88
|
-
type?: "number" | "text" | "tel" | "email" | "
|
|
88
|
+
type?: "number" | "text" | "tel" | "email" | "card" | "money" | "password" | undefined;
|
|
89
89
|
wrapperRef?: React.Ref<HTMLDivElement> | undefined;
|
|
90
90
|
leftAddons?: React.ReactNode;
|
|
91
91
|
rightAddons?: React.ReactNode;
|
|
@@ -127,4 +127,4 @@ declare const InputAutocomplete: React.ForwardRefExoticComponent<Omit<BaseSelect
|
|
|
127
127
|
*/
|
|
128
128
|
updatePopover?: BaseSelectProps['updatePopover'];
|
|
129
129
|
} & React.RefAttributes<HTMLInputElement>>;
|
|
130
|
-
export {
|
|
130
|
+
export { InputAutocompleteDesktopProps, InputAutocompleteDesktop };
|
|
@@ -5,7 +5,7 @@ import 'react-merge-refs';
|
|
|
5
5
|
import 'classnames';
|
|
6
6
|
import '@alfalab/core-components-input/modern';
|
|
7
7
|
|
|
8
|
-
const
|
|
8
|
+
const InputAutocompleteDesktop = forwardRef(({ OptionsList: OptionsList$1 = OptionsList, Optgroup: Optgroup$1 = Optgroup, Option: Option$1 = Option, Input, inputProps = {}, onInput, value, success, readOnly, closeOnSelect = false, options, ...restProps }, ref) => (React.createElement(BaseSelect, { ref: ref, autocomplete: true, options: options, closeOnSelect: closeOnSelect, Option: Option$1, Field: AutocompleteField, fieldProps: {
|
|
9
9
|
Input,
|
|
10
10
|
onInput,
|
|
11
11
|
value,
|
|
@@ -14,4 +14,4 @@ const InputAutocomplete = forwardRef(({ OptionsList: OptionsList$1 = OptionsList
|
|
|
14
14
|
success,
|
|
15
15
|
}, Optgroup: Optgroup$1, OptionsList: OptionsList$1, ...restProps })));
|
|
16
16
|
|
|
17
|
-
export {
|
|
17
|
+
export { InputAutocompleteDesktop };
|