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