@alfalab/core-components-input-autocomplete 10.1.2 → 10.1.4
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.mobile.js +1 -1
- package/Component.modal.mobile.js +1 -1
- package/Component.responsive.js +1 -1
- 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/component-1a4fbd11.d.ts +1 -1
- package/cssm/component-1a4fbd11.d.ts +1 -1
- package/cssm/index-f12ee135.d.ts +1 -1
- package/cssm/{types-b0ff398d.d.ts → types-e40becc7.d.ts} +6 -2
- package/esm/Component.mobile.js +1 -1
- package/esm/Component.modal.mobile.js +1 -1
- package/esm/Component.responsive.js +1 -1
- 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/component-1a4fbd11.d.ts +1 -1
- package/esm/index-f12ee135.d.ts +1 -1
- package/esm/index.js +1 -1
- package/esm/mobile.css +4 -4
- package/esm/mobile.js +1 -1
- package/esm/{mobile.module-7ccedebb.js → mobile.module-7c125313.js} +1 -1
- package/{modern/types-b0ff398d.d.ts → esm/types-e40becc7.d.ts} +6 -2
- package/index-f12ee135.d.ts +1 -1
- package/index.js +1 -1
- package/mobile.css +4 -4
- package/mobile.js +1 -1
- package/{mobile.module-f3a9e8d4.js → mobile.module-f4b02d6c.js} +1 -1
- package/modern/Component-63dec22f.d.ts +184 -0
- package/modern/Component-dd8ca091.d.ts +70 -3
- package/modern/Component-ebda875c.d.ts +9 -98
- package/modern/Component.mobile-ebda875c.d.ts +6 -0
- package/modern/Component.mobile.d.ts +1 -1
- package/modern/Component.mobile.js +1 -1
- package/modern/{mobile-45dc17c6.d.ts → Component.modal.mobile-dd8ca091.d.ts} +26 -13
- package/modern/Component.modal.mobile.d.ts +2 -2
- package/modern/Component.modal.mobile.js +1 -1
- package/modern/Component.responsive.d.ts +1 -1
- package/modern/Component.responsive.js +1 -1
- 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/component-1a4fbd11.d.ts +1 -1
- package/modern/desktop-63dec22f.d.ts +6 -2
- package/modern/hook-8abfea97.d.ts +4 -4
- package/modern/index-bdb4c6b9.d.ts +2 -180
- package/modern/index-ebda875c.d.ts +107 -190
- package/modern/index-f12ee135.d.ts +1 -1
- package/modern/index.js +1 -1
- package/modern/mobile-96988a65.d.ts +2 -5
- package/modern/mobile-ade26e99.d.ts +5 -0
- package/modern/mobile.css +4 -4
- package/modern/mobile.js +1 -1
- package/modern/{mobile.module-f3a5d2f8.js → mobile.module-b86c11f5.js} +1 -1
- package/modern/shared-4cd3936b.d.ts +59 -2
- package/{esm/types-b0ff398d.d.ts → modern/types-e40becc7.d.ts} +6 -2
- package/modern/utils-1574ad8b.d.ts +29 -0
- package/package.json +4 -4
- package/{types-b0ff398d.d.ts → types-e40becc7.d.ts} +6 -2
- package/modern/Component-96988a65.d.ts +0 -9
- package/modern/Component-aed0af6e.d.ts +0 -11
- package/modern/hook-ebda875c.d.ts +0 -48
- /package/modern/{useSkeleton-1b036d4b.d.ts → useSkeleton-ebda875c.d.ts} +0 -0
|
@@ -1,219 +1,136 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
/// <reference types="react-transition-group" />
|
|
3
3
|
import React from "react";
|
|
4
|
-
import { HTMLAttributes } from "react";
|
|
5
|
-
type
|
|
4
|
+
import { HTMLAttributes, ReactNode } from "react";
|
|
5
|
+
type StyleColors = {
|
|
6
|
+
default: {
|
|
7
|
+
[key: string]: string;
|
|
8
|
+
};
|
|
9
|
+
inverted: {
|
|
10
|
+
[key: string]: string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
type BaseFormControlProps = HTMLAttributes<HTMLDivElement> & {
|
|
6
14
|
/**
|
|
7
|
-
*
|
|
15
|
+
* Растягивает компонент на ширину контейнера
|
|
8
16
|
*/
|
|
9
|
-
|
|
17
|
+
block?: boolean;
|
|
10
18
|
/**
|
|
11
|
-
*
|
|
19
|
+
* Размер компонента
|
|
12
20
|
*/
|
|
13
|
-
|
|
21
|
+
size?: "s" | "m" | "l" | "xl";
|
|
14
22
|
/**
|
|
15
23
|
* Набор цветов для компонента
|
|
16
24
|
*/
|
|
17
25
|
colors?: "default" | "inverted";
|
|
18
26
|
/**
|
|
19
|
-
*
|
|
27
|
+
* Заблокированное состояние
|
|
20
28
|
*/
|
|
21
|
-
|
|
29
|
+
disabled?: boolean;
|
|
22
30
|
/**
|
|
23
|
-
*
|
|
31
|
+
* Cостояние только для чтения
|
|
24
32
|
*/
|
|
25
|
-
|
|
33
|
+
readOnly?: boolean;
|
|
26
34
|
/**
|
|
27
|
-
*
|
|
35
|
+
* Заполненное состояние
|
|
28
36
|
*/
|
|
29
|
-
|
|
37
|
+
filled?: boolean;
|
|
30
38
|
/**
|
|
31
|
-
*
|
|
39
|
+
* Выбранное (фокус) состояние
|
|
32
40
|
*/
|
|
33
|
-
|
|
41
|
+
focused?: boolean;
|
|
34
42
|
/**
|
|
35
|
-
*
|
|
43
|
+
* Отображение ошибки
|
|
36
44
|
*/
|
|
37
|
-
|
|
45
|
+
error?: ReactNode | boolean;
|
|
38
46
|
/**
|
|
39
|
-
*
|
|
40
|
-
* Если true, то будет выполняться прокрутка к месту клика.
|
|
47
|
+
* Текст подсказки
|
|
41
48
|
*/
|
|
42
|
-
|
|
49
|
+
hint?: ReactNode;
|
|
43
50
|
/**
|
|
44
|
-
*
|
|
51
|
+
* Лейбл компонента
|
|
45
52
|
*/
|
|
46
|
-
|
|
53
|
+
label?: ReactNode;
|
|
47
54
|
/**
|
|
48
|
-
*
|
|
55
|
+
* Вид лейбла внутри / снаружи
|
|
49
56
|
*/
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
static getOffset(el: any): {
|
|
97
|
-
top: any;
|
|
98
|
-
left: any;
|
|
99
|
-
};
|
|
100
|
-
static instances: WeakMap<object, any>;
|
|
101
|
-
constructor(element: any, options: any);
|
|
102
|
-
el: any;
|
|
103
|
-
minScrollbarWidth: number;
|
|
104
|
-
options: any;
|
|
105
|
-
classNames: any;
|
|
106
|
-
axis: {
|
|
107
|
-
x: {
|
|
108
|
-
scrollOffsetAttr: string;
|
|
109
|
-
sizeAttr: string;
|
|
110
|
-
scrollSizeAttr: string;
|
|
111
|
-
offsetSizeAttr: string;
|
|
112
|
-
offsetAttr: string;
|
|
113
|
-
overflowAttr: string;
|
|
114
|
-
dragOffset: number;
|
|
115
|
-
isOverflowing: boolean;
|
|
116
|
-
isVisible: boolean;
|
|
117
|
-
forceVisible: boolean;
|
|
118
|
-
track: {};
|
|
119
|
-
scrollbar: {};
|
|
120
|
-
};
|
|
121
|
-
y: {
|
|
122
|
-
scrollOffsetAttr: string;
|
|
123
|
-
sizeAttr: string;
|
|
124
|
-
scrollSizeAttr: string;
|
|
125
|
-
offsetSizeAttr: string;
|
|
126
|
-
offsetAttr: string;
|
|
127
|
-
overflowAttr: string;
|
|
128
|
-
dragOffset: number;
|
|
129
|
-
isOverflowing: boolean;
|
|
130
|
-
isVisible: boolean;
|
|
131
|
-
forceVisible: boolean;
|
|
132
|
-
track: {};
|
|
133
|
-
scrollbar: {};
|
|
134
|
-
};
|
|
57
|
+
labelView?: "inner" | "outer";
|
|
58
|
+
/**
|
|
59
|
+
* Слот слева
|
|
60
|
+
*/
|
|
61
|
+
leftAddons?: ReactNode;
|
|
62
|
+
/**
|
|
63
|
+
* Слот справа
|
|
64
|
+
*/
|
|
65
|
+
rightAddons?: ReactNode;
|
|
66
|
+
/**
|
|
67
|
+
* Слот под полем
|
|
68
|
+
*/
|
|
69
|
+
bottomAddons?: ReactNode;
|
|
70
|
+
/**
|
|
71
|
+
* Дополнительный класс
|
|
72
|
+
*/
|
|
73
|
+
className?: string;
|
|
74
|
+
/**
|
|
75
|
+
* Дополнительный класс для поля
|
|
76
|
+
*/
|
|
77
|
+
fieldClassName?: string;
|
|
78
|
+
/**
|
|
79
|
+
* Дополнительный класс для поля
|
|
80
|
+
*/
|
|
81
|
+
inputWrapperClassName?: string;
|
|
82
|
+
/**
|
|
83
|
+
* Дополнительный класс для лейбла
|
|
84
|
+
*/
|
|
85
|
+
labelClassName?: string;
|
|
86
|
+
/**
|
|
87
|
+
* Дополнительный класс для аддонов
|
|
88
|
+
*/
|
|
89
|
+
addonsClassName?: string;
|
|
90
|
+
/**
|
|
91
|
+
* Идентификатор для систем автоматизированного тестирования
|
|
92
|
+
*/
|
|
93
|
+
dataTestId?: string;
|
|
94
|
+
/**
|
|
95
|
+
* Компонент поля (инпут, textarea и пр.)
|
|
96
|
+
*/
|
|
97
|
+
children?: ReactNode;
|
|
98
|
+
/**
|
|
99
|
+
* Основные стили компонента.
|
|
100
|
+
*/
|
|
101
|
+
styles: {
|
|
102
|
+
[key: string]: string;
|
|
135
103
|
};
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
scrollX: () => void;
|
|
166
|
-
scrollY: () => void;
|
|
167
|
-
onMouseEnter: () => void;
|
|
168
|
-
mouseX: any;
|
|
169
|
-
mouseY: any;
|
|
170
|
-
onMouseMoveForAxis(axis?: string): void;
|
|
171
|
-
onMouseLeave: () => void;
|
|
172
|
-
onMouseLeaveForAxis(axis?: string): void;
|
|
173
|
-
showScrollbar(axis?: string): void;
|
|
174
|
-
onPointerEvent: (e: any) => void;
|
|
175
|
-
onDragStart(e: any, axis?: string): void;
|
|
176
|
-
draggedAxis: string | undefined;
|
|
177
|
-
drag: (e: any) => void;
|
|
178
|
-
onEndDrag: (e: any) => void;
|
|
179
|
-
preventClick: (e: any) => void;
|
|
180
|
-
onTrackClick(e: any, axis?: string): void;
|
|
181
|
-
getContentElement(): any;
|
|
182
|
-
getScrollElement(): any;
|
|
183
|
-
getScrollbarWidth(): any;
|
|
184
|
-
removeListeners(): void;
|
|
185
|
-
unMount(): void;
|
|
186
|
-
isWithinBounds(bbox: any): boolean;
|
|
187
|
-
findChild(el: any, query: any): any;
|
|
188
|
-
}
|
|
189
|
-
declare function memoize(func: Function, resolver?: Function | undefined): Function;
|
|
190
|
-
declare namespace memoize$0 {
|
|
191
|
-
export { MapCache as Cache };
|
|
192
|
-
}
|
|
193
|
-
declare function MapCache(entries?: any[] | undefined): void;
|
|
194
|
-
declare class MapCache {
|
|
195
|
-
private constructor();
|
|
196
|
-
clear: typeof mapCacheClear;
|
|
197
|
-
delete: typeof mapCacheDelete;
|
|
198
|
-
get: typeof mapCacheGet;
|
|
199
|
-
has: typeof mapCacheHas;
|
|
200
|
-
set: typeof mapCacheSet;
|
|
201
|
-
}
|
|
202
|
-
declare function mapCacheClear(): void;
|
|
203
|
-
declare class mapCacheClear {
|
|
204
|
-
__data__: {
|
|
205
|
-
hash: Hash;
|
|
206
|
-
map: any;
|
|
207
|
-
string: Hash;
|
|
104
|
+
/**
|
|
105
|
+
* Стили компонента для default и inverted режима.
|
|
106
|
+
*/
|
|
107
|
+
colorStyles?: StyleColors;
|
|
108
|
+
};
|
|
109
|
+
declare const BaseFormControl: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
|
|
110
|
+
block?: boolean | undefined;
|
|
111
|
+
size?: "s" | "m" | "l" | "xl" | undefined;
|
|
112
|
+
colors?: "default" | "inverted" | undefined;
|
|
113
|
+
disabled?: boolean | undefined;
|
|
114
|
+
readOnly?: boolean | undefined;
|
|
115
|
+
filled?: boolean | undefined;
|
|
116
|
+
focused?: boolean | undefined;
|
|
117
|
+
error?: ReactNode | boolean;
|
|
118
|
+
hint?: ReactNode;
|
|
119
|
+
label?: ReactNode;
|
|
120
|
+
labelView?: "inner" | "outer" | undefined;
|
|
121
|
+
leftAddons?: ReactNode;
|
|
122
|
+
rightAddons?: ReactNode;
|
|
123
|
+
bottomAddons?: ReactNode;
|
|
124
|
+
className?: string | undefined;
|
|
125
|
+
fieldClassName?: string | undefined;
|
|
126
|
+
inputWrapperClassName?: string | undefined;
|
|
127
|
+
labelClassName?: string | undefined;
|
|
128
|
+
addonsClassName?: string | undefined;
|
|
129
|
+
dataTestId?: string | undefined;
|
|
130
|
+
children?: ReactNode;
|
|
131
|
+
styles: {
|
|
132
|
+
[key: string]: string;
|
|
208
133
|
};
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
declare function mapCacheHas(key: string): boolean;
|
|
213
|
-
declare function mapCacheSet(key: string, value: any): Object;
|
|
214
|
-
declare var canUseDOM: boolean;
|
|
215
|
-
declare function scrollbarWidth(el: any): any;
|
|
216
|
-
declare function getElementWindow(element: any): any;
|
|
217
|
-
declare function getElementDocument(element: any): any;
|
|
218
|
-
declare function getOptions(obj: any): unknown;
|
|
219
|
-
export { memoize as default, ScrollbarProps, Scrollbar, getElementWindow, getElementDocument, getOptions };
|
|
134
|
+
colorStyles?: StyleColors | undefined;
|
|
135
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
136
|
+
export { StyleColors, BaseFormControlProps, BaseFormControl };
|
package/modern/index.js
CHANGED
|
@@ -14,4 +14,4 @@ import '@alfalab/core-components-input/modern';
|
|
|
14
14
|
import '@alfalab/core-components-select/modern/mobile';
|
|
15
15
|
import './autocomplete-mobile-field/Component.js';
|
|
16
16
|
import '@alfalab/core-components-form-control/modern/mobile';
|
|
17
|
-
import './mobile.module-
|
|
17
|
+
import './mobile.module-b86c11f5.js';
|
|
@@ -1,6 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
type FormControlMobileProps = Omit<BaseFormControlProps, "styles" | "colorStyles">;
|
|
5
|
-
declare const FormControlMobile: React.ForwardRefExoticComponent<FormControlMobileProps & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
-
export { FormControlMobileProps, FormControlMobile };
|
|
2
|
+
export * from "./Component.mobile-ebda875c";
|
|
3
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { SelectMobile } from "./Component.mobile-ade26e99";
|
|
2
|
+
export { SelectModalMobile } from "./Component.modal.mobile-dd8ca091";
|
|
3
|
+
export type { SelectMobileProps } from "./Component.mobile-ade26e99";
|
|
4
|
+
export type { SelectModalMobileProps } from "./Component.modal.mobile-dd8ca091";
|
|
5
|
+
export {};
|
package/modern/mobile.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 2a48g */
|
|
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_1fnw7 {
|
|
20
20
|
padding: 0 var(--gap-xs) var(--gap-xs);
|
|
21
21
|
box-sizing: border-box;
|
|
22
|
-
} .input-
|
|
22
|
+
} .input-autocomplete__footer_1fnw7 {
|
|
23
23
|
display: flex
|
|
24
|
-
} .input-
|
|
24
|
+
} .input-autocomplete__footer_1fnw7 > button + button {
|
|
25
25
|
margin-left: var(--gap-m);
|
|
26
26
|
}
|
package/modern/mobile.js
CHANGED
|
@@ -10,4 +10,4 @@ import '@alfalab/core-components-select/modern/mobile';
|
|
|
10
10
|
import './autocomplete-mobile-field/Component.js';
|
|
11
11
|
import '@alfalab/core-components-form-control/modern/mobile';
|
|
12
12
|
import '@alfalab/hooks';
|
|
13
|
-
import './mobile.module-
|
|
13
|
+
import './mobile.module-b86c11f5.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const styles = {"bottomAddonInput":"input-
|
|
1
|
+
const styles = {"bottomAddonInput":"input-autocomplete__bottomAddonInput_1fnw7","footer":"input-autocomplete__footer_1fnw7"};
|
|
2
2
|
require('./mobile.css')
|
|
3
3
|
|
|
4
4
|
export { styles as s };
|
|
@@ -1,7 +1,64 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { BaseSelectProps, OptionProps, OptionShape } from "./typings-dd8ca091";
|
|
4
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
5
|
+
type useSelectWithLoadingProps = {
|
|
6
|
+
loading?: boolean;
|
|
7
|
+
visibleOptions?: BaseSelectProps["visibleOptions"];
|
|
8
|
+
Option?: React.FC<OptionProps>;
|
|
9
|
+
};
|
|
10
|
+
declare function useSelectWithLoading({ loading, visibleOptions, Option }: useSelectWithLoadingProps): {
|
|
11
|
+
Option: (props: OptionProps) => React.JSX.Element;
|
|
12
|
+
options: OptionShape[];
|
|
13
|
+
} | null;
|
|
14
|
+
type OptionsFetcherResponse = {
|
|
15
|
+
options: OptionShape[];
|
|
16
|
+
hasMore: boolean;
|
|
17
|
+
};
|
|
18
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
19
|
+
type useLazyLoadingProps = {
|
|
20
|
+
/** Количество элементов на "странице" */
|
|
21
|
+
limit?: number;
|
|
22
|
+
/** Начальный номер "страницы" */
|
|
23
|
+
initialOffset?: number;
|
|
24
|
+
/** Скелетон загружаемых элементов */
|
|
25
|
+
skeleton?: React.ReactNode;
|
|
26
|
+
/** Компонент пункта меню */
|
|
27
|
+
Option?: React.FC<OptionProps>;
|
|
28
|
+
/**
|
|
29
|
+
* Функция-загрузчик опций.
|
|
30
|
+
* @param offset - текущая страница
|
|
31
|
+
* @param limit - количество элементов на странице
|
|
32
|
+
* @param queryString - строчные данные, пробрасываемые для поиска из кастомного инпута, расположенного в заголовке OptionsList
|
|
33
|
+
* @returns Promise<{
|
|
34
|
+
* options - список опций следующей "страницы". Они аппендятся к предыдущим
|
|
35
|
+
* hasMore - указывает, есть ли еще незагруженные элементы (в случае false перестает загружать "следующую страницу")
|
|
36
|
+
* }>
|
|
37
|
+
*/
|
|
38
|
+
optionsFetcher(offset: number, limit: number, queryString?: string): Promise<OptionsFetcherResponse>;
|
|
39
|
+
};
|
|
40
|
+
declare function useLazyLoading({ limit, initialOffset, optionsFetcher, skeleton, Option }: useLazyLoadingProps): {
|
|
41
|
+
optionsProps: {
|
|
42
|
+
Option: (props: OptionProps) => React.JSX.Element;
|
|
43
|
+
options: OptionShape[];
|
|
44
|
+
optionsListProps: {
|
|
45
|
+
ref: React.RefObject<HTMLDivElement>;
|
|
46
|
+
inputProps: {
|
|
47
|
+
onChange: (event: React.ChangeEvent<HTMLInputElement>, payload: {
|
|
48
|
+
value: string;
|
|
49
|
+
}) => void;
|
|
50
|
+
value: string;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
onOpen: (payload: {
|
|
54
|
+
open?: boolean;
|
|
55
|
+
}) => void;
|
|
56
|
+
};
|
|
57
|
+
reset: () => void;
|
|
58
|
+
};
|
|
1
59
|
export * from "./index-ebda875c";
|
|
2
|
-
export * from "./Component-1a4fbd11";
|
|
3
60
|
export * from "./Component-dd8ca091";
|
|
4
|
-
export
|
|
61
|
+
export { useSelectWithLoading, useLazyLoading };
|
|
5
62
|
export * from "./hook-8abfea97";
|
|
6
63
|
export * from "./typings-dd8ca091";
|
|
7
64
|
export * from "./utils-dd8ca091";
|
|
@@ -265,8 +265,12 @@ type BottomSheetProps = {
|
|
|
265
265
|
*/
|
|
266
266
|
onOffsetChange?: (offset: number, percent: number) => void;
|
|
267
267
|
/**
|
|
268
|
-
* Вызывается
|
|
268
|
+
* Вызывается в начале свайпа
|
|
269
269
|
*/
|
|
270
|
-
|
|
270
|
+
onSwipeStart?: (event: HandledEvents) => void;
|
|
271
|
+
/**
|
|
272
|
+
* Вызывается после окончания свайпа
|
|
273
|
+
*/
|
|
274
|
+
onSwipeEnd?: (event: HandledEvents | null) => void;
|
|
271
275
|
};
|
|
272
276
|
export { BottomSheetTitleAlign, BottomSheetProps };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
type SavedStyle = {
|
|
2
|
+
value: string;
|
|
3
|
+
key: string;
|
|
4
|
+
el: HTMLElement;
|
|
5
|
+
};
|
|
6
|
+
type RestoreStyle = {
|
|
7
|
+
container: HTMLElement;
|
|
8
|
+
modals: number;
|
|
9
|
+
styles: SavedStyle[];
|
|
10
|
+
};
|
|
11
|
+
declare class ModalStore {
|
|
12
|
+
private readonly restoreStyles;
|
|
13
|
+
constructor();
|
|
14
|
+
getRestoreStyles: () => RestoreStyle[];
|
|
15
|
+
}
|
|
16
|
+
declare const getModalStore: () => ModalStore;
|
|
17
|
+
declare class GlobalStore {
|
|
18
|
+
private readonly modalStore;
|
|
19
|
+
constructor();
|
|
20
|
+
getModalStore: () => ModalStore;
|
|
21
|
+
}
|
|
22
|
+
declare function isScrolledToTop(target: HTMLElement): boolean;
|
|
23
|
+
declare function isScrolledToBottom(target: HTMLElement): boolean;
|
|
24
|
+
declare function hasScrollbar(target: HTMLElement): boolean;
|
|
25
|
+
declare const getScrollbarSize: () => number;
|
|
26
|
+
declare const restoreContainerStyles: (container: HTMLElement) => void;
|
|
27
|
+
declare const handleContainer: (container?: HTMLElement) => void;
|
|
28
|
+
export type { SavedStyle };
|
|
29
|
+
export { getModalStore, GlobalStore, isScrolledToTop, isScrolledToBottom, hasScrollbar, getScrollbarSize, restoreContainerStyles, handleContainer };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alfalab/core-components-input-autocomplete",
|
|
3
|
-
"version": "10.1.
|
|
3
|
+
"version": "10.1.4",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"license": "MIT",
|
|
@@ -35,9 +35,9 @@
|
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@alfalab/core-components-button": "^9.0.4",
|
|
38
|
-
"@alfalab/core-components-form-control": "^10.0.
|
|
39
|
-
"@alfalab/core-components-input": "^12.1.
|
|
40
|
-
"@alfalab/core-components-select": "^15.1.
|
|
38
|
+
"@alfalab/core-components-form-control": "^10.0.1",
|
|
39
|
+
"@alfalab/core-components-input": "^12.1.3",
|
|
40
|
+
"@alfalab/core-components-select": "^15.1.4",
|
|
41
41
|
"@alfalab/hooks": "^1.13.0",
|
|
42
42
|
"classnames": "^2.3.1",
|
|
43
43
|
"lodash.throttle": "^4.1.1",
|
|
@@ -265,8 +265,12 @@ type BottomSheetProps = {
|
|
|
265
265
|
*/
|
|
266
266
|
onOffsetChange?: (offset: number, percent: number) => void;
|
|
267
267
|
/**
|
|
268
|
-
* Вызывается
|
|
268
|
+
* Вызывается в начале свайпа
|
|
269
269
|
*/
|
|
270
|
-
|
|
270
|
+
onSwipeStart?: (event: HandledEvents) => void;
|
|
271
|
+
/**
|
|
272
|
+
* Вызывается после окончания свайпа
|
|
273
|
+
*/
|
|
274
|
+
onSwipeEnd?: (event: HandledEvents | null) => void;
|
|
271
275
|
};
|
|
272
276
|
export { BottomSheetTitleAlign, BottomSheetProps };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import React from 'react';
|
|
3
|
-
type FooterProps = {
|
|
4
|
-
handleClear?: () => void;
|
|
5
|
-
handleApply?: () => void;
|
|
6
|
-
showClear?: boolean;
|
|
7
|
-
};
|
|
8
|
-
declare const Footer: ({ handleApply, handleClear, showClear }: FooterProps) => React.JSX.Element;
|
|
9
|
-
export { FooterProps, Footer };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { CheckboxProps } from "./index-ebda875c";
|
|
4
|
-
type HeaderProps = {
|
|
5
|
-
checked?: boolean;
|
|
6
|
-
indeterminate?: boolean;
|
|
7
|
-
onChange?: CheckboxProps['onChange'];
|
|
8
|
-
mobile?: boolean;
|
|
9
|
-
};
|
|
10
|
-
declare const Header: React.FC<HeaderProps>;
|
|
11
|
-
export { HeaderProps, Header };
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { OptionProps, OptionShape } from "./typings-dd8ca091";
|
|
4
|
-
type OptionsFetcherResponse = {
|
|
5
|
-
options: OptionShape[];
|
|
6
|
-
hasMore: boolean;
|
|
7
|
-
};
|
|
8
|
-
type useLazyLoadingProps = {
|
|
9
|
-
/** Количество элементов на "странице" */
|
|
10
|
-
limit?: number;
|
|
11
|
-
/** Начальный номер "страницы" */
|
|
12
|
-
initialOffset?: number;
|
|
13
|
-
/** Скелетон загружаемых элементов */
|
|
14
|
-
skeleton?: React.ReactNode;
|
|
15
|
-
/** Компонент пункта меню */
|
|
16
|
-
Option?: React.FC<OptionProps>;
|
|
17
|
-
/**
|
|
18
|
-
* Функция-загрузчик опций.
|
|
19
|
-
* @param offset - текущая страница
|
|
20
|
-
* @param limit - количество элементов на странице
|
|
21
|
-
* @param queryString - строчные данные, пробрасываемые для поиска из кастомного инпута, расположенного в заголовке OptionsList
|
|
22
|
-
* @returns Promise<{
|
|
23
|
-
* options - список опций следующей "страницы". Они аппендятся к предыдущим
|
|
24
|
-
* hasMore - указывает, есть ли еще незагруженные элементы (в случае false перестает загружать "следующую страницу")
|
|
25
|
-
* }>
|
|
26
|
-
*/
|
|
27
|
-
optionsFetcher(offset: number, limit: number, queryString?: string): Promise<OptionsFetcherResponse>;
|
|
28
|
-
};
|
|
29
|
-
declare function useLazyLoading({ limit, initialOffset, optionsFetcher, skeleton, Option, }: useLazyLoadingProps): {
|
|
30
|
-
optionsProps: {
|
|
31
|
-
Option: (props: OptionProps) => React.JSX.Element;
|
|
32
|
-
options: OptionShape[];
|
|
33
|
-
optionsListProps: {
|
|
34
|
-
ref: React.RefObject<HTMLDivElement>;
|
|
35
|
-
inputProps: {
|
|
36
|
-
onChange: (event: React.ChangeEvent<HTMLInputElement>, payload: {
|
|
37
|
-
value: string;
|
|
38
|
-
}) => void;
|
|
39
|
-
value: string;
|
|
40
|
-
};
|
|
41
|
-
};
|
|
42
|
-
onOpen: (payload: {
|
|
43
|
-
open?: boolean;
|
|
44
|
-
}) => void;
|
|
45
|
-
};
|
|
46
|
-
reset: () => void;
|
|
47
|
-
};
|
|
48
|
-
export { useLazyLoading };
|
|
File without changes
|