@alfalab/core-components-input-autocomplete 10.3.0 → 11.0.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 +3 -70
- package/Component.desktop.js +2 -1
- package/Component.mobile.d.ts +5 -95
- package/Component.mobile.js +42 -45
- package/Component.modal.mobile.d.ts +5 -88
- package/Component.modal.mobile.js +9 -62
- package/Component.responsive.d.ts +3 -46
- package/Component.responsive.js +9 -12
- package/autocomplete-field/Component.d.ts +2 -2
- package/autocomplete-field/Component.js +1 -1
- package/autocomplete-field/index.css +2 -2
- package/autocomplete-mobile-field/Component.js +6 -3
- package/autocomplete-mobile-field/index.css +10 -10
- package/cssm/Component.desktop.d.ts +3 -70
- package/cssm/Component.desktop.js +2 -1
- package/cssm/Component.mobile.d.ts +5 -95
- package/cssm/Component.mobile.js +39 -44
- package/cssm/Component.modal.mobile.d.ts +5 -88
- package/cssm/Component.modal.mobile.js +10 -63
- package/cssm/Component.responsive.d.ts +3 -46
- package/cssm/Component.responsive.js +9 -11
- package/cssm/autocomplete-field/Component.d.ts +2 -2
- package/cssm/autocomplete-mobile-field/Component.js +5 -2
- package/cssm/autocomplete-mobile-field/index.module.css +2 -2
- package/cssm/desktop/index.d.ts +2 -2
- package/cssm/desktop/index.js +1 -0
- package/cssm/index.d.ts +2 -2
- package/cssm/index.js +5 -4
- package/cssm/mobile/index.d.ts +3 -3
- package/cssm/mobile/index.js +2 -2
- package/cssm/mobile.module.css +3 -10
- package/cssm/types.d.ts +58 -0
- package/cssm/types.js +2 -0
- package/cssm/utils.d.ts +2 -0
- package/cssm/utils.js +9 -0
- package/desktop/index.d.ts +2 -2
- package/desktop/index.js +1 -0
- package/esm/Component.desktop.d.ts +3 -70
- package/esm/Component.desktop.js +2 -1
- package/esm/Component.mobile.d.ts +5 -95
- package/esm/Component.mobile.js +43 -46
- package/esm/Component.modal.mobile.d.ts +5 -88
- package/esm/Component.modal.mobile.js +11 -61
- package/esm/Component.responsive.d.ts +3 -46
- package/esm/Component.responsive.js +9 -12
- package/esm/autocomplete-field/Component.d.ts +2 -2
- package/esm/autocomplete-field/Component.js +1 -1
- package/esm/autocomplete-field/index.css +2 -2
- package/esm/autocomplete-mobile-field/Component.js +6 -3
- package/esm/autocomplete-mobile-field/index.css +10 -10
- package/esm/desktop/index.d.ts +2 -2
- package/esm/desktop/index.js +1 -0
- package/esm/index.d.ts +2 -2
- package/esm/index.js +5 -5
- package/esm/mobile/index.d.ts +3 -3
- package/esm/mobile/index.js +2 -3
- package/esm/mobile.css +4 -11
- package/esm/types.d.ts +58 -0
- package/esm/types.js +1 -0
- package/esm/utils.d.ts +2 -0
- package/esm/utils.js +5 -0
- package/index.d.ts +2 -2
- package/index.js +5 -5
- package/mobile/index.d.ts +3 -3
- package/mobile/index.js +2 -3
- package/mobile.css +4 -11
- package/modern/Component.desktop.d.ts +3 -70
- package/modern/Component.desktop.js +2 -1
- package/modern/Component.mobile.d.ts +5 -95
- package/modern/Component.mobile.js +54 -56
- package/modern/Component.modal.mobile.d.ts +5 -88
- package/modern/Component.modal.mobile.js +10 -68
- package/modern/Component.responsive.d.ts +3 -46
- package/modern/Component.responsive.js +8 -11
- 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 +5 -2
- package/modern/autocomplete-mobile-field/index.css +10 -10
- package/modern/desktop/index.d.ts +2 -2
- package/modern/desktop/index.js +1 -0
- package/modern/index.d.ts +2 -2
- package/modern/index.js +5 -5
- package/modern/mobile/index.d.ts +3 -3
- package/modern/mobile/index.js +2 -3
- package/modern/mobile.css +4 -11
- package/modern/types.d.ts +58 -0
- package/modern/types.js +1 -0
- package/modern/utils.d.ts +2 -0
- package/modern/utils.js +5 -0
- package/package.json +7 -6
- package/src/Component.desktop.tsx +6 -44
- package/src/Component.mobile.tsx +90 -188
- package/src/Component.modal.mobile.tsx +5 -223
- package/src/Component.responsive.tsx +10 -30
- package/src/autocomplete-field/Component.tsx +2 -2
- package/src/autocomplete-mobile-field/Component.tsx +5 -1
- package/src/desktop/index.ts +2 -1
- package/src/index.ts +2 -4
- package/src/mobile/index.ts +4 -5
- package/src/mobile.module.css +2 -11
- package/src/types.ts +77 -0
- package/src/utils.ts +3 -0
- package/types.d.ts +58 -0
- package/types.js +2 -0
- package/utils.d.ts +2 -0
- package/utils.js +9 -0
- package/esm/mobile.module-846d8b52.js +0 -4
- package/mobile.module-7c0f2a72.js +0 -6
- package/modern/mobile.module-7bf90bfc.js +0 -4
package/src/mobile/index.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
export { InputAutocompleteMobile
|
|
2
|
-
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
} from '../Component.modal.mobile';
|
|
1
|
+
export { InputAutocompleteMobile } from '../Component.mobile';
|
|
2
|
+
export { InputAutocompleteModalMobile } from '../Component.modal.mobile';
|
|
3
|
+
|
|
4
|
+
export { InputAutocompleteMobileProps } from '../types';
|
package/src/mobile.module.css
CHANGED
|
@@ -1,14 +1,5 @@
|
|
|
1
1
|
@import '@alfalab/core-components-themes/src/default.css';
|
|
2
2
|
|
|
3
|
-
.
|
|
4
|
-
|
|
5
|
-
box-sizing: border-box;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
.footer {
|
|
9
|
-
display: flex;
|
|
10
|
-
|
|
11
|
-
& > button + button {
|
|
12
|
-
margin-left: var(--gap-m);
|
|
13
|
-
}
|
|
3
|
+
.input {
|
|
4
|
+
width: auto;
|
|
14
5
|
}
|
package/src/types.ts
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { ChangeEvent, FC, RefAttributes } from 'react';
|
|
2
|
+
|
|
3
|
+
import type { InputProps } from '@alfalab/core-components-input';
|
|
4
|
+
import type {
|
|
5
|
+
BaseSelectProps,
|
|
6
|
+
BottomSheetSelectMobileProps,
|
|
7
|
+
} from '@alfalab/core-components-select/shared';
|
|
8
|
+
|
|
9
|
+
export interface InputAutocompleteCommonProps
|
|
10
|
+
extends Omit<
|
|
11
|
+
BaseSelectProps,
|
|
12
|
+
'autocomplete' | 'Field' | 'nativeSelect' | 'searchProps' | 'showSearch' | 'Search'
|
|
13
|
+
> {
|
|
14
|
+
/**
|
|
15
|
+
* Компонент ввода значения
|
|
16
|
+
*/
|
|
17
|
+
Input?: FC<InputProps & RefAttributes<HTMLInputElement>>;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Пропсы, которые будут прокинуты в инпут
|
|
21
|
+
*/
|
|
22
|
+
inputProps?: InputProps & Record<string, unknown>;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Значение поля ввода
|
|
26
|
+
*/
|
|
27
|
+
value?: string;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Поле доступно только для чтения
|
|
31
|
+
*/
|
|
32
|
+
readOnly?: InputProps['readOnly'];
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Отображение иконки успеха
|
|
36
|
+
*/
|
|
37
|
+
success?: boolean;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Обработчик ввода
|
|
41
|
+
*/
|
|
42
|
+
onInput?: (event: ChangeEvent<HTMLInputElement> | null, payload: { value: string }) => void;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
type MobileProps = {
|
|
46
|
+
/**
|
|
47
|
+
* Открывать в bottom-sheet
|
|
48
|
+
*/
|
|
49
|
+
isBottomSheet?: boolean;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Пропсы анимации контента (CSSTransition)
|
|
53
|
+
*/
|
|
54
|
+
transitionProps?: NonNullable<
|
|
55
|
+
BottomSheetSelectMobileProps['bottomSheetProps']
|
|
56
|
+
>['transitionProps'];
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export type InputAutocompleteMobileProps = InputAutocompleteCommonProps & MobileProps;
|
|
60
|
+
|
|
61
|
+
export interface InputAutocompleteProps extends InputAutocompleteCommonProps {
|
|
62
|
+
/**
|
|
63
|
+
* Пропсы для мобильного компонента
|
|
64
|
+
*/
|
|
65
|
+
mobileProps?: MobileProps;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Контрольная точка, с нее начинается desktop версия
|
|
69
|
+
* @default 1024
|
|
70
|
+
*/
|
|
71
|
+
breakpoint?: number;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Значение по-умолчанию для хука useMatchMedia
|
|
75
|
+
*/
|
|
76
|
+
defaultMatchMediaValue?: boolean | (() => boolean);
|
|
77
|
+
}
|
package/src/utils.ts
ADDED
package/types.d.ts
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { ChangeEvent, FC, RefAttributes } from 'react';
|
|
2
|
+
import { InputProps } from "@alfalab/core-components-input";
|
|
3
|
+
import { BaseSelectProps, BottomSheetSelectMobileProps } from "@alfalab/core-components-select/shared";
|
|
4
|
+
interface InputAutocompleteCommonProps extends Omit<BaseSelectProps, 'autocomplete' | 'Field' | 'nativeSelect' | 'searchProps' | 'showSearch' | 'Search'> {
|
|
5
|
+
/**
|
|
6
|
+
* Компонент ввода значения
|
|
7
|
+
*/
|
|
8
|
+
Input?: FC<InputProps & RefAttributes<HTMLInputElement>>;
|
|
9
|
+
/**
|
|
10
|
+
* Пропсы, которые будут прокинуты в инпут
|
|
11
|
+
*/
|
|
12
|
+
inputProps?: InputProps & Record<string, unknown>;
|
|
13
|
+
/**
|
|
14
|
+
* Значение поля ввода
|
|
15
|
+
*/
|
|
16
|
+
value?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Поле доступно только для чтения
|
|
19
|
+
*/
|
|
20
|
+
readOnly?: InputProps['readOnly'];
|
|
21
|
+
/**
|
|
22
|
+
* Отображение иконки успеха
|
|
23
|
+
*/
|
|
24
|
+
success?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Обработчик ввода
|
|
27
|
+
*/
|
|
28
|
+
onInput?: (event: ChangeEvent<HTMLInputElement> | null, payload: {
|
|
29
|
+
value: string;
|
|
30
|
+
}) => void;
|
|
31
|
+
}
|
|
32
|
+
type MobileProps = {
|
|
33
|
+
/**
|
|
34
|
+
* Открывать в bottom-sheet
|
|
35
|
+
*/
|
|
36
|
+
isBottomSheet?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Пропсы анимации контента (CSSTransition)
|
|
39
|
+
*/
|
|
40
|
+
transitionProps?: NonNullable<BottomSheetSelectMobileProps['bottomSheetProps']>['transitionProps'];
|
|
41
|
+
};
|
|
42
|
+
type InputAutocompleteMobileProps = InputAutocompleteCommonProps & MobileProps;
|
|
43
|
+
interface InputAutocompleteProps extends InputAutocompleteCommonProps {
|
|
44
|
+
/**
|
|
45
|
+
* Пропсы для мобильного компонента
|
|
46
|
+
*/
|
|
47
|
+
mobileProps?: MobileProps;
|
|
48
|
+
/**
|
|
49
|
+
* Контрольная точка, с нее начинается desktop версия
|
|
50
|
+
* @default 1024
|
|
51
|
+
*/
|
|
52
|
+
breakpoint?: number;
|
|
53
|
+
/**
|
|
54
|
+
* Значение по-умолчанию для хука useMatchMedia
|
|
55
|
+
*/
|
|
56
|
+
defaultMatchMediaValue?: boolean | (() => boolean);
|
|
57
|
+
}
|
|
58
|
+
export { InputAutocompleteCommonProps, InputAutocompleteMobileProps, InputAutocompleteProps };
|
package/types.js
ADDED
package/utils.d.ts
ADDED
package/utils.js
ADDED