@alfalab/core-components-input-autocomplete 10.1.5 → 10.2.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.desktop.d.ts +4 -8
- package/Component.desktop.js +1 -8
- package/Component.mobile.js +3 -2
- package/Component.modal.mobile.js +3 -2
- package/Component.responsive.d.ts +2 -2
- package/Component.responsive.js +2 -1
- package/autocomplete-field/Component.js +1 -1
- package/autocomplete-field/index.css +2 -2
- package/autocomplete-mobile-field/Component.js +3 -2
- package/autocomplete-mobile-field/index.css +8 -8
- package/autocomplete-mobile-field/index.js +1 -0
- package/cssm/Component.desktop.d.ts +4 -8
- package/cssm/Component.desktop.js +1 -8
- package/cssm/Component.mobile.js +2 -1
- package/cssm/Component.modal.mobile.js +2 -1
- package/cssm/Component.responsive.d.ts +2 -2
- package/cssm/Component.responsive.js +1 -0
- package/cssm/autocomplete-mobile-field/Component.js +2 -1
- package/cssm/autocomplete-mobile-field/index.js +1 -0
- package/cssm/hook-8abfea97.d.ts +1 -1
- package/cssm/index-c76d6398.d.ts +185 -2
- package/cssm/index-ebda875c.d.ts +10 -0
- package/cssm/index-f12ee135.d.ts +52 -3
- package/cssm/index.js +1 -0
- package/cssm/mobile.js +1 -0
- package/{esm/types-e40becc7.d.ts → cssm/types-72dda473.d.ts} +1 -1
- package/esm/Component.desktop.d.ts +4 -8
- package/esm/Component.desktop.js +1 -8
- package/esm/Component.mobile.js +3 -2
- package/esm/Component.modal.mobile.js +3 -2
- package/esm/Component.responsive.d.ts +2 -2
- package/esm/Component.responsive.js +2 -1
- package/esm/autocomplete-field/Component.js +1 -1
- package/esm/autocomplete-field/index.css +2 -2
- package/esm/autocomplete-mobile-field/Component.js +3 -2
- package/esm/autocomplete-mobile-field/index.css +8 -8
- package/esm/autocomplete-mobile-field/index.js +1 -0
- package/esm/hook-8abfea97.d.ts +1 -1
- package/esm/index-c76d6398.d.ts +185 -2
- package/esm/index-ebda875c.d.ts +10 -0
- package/esm/index-f12ee135.d.ts +52 -3
- package/esm/index.js +2 -1
- package/esm/mobile.css +4 -4
- package/esm/mobile.js +2 -1
- package/esm/{mobile.module-f307ef66.js → mobile.module-db1787d4.js} +1 -1
- package/{cssm/types-e40becc7.d.ts → esm/types-72dda473.d.ts} +1 -1
- package/hook-8abfea97.d.ts +1 -1
- package/index-c76d6398.d.ts +185 -2
- package/index-ebda875c.d.ts +10 -0
- package/index-f12ee135.d.ts +52 -3
- package/index.js +2 -1
- package/mobile.css +4 -4
- package/mobile.js +2 -1
- package/{mobile.module-43cba89a.js → mobile.module-a683dbb2.js} +1 -1
- package/modern/Component.desktop.d.ts +4 -8
- package/modern/Component.desktop.js +3 -2
- package/modern/Component.mobile.js +6 -2
- package/modern/Component.modal.mobile.js +4 -3
- package/modern/Component.responsive.d.ts +2 -2
- package/modern/Component.responsive.js +2 -1
- package/modern/autocomplete-field/Component.js +1 -1
- package/modern/autocomplete-field/index.css +2 -2
- package/modern/autocomplete-mobile-field/Component.js +3 -2
- package/modern/autocomplete-mobile-field/index.css +8 -8
- package/modern/autocomplete-mobile-field/index.js +1 -0
- package/modern/hook-8abfea97.d.ts +1 -1
- package/modern/index-c76d6398.d.ts +185 -2
- package/modern/index-ebda875c.d.ts +10 -0
- package/modern/index-f12ee135.d.ts +52 -3
- package/modern/index.js +2 -1
- package/modern/mobile.css +4 -4
- package/modern/mobile.js +2 -1
- package/modern/{mobile.module-acdcfda7.js → mobile.module-5660f91c.js} +1 -1
- package/modern/{types-e40becc7.d.ts → types-72dda473.d.ts} +1 -1
- package/package.json +6 -5
- package/src/Component.desktop.tsx +5 -3
- package/src/Component.mobile.tsx +9 -6
- package/src/Component.modal.mobile.tsx +5 -5
- package/src/autocomplete-mobile-field/Component.tsx +2 -1
- package/{types-e40becc7.d.ts → types-72dda473.d.ts} +1 -1
- package/Component-1a4fbd11.d.ts +0 -276
- package/Component-72dda473.d.ts +0 -53
- package/component-1a4fbd11.d.ts +0 -44
- package/cssm/Component-1a4fbd11.d.ts +0 -276
- package/cssm/Component-72dda473.d.ts +0 -53
- package/cssm/component-1a4fbd11.d.ts +0 -44
- package/cssm/index-1a4fbd11.d.ts +0 -22
- package/cssm/types-83e2bd9e.d.ts +0 -113
- package/cssm/utils-49cc3c24.d.ts +0 -8
- package/esm/Component-1a4fbd11.d.ts +0 -276
- package/esm/Component-72dda473.d.ts +0 -53
- package/esm/component-1a4fbd11.d.ts +0 -44
- package/esm/index-1a4fbd11.d.ts +0 -22
- package/esm/types-83e2bd9e.d.ts +0 -113
- package/esm/utils-49cc3c24.d.ts +0 -8
- package/index-1a4fbd11.d.ts +0 -22
- package/modern/Component-1a4fbd11.d.ts +0 -276
- package/modern/Component-72dda473.d.ts +0 -53
- package/modern/component-1a4fbd11.d.ts +0 -44
- package/modern/index-1a4fbd11.d.ts +0 -22
- package/modern/types-83e2bd9e.d.ts +0 -113
- package/modern/utils-49cc3c24.d.ts +0 -8
- package/types-83e2bd9e.d.ts +0 -113
- package/utils-49cc3c24.d.ts +0 -8
package/cssm/index.js
CHANGED
|
@@ -20,6 +20,7 @@ require('@alfalab/core-components-input/cssm');
|
|
|
20
20
|
require('@alfalab/core-components-select/cssm/mobile');
|
|
21
21
|
require('./autocomplete-mobile-field/Component.js');
|
|
22
22
|
require('@alfalab/core-components-form-control/cssm/mobile');
|
|
23
|
+
require('@alfalab/core-components-shared/cssm');
|
|
23
24
|
require('./autocomplete-mobile-field/index.module.css');
|
|
24
25
|
require('./mobile.module.css');
|
|
25
26
|
|
package/cssm/mobile.js
CHANGED
|
@@ -14,6 +14,7 @@ require('@alfalab/core-components-input/cssm');
|
|
|
14
14
|
require('@alfalab/core-components-select/cssm/mobile');
|
|
15
15
|
require('./autocomplete-mobile-field/Component.js');
|
|
16
16
|
require('@alfalab/core-components-form-control/cssm/mobile');
|
|
17
|
+
require('@alfalab/core-components-shared/cssm');
|
|
17
18
|
require('@alfalab/hooks');
|
|
18
19
|
require('./autocomplete-mobile-field/index.module.css');
|
|
19
20
|
require('./mobile.module.css');
|
|
@@ -37,20 +37,16 @@ declare const InputAutocompleteDesktop: React.ForwardRefExoticComponent<Omit<Bas
|
|
|
37
37
|
/**
|
|
38
38
|
* Компонент ввода значения
|
|
39
39
|
*/
|
|
40
|
-
Input?: React.FC<Omit<import("./autocomplete-field/Component").BaseInputProps, "
|
|
40
|
+
Input?: React.FC<Omit<import("./autocomplete-field/Component").BaseInputProps, "colorStyles" | "FormControlComponent"> & {
|
|
41
41
|
breakpoint?: number | undefined;
|
|
42
|
-
defaultMatchMediaValue?: boolean | (() => boolean) | undefined;
|
|
43
|
-
* Пропсы, которые будут прокинуты в инпут
|
|
44
|
-
*/
|
|
42
|
+
defaultMatchMediaValue?: boolean | (() => boolean) | undefined;
|
|
45
43
|
} & React.RefAttributes<HTMLInputElement>> | undefined;
|
|
46
44
|
/**
|
|
47
45
|
* Пропсы, которые будут прокинуты в инпут
|
|
48
46
|
*/
|
|
49
|
-
inputProps?: (Omit<import("./autocomplete-field/Component").BaseInputProps, "
|
|
47
|
+
inputProps?: (Omit<import("./autocomplete-field/Component").BaseInputProps, "colorStyles" | "FormControlComponent"> & {
|
|
50
48
|
breakpoint?: number | undefined;
|
|
51
|
-
defaultMatchMediaValue?: boolean | (() => boolean) | undefined;
|
|
52
|
-
* Пропсы, которые будут прокинуты в инпут
|
|
53
|
-
*/
|
|
49
|
+
defaultMatchMediaValue?: boolean | (() => boolean) | undefined;
|
|
54
50
|
} & Record<string, unknown>) | undefined;
|
|
55
51
|
/**
|
|
56
52
|
* Значение поля ввода
|
package/esm/Component.desktop.js
CHANGED
|
@@ -8,14 +8,7 @@ import '@alfalab/core-components-input/esm/desktop';
|
|
|
8
8
|
|
|
9
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
|
-
return (React.createElement(BaseSelect, __assign({ ref: ref, autocomplete: true, options: options, closeOnSelect: closeOnSelect, Option: Option$1, Field: AutocompleteField, fieldProps: {
|
|
12
|
-
Input: Input,
|
|
13
|
-
onInput: onInput,
|
|
14
|
-
value: value,
|
|
15
|
-
inputProps: inputProps,
|
|
16
|
-
readOnly: readOnly,
|
|
17
|
-
success: success,
|
|
18
|
-
}, Optgroup: Optgroup$1, OptionsList: OptionsList$1 }, restProps)));
|
|
11
|
+
return (React.createElement(BaseSelect, __assign({ ref: ref, autocomplete: true, options: options, closeOnSelect: closeOnSelect, Option: Option$1, Field: AutocompleteField, Optgroup: Optgroup$1, OptionsList: OptionsList$1 }, restProps, { fieldProps: __assign(__assign({}, restProps.fieldProps), { Input: Input, onInput: onInput, value: value, inputProps: inputProps, readOnly: readOnly, success: success }) })));
|
|
19
12
|
});
|
|
20
13
|
|
|
21
14
|
export { InputAutocompleteDesktop };
|
package/esm/Component.mobile.js
CHANGED
|
@@ -7,8 +7,9 @@ import { ButtonMobile } from '@alfalab/core-components-button/esm/mobile';
|
|
|
7
7
|
import { Input } from '@alfalab/core-components-input/esm';
|
|
8
8
|
import { SelectMobile } from '@alfalab/core-components-select/esm/mobile';
|
|
9
9
|
import { AutocompleteMobileField } from './autocomplete-mobile-field/Component.js';
|
|
10
|
-
import { s as styles } from './mobile.module-
|
|
10
|
+
import { s as styles } from './mobile.module-db1787d4.js';
|
|
11
11
|
import '@alfalab/core-components-form-control/esm/mobile';
|
|
12
|
+
import '@alfalab/core-components-shared/esm';
|
|
12
13
|
import '@alfalab/hooks';
|
|
13
14
|
|
|
14
15
|
var SELECTED = [];
|
|
@@ -72,7 +73,7 @@ var InputAutocompleteMobile = React.forwardRef(function (_a, ref) {
|
|
|
72
73
|
bottomSheetHeaderAddonsProps.ref,
|
|
73
74
|
]) }))), initialHeight: 'full' }, bottomSheetProps), { containerProps: __assign({ onTouchMove: handleOptionsListTouchMove }, bottomSheetProps.containerProps) });
|
|
74
75
|
};
|
|
75
|
-
return (React.createElement(SelectMobile, __assign({ ref: mergeRefs([targetRef, ref]), selected: selected || SELECTED, open: Boolean(open || openProp), onOpen: handleOpen,
|
|
76
|
+
return (React.createElement(SelectMobile, __assign({ useWithApplyHook: false, Field: AutocompleteMobileField }, restProps, { ref: mergeRefs([targetRef, ref]), selected: selected || SELECTED, open: Boolean(open || openProp), onOpen: handleOpen, Arrow: Arrow, onChange: handleChange, placeholder: placeholder, label: label, size: size, name: name, multiple: multiple, bottomSheetProps: getBottomSheetProps(), optionsListProps: __assign({ showFooter: false }, restProps.optionsListProps), fieldProps: __assign({ value: value }, restProps.fieldProps) })));
|
|
76
77
|
});
|
|
77
78
|
|
|
78
79
|
export { InputAutocompleteMobile };
|
|
@@ -7,8 +7,9 @@ import { ButtonMobile } from '@alfalab/core-components-button/esm/mobile';
|
|
|
7
7
|
import { Input } from '@alfalab/core-components-input/esm';
|
|
8
8
|
import { SelectModalMobile } from '@alfalab/core-components-select/esm/mobile';
|
|
9
9
|
import { AutocompleteMobileField } from './autocomplete-mobile-field/Component.js';
|
|
10
|
-
import { s as styles } from './mobile.module-
|
|
10
|
+
import { s as styles } from './mobile.module-db1787d4.js';
|
|
11
11
|
import '@alfalab/core-components-form-control/esm/mobile';
|
|
12
|
+
import '@alfalab/core-components-shared/esm';
|
|
12
13
|
import '@alfalab/hooks';
|
|
13
14
|
|
|
14
15
|
var InputAutocompleteModalMobile = React.forwardRef(function (_a, ref) {
|
|
@@ -60,7 +61,7 @@ var InputAutocompleteModalMobile = React.forwardRef(function (_a, ref) {
|
|
|
60
61
|
var renderFooter = function () { return (React.createElement(React.Fragment, null,
|
|
61
62
|
React.createElement(ButtonMobile, __assign({ block: true, view: 'secondary', size: 'm', onClick: handleCancel }, cancelButtonProps), "\u041E\u0442\u043C\u0435\u043D\u0430"),
|
|
62
63
|
React.createElement(ButtonMobile, __assign({ block: true, view: 'primary', size: 'm', onClick: handleApply }, continueButtonProps), "\u041F\u0440\u043E\u0434\u043E\u043B\u0436\u0438\u0442\u044C"))); };
|
|
63
|
-
return (React.createElement(SelectModalMobile, __assign({ ref: mergeRefs([ref, targetRef]),
|
|
64
|
+
return (React.createElement(SelectModalMobile, __assign({ Field: AutocompleteMobileField, useWithApplyHook: false }, restProps, { ref: mergeRefs([ref, targetRef]), Arrow: Arrow, onOpen: handleOpen, onChange: handleChange, multiple: multiple, open: openProp !== null && openProp !== void 0 ? openProp : open, size: size, fieldProps: __assign({ value: value }, restProps.fieldProps), placeholder: placeholder, name: name, modalProps: __assign(__assign({}, modalProps), { componentRef: modalScrollableRef }), modalHeaderProps: __assign(__assign({}, modalHeaderProps), { bottomAddons: renderBottomAddon() }), modalFooterProps: __assign(__assign({ sticky: true }, modalFooterProps), { children: renderFooter() }) })));
|
|
64
65
|
});
|
|
65
66
|
|
|
66
67
|
export { InputAutocompleteModalMobile };
|
|
@@ -13,11 +13,11 @@ type InputAutocompleteResponsiveProps = InputAutocompleteDesktopProps & InputAut
|
|
|
13
13
|
};
|
|
14
14
|
type InputAutocompleteMedia = 'desktop' | 'mobile';
|
|
15
15
|
declare const InputAutocompleteResponsive: React.ForwardRefExoticComponent<Omit<BaseSelectProps, "nativeSelect" | "Field"> & {
|
|
16
|
-
Input?: React.FC<Omit<import("./autocomplete-field/Component").BaseInputProps, "
|
|
16
|
+
Input?: React.FC<Omit<import("./autocomplete-field/Component").BaseInputProps, "colorStyles" | "FormControlComponent"> & {
|
|
17
17
|
breakpoint?: number | undefined;
|
|
18
18
|
defaultMatchMediaValue?: boolean | (() => boolean) | undefined;
|
|
19
19
|
} & React.RefAttributes<HTMLInputElement>> | undefined;
|
|
20
|
-
inputProps?: (Omit<import("./autocomplete-field/Component").BaseInputProps, "
|
|
20
|
+
inputProps?: (Omit<import("./autocomplete-field/Component").BaseInputProps, "colorStyles" | "FormControlComponent"> & {
|
|
21
21
|
breakpoint?: number | undefined;
|
|
22
22
|
defaultMatchMediaValue?: boolean | (() => boolean) | undefined;
|
|
23
23
|
} & Record<string, unknown>) | undefined;
|
|
@@ -14,7 +14,8 @@ import '@alfalab/core-components-input/esm';
|
|
|
14
14
|
import '@alfalab/core-components-select/esm/mobile';
|
|
15
15
|
import './autocomplete-mobile-field/Component.js';
|
|
16
16
|
import '@alfalab/core-components-form-control/esm/mobile';
|
|
17
|
-
import '
|
|
17
|
+
import '@alfalab/core-components-shared/esm';
|
|
18
|
+
import './mobile.module-db1787d4.js';
|
|
18
19
|
|
|
19
20
|
var InputAutocompleteResponsive = forwardRef(function (_a, ref) {
|
|
20
21
|
var _b = _a.breakpoint, breakpoint = _b === void 0 ? 1024 : _b, restProps = __rest(_a, ["breakpoint"]);
|
|
@@ -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_1ovyt","error":"input-autocomplete__error_1ovyt"};
|
|
8
8
|
require('./index.css')
|
|
9
9
|
|
|
10
10
|
var AutocompleteField = function (_a) {
|
|
@@ -2,9 +2,10 @@ import { __rest, __assign } from 'tslib';
|
|
|
2
2
|
import React, { useState, useRef } from 'react';
|
|
3
3
|
import cn from 'classnames';
|
|
4
4
|
import { FormControlMobile } from '@alfalab/core-components-form-control/esm/mobile';
|
|
5
|
+
import { getDataTestId } from '@alfalab/core-components-shared/esm';
|
|
5
6
|
import { useFocus } from '@alfalab/hooks';
|
|
6
7
|
|
|
7
|
-
var styles = {"component":"input-
|
|
8
|
+
var styles = {"component":"input-autocomplete__component_1ruvq","field":"input-autocomplete__field_1ruvq","disabled":"input-autocomplete__disabled_1ruvq","placeholder":"input-autocomplete__placeholder_1ruvq","contentWrapper":"input-autocomplete__contentWrapper_1ruvq","value":"input-autocomplete__value_1ruvq","focusVisible":"input-autocomplete__focusVisible_1ruvq"};
|
|
8
9
|
require('./index.css')
|
|
9
10
|
|
|
10
11
|
var AutocompleteMobileField = function (_a) {
|
|
@@ -19,7 +20,7 @@ var AutocompleteMobileField = function (_a) {
|
|
|
19
20
|
React.createElement(FormControlMobile, __assign({ fieldClassName: cn(styles.field, fieldClassName, (_b = {},
|
|
20
21
|
_b[styles.disabled] = disabled,
|
|
21
22
|
_b[styles.focusVisible] = focusVisible,
|
|
22
|
-
_b)), block: true, size: size, focused: focused, disabled: disabled, filled: filled, labelView: labelView, rightAddons: Arrow,
|
|
23
|
+
_b)), block: true, size: size, focused: focused, disabled: disabled, filled: filled, labelView: labelView, rightAddons: Arrow, dataTestId: getDataTestId(dataTestId, 'form-control') }, restProps, innerProps),
|
|
23
24
|
React.createElement("div", { className: styles.contentWrapper },
|
|
24
25
|
showPlaceholder && React.createElement("span", { className: styles.placeholder }, placeholder),
|
|
25
26
|
filled && React.createElement("div", { className: styles.value }, value)))));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 1oxms */
|
|
2
2
|
:root {
|
|
3
3
|
} /* deprecated */ :root {
|
|
4
4
|
--color-light-border-link: #0072ef;
|
|
@@ -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_1ruvq {
|
|
22
22
|
width: 100%;
|
|
23
23
|
outline: none;
|
|
24
|
-
} .input-
|
|
24
|
+
} .input-autocomplete__field_1ruvq:not(.input-autocomplete__disabled_1ruvq) {
|
|
25
25
|
cursor: pointer;
|
|
26
|
-
} .input-
|
|
26
|
+
} .input-autocomplete__disabled_1ruvq {
|
|
27
27
|
cursor: var(--disabled-cursor);
|
|
28
|
-
} .input-
|
|
28
|
+
} .input-autocomplete__placeholder_1ruvq {
|
|
29
29
|
color: var(--color-light-text-secondary);
|
|
30
|
-
} .input-
|
|
30
|
+
} .input-autocomplete__contentWrapper_1ruvq {
|
|
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_1ruvq {
|
|
40
40
|
overflow: hidden;
|
|
41
41
|
text-overflow: ellipsis;
|
|
42
42
|
text-align: left;
|
|
43
|
-
} .input-
|
|
43
|
+
} .input-autocomplete__focusVisible_1ruvq {
|
|
44
44
|
outline: 2px solid var(--focus-color);
|
|
45
45
|
outline-offset: 2px;
|
|
46
46
|
}
|
package/esm/hook-8abfea97.d.ts
CHANGED
|
@@ -82,7 +82,7 @@ declare function useSelectWithApply({ options, selected, onChange, OptionsList,
|
|
|
82
82
|
searchProps: {
|
|
83
83
|
value: string;
|
|
84
84
|
onChange: import("react").Dispatch<import("react").SetStateAction<string>>;
|
|
85
|
-
componentProps?: import("
|
|
85
|
+
componentProps?: import("@alfalab/core-components-input").InputProps | undefined;
|
|
86
86
|
accessor?: ((option: OptionShape) => string) | undefined;
|
|
87
87
|
} | undefined;
|
|
88
88
|
};
|
package/esm/index-c76d6398.d.ts
CHANGED
|
@@ -1,2 +1,185 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
/* eslint-disable complexity */
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { ReactNode, ButtonHTMLAttributes, ElementType, AnchorHTMLAttributes, ReactElement } from "react";
|
|
5
|
+
import { ButtonProps } from "@alfalab/core-components-button";
|
|
6
|
+
interface CloserProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
7
|
+
/**
|
|
8
|
+
* Вид компонента
|
|
9
|
+
*/
|
|
10
|
+
view: "desktop" | "mobile";
|
|
11
|
+
/**
|
|
12
|
+
* Дополнительный класс
|
|
13
|
+
*/
|
|
14
|
+
className?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Позиция крестика
|
|
17
|
+
*/
|
|
18
|
+
align?: "left" | "right";
|
|
19
|
+
/**
|
|
20
|
+
* Фиксирует крестик
|
|
21
|
+
*/
|
|
22
|
+
sticky?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Иконка
|
|
25
|
+
*/
|
|
26
|
+
icon?: ElementType;
|
|
27
|
+
/**
|
|
28
|
+
* Идентификатор для систем автоматизированного тестирования
|
|
29
|
+
*/
|
|
30
|
+
dataTestId?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Коллбэк закрытия.
|
|
33
|
+
*/
|
|
34
|
+
onClose?: (event: React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>, reason?: "backdropClick" | "escapeKeyDown" | "closerClick") => void;
|
|
35
|
+
}
|
|
36
|
+
type NavigationBarProps = {
|
|
37
|
+
/**
|
|
38
|
+
* Контент шапки
|
|
39
|
+
*/
|
|
40
|
+
children?: ReactNode;
|
|
41
|
+
/**
|
|
42
|
+
* Заголовок шапки
|
|
43
|
+
*/
|
|
44
|
+
title?: string;
|
|
45
|
+
/**
|
|
46
|
+
* Подзаголовок (доступен только в мобильной версии)
|
|
47
|
+
*/
|
|
48
|
+
subtitle?: ReactNode;
|
|
49
|
+
/**
|
|
50
|
+
* Размер заголовка (compact доступен только в мобильной версии)
|
|
51
|
+
*/
|
|
52
|
+
titleSize?: "default" | "compact";
|
|
53
|
+
/**
|
|
54
|
+
* Доп. класс для аддонов
|
|
55
|
+
*/
|
|
56
|
+
addonClassName?: string;
|
|
57
|
+
/**
|
|
58
|
+
* Слот слева
|
|
59
|
+
*/
|
|
60
|
+
leftAddons?: ReactNode;
|
|
61
|
+
/**
|
|
62
|
+
* Слот справа
|
|
63
|
+
*/
|
|
64
|
+
rightAddons?: ReactNode;
|
|
65
|
+
/**
|
|
66
|
+
* Дополнительный класс для closer
|
|
67
|
+
*/
|
|
68
|
+
closerClassName?: string;
|
|
69
|
+
/**
|
|
70
|
+
* Слот снизу
|
|
71
|
+
*/
|
|
72
|
+
bottomAddons?: ReactNode;
|
|
73
|
+
/**
|
|
74
|
+
* Наличие компонента крестика
|
|
75
|
+
*/
|
|
76
|
+
hasCloser?: boolean;
|
|
77
|
+
/**
|
|
78
|
+
* Наличие кнопки "Назад"
|
|
79
|
+
*/
|
|
80
|
+
hasBackButton?: boolean;
|
|
81
|
+
/**
|
|
82
|
+
* Дополнительный класс для правого аддона
|
|
83
|
+
*/
|
|
84
|
+
backButtonClassName?: string;
|
|
85
|
+
/**
|
|
86
|
+
* Дополнительный класс
|
|
87
|
+
*/
|
|
88
|
+
className?: string;
|
|
89
|
+
/**
|
|
90
|
+
* Дополнительный класс для контента
|
|
91
|
+
*/
|
|
92
|
+
contentClassName?: string;
|
|
93
|
+
/**
|
|
94
|
+
* Дополнительный класс для нижнего аддона
|
|
95
|
+
*/
|
|
96
|
+
bottomAddonsClassName?: string;
|
|
97
|
+
/**
|
|
98
|
+
* Выравнивание заголовка
|
|
99
|
+
*/
|
|
100
|
+
align?: "left" | "center";
|
|
101
|
+
/**
|
|
102
|
+
* Обрезать ли заголовок
|
|
103
|
+
*/
|
|
104
|
+
trim?: boolean;
|
|
105
|
+
/**
|
|
106
|
+
* Фиксирует шапку
|
|
107
|
+
*/
|
|
108
|
+
sticky?: boolean;
|
|
109
|
+
/**
|
|
110
|
+
* Идентификатор для систем автоматизированного тестирования
|
|
111
|
+
*/
|
|
112
|
+
dataTestId?: string;
|
|
113
|
+
/**
|
|
114
|
+
* Фоновое изображение
|
|
115
|
+
*/
|
|
116
|
+
imageUrl?: string;
|
|
117
|
+
/**
|
|
118
|
+
* Иконка closer.
|
|
119
|
+
*/
|
|
120
|
+
closerIcon?: React.ElementType;
|
|
121
|
+
/**
|
|
122
|
+
* Обработчик закрытия
|
|
123
|
+
*/
|
|
124
|
+
onClose?: CloserProps["onClose"];
|
|
125
|
+
/**
|
|
126
|
+
* обработчик клика по кнопке "назад"
|
|
127
|
+
*/
|
|
128
|
+
onBack?: () => void;
|
|
129
|
+
/**
|
|
130
|
+
* Вид шапки - мобильный или десктоп
|
|
131
|
+
*/
|
|
132
|
+
view: "desktop" | "mobile";
|
|
133
|
+
/**
|
|
134
|
+
* Ссылка на родительскую ноду overflow: auto
|
|
135
|
+
*/
|
|
136
|
+
scrollableParentRef?: React.RefObject<HTMLDivElement>;
|
|
137
|
+
};
|
|
138
|
+
declare const NavigationBar: React.ForwardRefExoticComponent<NavigationBarProps & React.RefAttributes<HTMLDivElement>>;
|
|
139
|
+
type IconButtonProps = {
|
|
140
|
+
/**
|
|
141
|
+
* Компонент иконки
|
|
142
|
+
*/
|
|
143
|
+
icon: ElementType<{
|
|
144
|
+
className?: string;
|
|
145
|
+
}> | ReactElement;
|
|
146
|
+
/**
|
|
147
|
+
* Тип кнопки
|
|
148
|
+
*/
|
|
149
|
+
view?: "primary" | "secondary" | "transparent" | "tertiary" | "negative";
|
|
150
|
+
/**
|
|
151
|
+
* Размер компонента
|
|
152
|
+
*/
|
|
153
|
+
size?: "xxs" | "xs" | "s";
|
|
154
|
+
/**
|
|
155
|
+
* Дополнительный класс
|
|
156
|
+
*/
|
|
157
|
+
className?: string;
|
|
158
|
+
/**
|
|
159
|
+
* Выравнивание иконки
|
|
160
|
+
* @default 'center'
|
|
161
|
+
*/
|
|
162
|
+
alignIcon?: "left" | "center" | "right";
|
|
163
|
+
/**
|
|
164
|
+
* Идентификатор для систем автоматизированного тестирования
|
|
165
|
+
*/
|
|
166
|
+
dataTestId?: string;
|
|
167
|
+
/**
|
|
168
|
+
* Набор цветов для компонента
|
|
169
|
+
*/
|
|
170
|
+
colors?: "default" | "inverted";
|
|
171
|
+
} & Omit<ButtonHTMLAttributes<HTMLButtonElement>, "size"> & Pick<ButtonProps, "Component" | "href" | "loading" | "breakpoint"> & Pick<AnchorHTMLAttributes<HTMLAnchorElement>, "target" | "download">;
|
|
172
|
+
declare const IconButton: React.ForwardRefExoticComponent<{
|
|
173
|
+
icon: ElementType<{
|
|
174
|
+
className?: string;
|
|
175
|
+
}> | ReactElement;
|
|
176
|
+
view?: "primary" | "secondary" | "tertiary" | "negative" | "transparent" | undefined;
|
|
177
|
+
size?: "s" | "xs" | "xxs" | undefined;
|
|
178
|
+
className?: string | undefined;
|
|
179
|
+
alignIcon?: "center" | "right" | "left" | undefined;
|
|
180
|
+
dataTestId?: string | undefined;
|
|
181
|
+
colors?: "default" | "inverted" | undefined;
|
|
182
|
+
} & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "size"> & Pick<ButtonProps, "href" | "Component" | "loading" | "breakpoint"> & Pick<React.AnchorHTMLAttributes<HTMLAnchorElement>, "download" | "target"> & React.RefAttributes<HTMLButtonElement>>;
|
|
183
|
+
export { NavigationBar, IconButtonProps, IconButton };
|
|
184
|
+
export * from "./Component-63dec22f";
|
|
185
|
+
export type { NavigationBarProps };
|
package/esm/index-ebda875c.d.ts
CHANGED
|
@@ -87,6 +87,14 @@ type BaseFormControlProps = HTMLAttributes<HTMLDivElement> & {
|
|
|
87
87
|
* Дополнительный класс для аддонов
|
|
88
88
|
*/
|
|
89
89
|
addonsClassName?: string;
|
|
90
|
+
/**
|
|
91
|
+
* Свойства для обертки левых аддонов
|
|
92
|
+
*/
|
|
93
|
+
leftAddonsProps?: HTMLAttributes<HTMLDivElement>;
|
|
94
|
+
/**
|
|
95
|
+
* Свойства для обертки правых аддонов
|
|
96
|
+
*/
|
|
97
|
+
rightAddonsProps?: HTMLAttributes<HTMLDivElement>;
|
|
90
98
|
/**
|
|
91
99
|
* Идентификатор для систем автоматизированного тестирования
|
|
92
100
|
*/
|
|
@@ -126,6 +134,8 @@ declare const BaseFormControl: React.ForwardRefExoticComponent<React.HTMLAttribu
|
|
|
126
134
|
inputWrapperClassName?: string | undefined;
|
|
127
135
|
labelClassName?: string | undefined;
|
|
128
136
|
addonsClassName?: string | undefined;
|
|
137
|
+
leftAddonsProps?: React.HTMLAttributes<HTMLDivElement> | undefined;
|
|
138
|
+
rightAddonsProps?: React.HTMLAttributes<HTMLDivElement> | undefined;
|
|
129
139
|
dataTestId?: string | undefined;
|
|
130
140
|
children?: ReactNode;
|
|
131
141
|
styles: {
|
package/esm/index-f12ee135.d.ts
CHANGED
|
@@ -1,3 +1,52 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { FC, ReactNode, RefObject } from "react";
|
|
4
|
+
import { BottomSheetProps } from "./types-72dda473";
|
|
5
|
+
import { NavigationBarProps } from "./index-c76d6398";
|
|
6
|
+
import { SwipeableHandlers } from "react-swipeable";
|
|
7
|
+
import { BackdropProps } from "./index-ebda875c";
|
|
8
|
+
declare const BottomSheet: React.ForwardRefExoticComponent<BottomSheetProps & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
declare const TIMEOUT = 500;
|
|
10
|
+
declare const SWIPE_VELOCITY = 0.4;
|
|
11
|
+
declare const MARKER_HEIGHT = 24;
|
|
12
|
+
declare const CLOSE_OFFSET = 0.2;
|
|
13
|
+
declare const SCROLL_OFFSET = 1;
|
|
14
|
+
declare const HEADER_OFFSET = 24;
|
|
15
|
+
declare const convertPercentToNumber: (value: string | number, fullHeight: number, headerOffset?: number) => number;
|
|
16
|
+
type FooterProps = {
|
|
17
|
+
/**
|
|
18
|
+
* Контент футера
|
|
19
|
+
*/
|
|
20
|
+
children?: ReactNode;
|
|
21
|
+
/**
|
|
22
|
+
* Фиксирует футер
|
|
23
|
+
*/
|
|
24
|
+
sticky?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Дополнительный класс
|
|
27
|
+
*/
|
|
28
|
+
className?: string;
|
|
29
|
+
};
|
|
30
|
+
declare const Footer: FC<FooterProps>;
|
|
31
|
+
type HeaderProps = Omit<NavigationBarProps, "view" | "size"> & {
|
|
32
|
+
headerRef: RefObject<HTMLDivElement>;
|
|
33
|
+
headerOffset: number;
|
|
34
|
+
};
|
|
35
|
+
declare const Header: FC<HeaderProps>;
|
|
36
|
+
type SwipeableBackdropProps = BackdropProps & {
|
|
37
|
+
/**
|
|
38
|
+
* Прозрачность бэкдропа
|
|
39
|
+
*/
|
|
40
|
+
opacity?: number;
|
|
41
|
+
/**
|
|
42
|
+
* Обработчики свайпа
|
|
43
|
+
*/
|
|
44
|
+
handlers?: SwipeableHandlers;
|
|
45
|
+
/**
|
|
46
|
+
* Время анимации opacity
|
|
47
|
+
*/
|
|
48
|
+
opacityTimeout?: number;
|
|
49
|
+
};
|
|
50
|
+
declare const SwipeableBackdrop: FC<SwipeableBackdropProps>;
|
|
51
|
+
export { BottomSheet, TIMEOUT, SWIPE_VELOCITY, MARKER_HEIGHT, CLOSE_OFFSET, SCROLL_OFFSET, HEADER_OFFSET, convertPercentToNumber, FooterProps, Footer, HeaderProps, Header, SwipeableBackdropProps, SwipeableBackdrop };
|
|
52
|
+
export type { BottomSheetProps, BottomSheetTitleAlign } from "./types-72dda473";
|
package/esm/index.js
CHANGED
|
@@ -15,4 +15,5 @@ import '@alfalab/core-components-input/esm';
|
|
|
15
15
|
import '@alfalab/core-components-select/esm/mobile';
|
|
16
16
|
import './autocomplete-mobile-field/Component.js';
|
|
17
17
|
import '@alfalab/core-components-form-control/esm/mobile';
|
|
18
|
-
import '
|
|
18
|
+
import '@alfalab/core-components-shared/esm';
|
|
19
|
+
import './mobile.module-db1787d4.js';
|
package/esm/mobile.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 25x8p */
|
|
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 */
|
|
@@ -16,11 +16,11 @@
|
|
|
16
16
|
--gap-m: 16px;
|
|
17
17
|
} :root {
|
|
18
18
|
} :root {
|
|
19
|
-
} .input-
|
|
19
|
+
} .input-autocomplete__bottomAddonInput_mdypo {
|
|
20
20
|
padding: 0 var(--gap-xs) var(--gap-xs);
|
|
21
21
|
box-sizing: border-box;
|
|
22
|
-
} .input-
|
|
22
|
+
} .input-autocomplete__footer_mdypo {
|
|
23
23
|
display: flex
|
|
24
|
-
} .input-
|
|
24
|
+
} .input-autocomplete__footer_mdypo > button + button {
|
|
25
25
|
margin-left: var(--gap-m);
|
|
26
26
|
}
|
package/esm/mobile.js
CHANGED
|
@@ -10,5 +10,6 @@ import '@alfalab/core-components-input/esm';
|
|
|
10
10
|
import '@alfalab/core-components-select/esm/mobile';
|
|
11
11
|
import './autocomplete-mobile-field/Component.js';
|
|
12
12
|
import '@alfalab/core-components-form-control/esm/mobile';
|
|
13
|
+
import '@alfalab/core-components-shared/esm';
|
|
13
14
|
import '@alfalab/hooks';
|
|
14
|
-
import './mobile.module-
|
|
15
|
+
import './mobile.module-db1787d4.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var styles = {"bottomAddonInput":"input-
|
|
1
|
+
var styles = {"bottomAddonInput":"input-autocomplete__bottomAddonInput_mdypo","footer":"input-autocomplete__footer_mdypo"};
|
|
2
2
|
require('./mobile.css')
|
|
3
3
|
|
|
4
4
|
export { styles as s };
|
package/hook-8abfea97.d.ts
CHANGED
|
@@ -82,7 +82,7 @@ declare function useSelectWithApply({ options, selected, onChange, OptionsList,
|
|
|
82
82
|
searchProps: {
|
|
83
83
|
value: string;
|
|
84
84
|
onChange: import("react").Dispatch<import("react").SetStateAction<string>>;
|
|
85
|
-
componentProps?: import("
|
|
85
|
+
componentProps?: import("@alfalab/core-components-input").InputProps | undefined;
|
|
86
86
|
accessor?: ((option: OptionShape) => string) | undefined;
|
|
87
87
|
} | undefined;
|
|
88
88
|
};
|