indicator-ui 1.0.43 → 1.0.45
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/dist/index.cjs +9 -9
- package/dist/index.js +7960 -7888
- package/dist/indicator-ui.css +1 -1
- package/dist/types/src/hooks/forms/lib/fieldsProps.d.ts +1 -1
- package/dist/types/src/hooks/forms/types/scheme.d.ts +5 -4
- package/dist/types/src/hooks/forms/useForm.d.ts +2 -2
- package/dist/types/src/hooks/index.d.ts +2 -0
- package/dist/types/src/hooks/scroll/hooks/index.d.ts +3 -0
- package/dist/types/src/hooks/scroll/hooks/useScrollAnchor.d.ts +58 -0
- package/dist/types/src/hooks/scroll/hooks/useScrollHandler.d.ts +19 -0
- package/dist/types/src/hooks/scroll/hooks/useScrollInfo.d.ts +10 -0
- package/dist/types/src/hooks/scroll/index.d.ts +2 -0
- package/dist/types/src/hooks/scroll/types/base.d.ts +4 -0
- package/dist/types/src/hooks/scroll/types/index.d.ts +3 -0
- package/dist/types/src/hooks/scroll/types/scrollAnchor.d.ts +6 -0
- package/dist/types/src/hooks/scroll/types/scrollInfo.d.ts +15 -0
- package/dist/types/src/hooks/scroll/utils/index.d.ts +1 -0
- package/dist/types/src/hooks/ui-animations/index.d.ts +0 -1
- package/dist/types/src/hooks/useResettableTimeout.d.ts +5 -1
- package/dist/types/src/hooks/useSmartScroll/hooks/useDragScroll.d.ts +3 -3
- package/dist/types/src/hooks/useSmartScroll/hooks/useTouchmove.d.ts +3 -3
- package/dist/types/src/hooks/useSmartScroll/hooks/useWheelEvent.d.ts +3 -3
- package/dist/types/src/hooks/utils/index.d.ts +5 -0
- package/dist/types/src/hooks/utils/useDebounce.d.ts +40 -0
- package/dist/types/src/hooks/utils/useLockedCallback.d.ts +29 -0
- package/dist/types/src/hooks/utils/useSimpleRef.d.ts +1 -0
- package/dist/types/src/hooks/utils/useStableCallbackInvoke.d.ts +6 -0
- package/dist/types/src/hooks/utils/useTimeout.d.ts +27 -0
- package/dist/types/src/types/mixins.d.ts +9 -4
- package/dist/types/src/ui/Breadcrumbs/ui/BreadcrumbButton.d.ts +5 -3
- package/dist/types/src/ui/Breadcrumbs/ui/Breadcrumbs.d.ts +4 -3
- package/dist/types/src/ui/Buttons/types/ButtonTypes.d.ts +1 -1
- package/dist/types/src/ui/Collapse/ui/Collapse.d.ts +2 -1
- package/dist/types/src/ui/DropdownV2/ui/DropdownItemV2.d.ts +2 -1
- package/dist/types/src/ui/Tag/ui/FilterTag.d.ts +1 -1
- package/dist/types/src/ui/Tag/ui/TagCount.d.ts +1 -1
- package/dist/types/src/ui/ToggleBase/ui/ToggleBase.d.ts +2 -1
- package/dist/types/src/ui/UserPick/ui/UserPick.d.ts +2 -1
- package/dist/types/src/ui/formFields/FormPaginatedSelectField/hooks/useComponentProps.d.ts +1 -1
- package/dist/types/src/ui/index.d.ts +1 -0
- package/dist/types/src/ui/visual/ScrollHint/hooks/index.d.ts +1 -0
- package/dist/types/src/ui/visual/ScrollHint/hooks/useContainer.d.ts +7 -0
- package/dist/types/src/ui/visual/ScrollHint/hooks/useHintPosition.d.ts +13 -0
- package/dist/types/src/ui/visual/ScrollHint/hooks/useScrollHint.d.ts +3 -0
- package/dist/types/src/ui/visual/ScrollHint/hooks/useScrollListener.d.ts +7 -0
- package/dist/types/src/ui/visual/ScrollHint/index.d.ts +1 -0
- package/dist/types/src/ui/visual/ScrollHint/styles/components/index.d.ts +1 -0
- package/dist/types/src/ui/visual/ScrollHint/styles/index.d.ts +1 -0
- package/dist/types/src/ui/visual/ScrollHint/types/index.d.ts +8 -0
- package/dist/types/src/ui/visual/ScrollHint/ui/ScrollHint.d.ts +5 -0
- package/dist/types/src/ui/visual/ScrollHint/ui/components/Hint.d.ts +4 -0
- package/dist/types/src/ui/visual/ScrollHint/ui/components/index.d.ts +1 -0
- package/dist/types/src/ui/visual/ScrollHint/ui/index.d.ts +1 -0
- package/dist/types/src/ui/visual/ScrollHint/utils/index.d.ts +1 -0
- package/dist/types/src/ui/visual/Shimmer/hooks/index.d.ts +1 -0
- package/dist/types/src/ui/visual/Shimmer/hooks/useShimmer.d.ts +11 -0
- package/dist/types/src/ui/visual/Shimmer/index.d.ts +1 -0
- package/dist/types/src/ui/visual/Shimmer/styles/index.d.ts +1 -0
- package/dist/types/src/ui/visual/Shimmer/ui/Shimmer.d.ts +5 -0
- package/dist/types/src/ui/visual/Shimmer/ui/ShimmerContent.d.ts +5 -0
- package/dist/types/src/ui/visual/Shimmer/ui/index.d.ts +1 -0
- package/dist/types/src/ui/visual/index.d.ts +1 -0
- package/package.json +1 -1
- package/dist/types/src/hooks/ui-animations/useShimmer.d.ts +0 -19
|
@@ -8,5 +8,5 @@ type PropsType<T, P extends FormPath<T>> = {
|
|
|
8
8
|
formErrors: FormError<T>;
|
|
9
9
|
highlightField: (path: P) => void;
|
|
10
10
|
};
|
|
11
|
-
export declare function getFieldPropsType<T, P extends FormPath<T>>(props: PropsType<T, P>): FieldPropsType<FormValue<T, P
|
|
11
|
+
export declare function getFieldPropsType<T, P extends FormPath<T>>(props: PropsType<T, P>): FieldPropsType<FormValue<T, P>, 'update'>;
|
|
12
12
|
export {};
|
|
@@ -152,10 +152,11 @@ export type FieldConfigType<T, F> = DefaultValueConfig<T, F> & BaseFieldValidato
|
|
|
152
152
|
export type FormSchemeType<T> = Nullable<Undefinable<T>> extends infer Form ? {
|
|
153
153
|
[K in ExtendFormPath<Form>]?: FieldConfigType<Form, ExtendFormValue<Form, K>>;
|
|
154
154
|
} : never;
|
|
155
|
-
export type
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
155
|
+
export type FieldChangeMode = 'change' | 'update';
|
|
156
|
+
export type FieldOnChange<V, M extends FieldChangeMode> = M extends 'change' ? (action?: V | null) => void : (action: SetStateAction<V | undefined | null>) => void;
|
|
157
|
+
export type FieldPropsType<V, M extends FieldChangeMode = 'change'> = {
|
|
158
|
+
value?: V | undefined | null;
|
|
159
|
+
onChange?: FieldOnChange<V, M>;
|
|
159
160
|
error?: FormErrorType;
|
|
160
161
|
onBlur?: (event?: FocusEvent) => void;
|
|
161
162
|
};
|
|
@@ -233,8 +233,8 @@ export declare function useForm<Form, T extends Nullable<Undefinable<Form>> = Nu
|
|
|
233
233
|
clearErrors: () => void;
|
|
234
234
|
clearField: (_path: FormPath<T> | FormPath<T>[]) => void;
|
|
235
235
|
register: {
|
|
236
|
-
(): FieldPropsType<FormValue<T, ""
|
|
237
|
-
<P extends FormPath<T>>(path: P, config?: FormSchemeType<T>[P]): FieldPropsType<FormValue<T, P
|
|
236
|
+
(): FieldPropsType<FormValue<T, "">, "update">;
|
|
237
|
+
<P extends FormPath<T>>(path: P, config?: FormSchemeType<T>[P]): FieldPropsType<FormValue<T, P>, "update">;
|
|
238
238
|
};
|
|
239
239
|
registerForm: (refsInstance?: FormInstance) => Pick<React.ComponentProps<"form">, "onSubmit" | "onReset" | "noValidate" | "ref"> & Pick<InstanceRefAttributes<React.ComponentRef<"form">>, "instanceRef">;
|
|
240
240
|
getValidForm: () => Promise<Form | null>;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { ScrollAnchorCommit, ScrollDirectionOptions } from '../types';
|
|
2
|
+
type CommitScroll<T> = (el: T) => ScrollAnchorCommit;
|
|
3
|
+
type RevertScroll<T> = (el: T, commit: ScrollAnchorCommit) => ScrollAnchorCommit;
|
|
4
|
+
type PropsType = ScrollDirectionOptions;
|
|
5
|
+
type FunReturnType<T> = {
|
|
6
|
+
commitScroll: CommitScroll<T>;
|
|
7
|
+
revertScroll: RevertScroll<T>;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Хук для сохранения визуальной позиции скролла
|
|
11
|
+
* при добавлении элементов в начало списка (prepend) или
|
|
12
|
+
* при изменение размера `layout` между `зоной видимости`
|
|
13
|
+
* и `началом элемента`.
|
|
14
|
+
*
|
|
15
|
+
* Используется в сценариях, когда новый контент вставляется
|
|
16
|
+
* выше текущей видимой области, из-за чего увеличивается
|
|
17
|
+
* scrollHeight, а браузер сохраняет `scrollTop`.
|
|
18
|
+
*
|
|
19
|
+
* Хук компенсирует это смещение, сохраняя пользователя
|
|
20
|
+
* на том же визуальном месте списка.
|
|
21
|
+
*
|
|
22
|
+
* Принцип работы:
|
|
23
|
+
* 1. `commitScroll` — сохраняет текущее состояние скролла и размеры контейнера.
|
|
24
|
+
* 2. В DOM добавляются элементы в начало списка (prepend).
|
|
25
|
+
* 3. `revertScroll` — компенсирует изменение scrollHeight,
|
|
26
|
+
* корректируя scrollTop так, чтобы видимая область не сместилась.
|
|
27
|
+
*
|
|
28
|
+
* ⚠️ ВАЖНО:
|
|
29
|
+
* Между вызовами `commitScroll` и `revertScroll`
|
|
30
|
+
* изменение DOM должно происходить до этапа раскраски,
|
|
31
|
+
* на этапе просчета `layout`.
|
|
32
|
+
*
|
|
33
|
+
* ⚠️ ОГРАНИЧЕНИЕ:
|
|
34
|
+
* Хук предназначен ТОЛЬКО для сценариев добавления элементов
|
|
35
|
+
* в начало списка.
|
|
36
|
+
*
|
|
37
|
+
* @template T HTMLElement или его наследник
|
|
38
|
+
*
|
|
39
|
+
* @param props Параметры компенсации скролла
|
|
40
|
+
*
|
|
41
|
+
* @param props.scrollVerticalDirection
|
|
42
|
+
* Направление компенсации по вертикали.
|
|
43
|
+
* Для prepend-сценариев обычно используется 'bottom' (по умолчанию).
|
|
44
|
+
*
|
|
45
|
+
* @param props.scrollHorizontalDirection
|
|
46
|
+
* Направление компенсации по горизонтали (по умолчанию 'right').
|
|
47
|
+
*
|
|
48
|
+
* @returns Объект с методами управления якорем скролла
|
|
49
|
+
*
|
|
50
|
+
* @returns.commitScroll
|
|
51
|
+
* Сохраняет состояние скролла ДО добавления элементов в начало списка.
|
|
52
|
+
*
|
|
53
|
+
* @returns.revertScroll
|
|
54
|
+
* Восстанавливает позицию скролла ПОСЛЕ добавления элементов,
|
|
55
|
+
* но ДО отрисовки браузером.
|
|
56
|
+
*/
|
|
57
|
+
export declare function useScrollAnchor<T extends HTMLElement>(props?: PropsType): FunReturnType<T>;
|
|
58
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ScrollInfoEvent, SimpleElementType } from '../..';
|
|
2
|
+
import { ScrollAnchorCommit } from '../types';
|
|
3
|
+
import { useScrollAnchor } from './useScrollAnchor';
|
|
4
|
+
import { useScrollInfo } from './useScrollInfo';
|
|
5
|
+
type ScrollEvent<T extends HTMLElement> = ScrollInfoEvent<T> & {
|
|
6
|
+
commitScroll: () => ScrollAnchorCommit;
|
|
7
|
+
revertScroll: (commit: ScrollAnchorCommit) => ScrollAnchorCommit;
|
|
8
|
+
};
|
|
9
|
+
type Options<T extends HTMLElement> = Parameters<typeof useScrollInfo<T>>[number] | Parameters<typeof useScrollAnchor<T>>[number];
|
|
10
|
+
type Callback<T extends HTMLElement> = (ev: ScrollEvent<T>) => void;
|
|
11
|
+
type PropsType<T extends HTMLElement> = [ref: SimpleElementType<T>, callback: Callback<T>, options?: Options<T>];
|
|
12
|
+
export declare function useScrollHandler<T extends HTMLElement>(...args: PropsType<T>): {
|
|
13
|
+
getInfo: () => ScrollInfoEvent<T>;
|
|
14
|
+
getObj: () => T | null;
|
|
15
|
+
commitScroll: () => ScrollAnchorCommit;
|
|
16
|
+
revertScroll: (commit: ScrollAnchorCommit) => ScrollAnchorCommit;
|
|
17
|
+
reinit: () => void;
|
|
18
|
+
};
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ScrollDirectionOptions } from '../..';
|
|
2
|
+
import { ScrollInfoEvent } from '../types';
|
|
3
|
+
type Options = ScrollDirectionOptions & {
|
|
4
|
+
nearDelta?: number;
|
|
5
|
+
};
|
|
6
|
+
type PropsType = [options?: Options];
|
|
7
|
+
export declare function useScrollInfo<T extends HTMLElement = HTMLElement>(...args: PropsType): {
|
|
8
|
+
getInfo: (obj: T) => ScrollInfoEvent<T>;
|
|
9
|
+
};
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type ScrollInfoPosition = 'start' | 'end' | 'near-start' | 'near-end' | 'unknown';
|
|
2
|
+
export type ScrollInfoDirection = 'start' | 'end';
|
|
3
|
+
export type ScrollInfoEvent<T extends HTMLElement> = {
|
|
4
|
+
element: T;
|
|
5
|
+
canScrollVertical: boolean;
|
|
6
|
+
canScrollHorizontal: boolean;
|
|
7
|
+
position: {
|
|
8
|
+
vertical: ScrollInfoPosition;
|
|
9
|
+
horizontal: ScrollInfoPosition;
|
|
10
|
+
};
|
|
11
|
+
direction: {
|
|
12
|
+
vertical: ScrollInfoDirection | undefined;
|
|
13
|
+
horizontal: ScrollInfoDirection | undefined;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function assertHTMLElement(el: any): asserts el is HTMLElement;
|
|
@@ -4,5 +4,9 @@ type Options = {
|
|
|
4
4
|
initExecute?: boolean;
|
|
5
5
|
};
|
|
6
6
|
type PropsType = [fun: Callback, timeout: Timeout, opt?: Options];
|
|
7
|
-
export declare function useResettableTimeout(...args: PropsType):
|
|
7
|
+
export declare function useResettableTimeout(...args: PropsType): {
|
|
8
|
+
schedule: (instance: () => void) => void;
|
|
9
|
+
executeAndSchedule: () => Promise<void>;
|
|
10
|
+
clear: () => void;
|
|
11
|
+
};
|
|
8
12
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type PropsType<T> = [
|
|
3
|
-
ref:
|
|
1
|
+
import { SimpleElementType } from '../..';
|
|
2
|
+
type PropsType<T extends HTMLElement> = [
|
|
3
|
+
ref: SimpleElementType<T>,
|
|
4
4
|
callbacks?: {
|
|
5
5
|
onTouchmoveDown?: () => void;
|
|
6
6
|
onTouchmoveUp?: () => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type PropsType<T> = [
|
|
3
|
-
ref:
|
|
1
|
+
import { SimpleElementType } from '../..';
|
|
2
|
+
type PropsType<T extends HTMLElement> = [
|
|
3
|
+
ref: SimpleElementType<T>,
|
|
4
4
|
callbacks?: {
|
|
5
5
|
onWheelDown?: () => void;
|
|
6
6
|
onWheelUp?: () => void;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
type Args = any[];
|
|
2
|
+
type PropsType<TArgs extends Args> = [
|
|
3
|
+
callback: (...args: TArgs) => void,
|
|
4
|
+
delay: number
|
|
5
|
+
];
|
|
6
|
+
/**
|
|
7
|
+
* React-хук, возвращающий debounced-версию функции.
|
|
8
|
+
*
|
|
9
|
+
* Функция будет вызвана только после того, как пройдет `delay` миллисекунд
|
|
10
|
+
* с момента последнего вызова. Каждый новый вызов сбрасывает таймер.
|
|
11
|
+
*
|
|
12
|
+
* Хук корректно:
|
|
13
|
+
* - работает с аргументами через `...args`
|
|
14
|
+
* - обновляет callback без сброса таймера
|
|
15
|
+
* - очищает таймер при размонтировании компонента
|
|
16
|
+
*
|
|
17
|
+
* Подходит для:
|
|
18
|
+
* - обработки ввода пользователя (search, filters)
|
|
19
|
+
* - resize / scroll обработчиков
|
|
20
|
+
* - любых часто вызываемых, но дорогих операций
|
|
21
|
+
*
|
|
22
|
+
* @template TArgs Тип аргументов callback-функции
|
|
23
|
+
*
|
|
24
|
+
* @param callback Функция, выполнение которой нужно задебаунсить
|
|
25
|
+
* @param delay Задержка в миллисекундах
|
|
26
|
+
*
|
|
27
|
+
* @returns Debounced-функция с той же сигнатурой, что и `callback`
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* const onChange = useDebounce(
|
|
31
|
+
* (value: string) => {
|
|
32
|
+
* fetchUsers(value)
|
|
33
|
+
* },
|
|
34
|
+
* 300
|
|
35
|
+
* )
|
|
36
|
+
*
|
|
37
|
+
* onChange('hello')
|
|
38
|
+
*/
|
|
39
|
+
export declare function useDebounce<TArgs extends Args>(...args: PropsType<TArgs>): (...args: TArgs) => void;
|
|
40
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
type Args = any[];
|
|
2
|
+
type PropsType<TArgs extends Args> = [
|
|
3
|
+
callback: (...args: TArgs) => Promise<any> | void
|
|
4
|
+
];
|
|
5
|
+
/**
|
|
6
|
+
* React-хук, возвращающий эксклюзивную версию callback-функции.
|
|
7
|
+
*
|
|
8
|
+
* Функция может быть вызвана многократно, но пока выполняется,
|
|
9
|
+
* повторные вызовы будут **игнорироваться**.
|
|
10
|
+
*
|
|
11
|
+
* Полезно для:
|
|
12
|
+
* - кнопок Submit (защита от double click)
|
|
13
|
+
* - async side-effects, которые нельзя выполнять параллельно
|
|
14
|
+
* - любых операций, где нужен mutex на выполнение
|
|
15
|
+
*
|
|
16
|
+
* @template TArgs Тип аргументов callback-функции
|
|
17
|
+
* @param callback Асинхронная или синхронная функция, которую нужно защитить от параллельных вызовов
|
|
18
|
+
* @returns Функцию с той же сигнатурой, но блокирующую повторные вызовы пока выполняется
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* const save = useLockedCallback(async (data: string) => {
|
|
22
|
+
* await api.save(data)
|
|
23
|
+
* })
|
|
24
|
+
*
|
|
25
|
+
* save('hello') // выполнится
|
|
26
|
+
* save('world') // проигнорируется, если предыдущий вызов ещё не завершился
|
|
27
|
+
*/
|
|
28
|
+
export declare function useLockedCallback<TArgs extends Args>(...args: PropsType<TArgs>): (...args: TArgs) => void | Promise<any>;
|
|
29
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useSimpleRef<T>(initialValue: T): readonly [() => T, (instance: T) => void];
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
type Fun = (...args: any[]) => any;
|
|
2
|
+
type PropsType<T extends Fun | undefined> = [callback: T];
|
|
3
|
+
type ReturnType<T extends Fun | undefined> = T extends undefined ? (...args: any[]) => void : T;
|
|
4
|
+
export declare function useStableCallbackInvoke<T extends undefined>(...args: PropsType<T>): ReturnType<T>;
|
|
5
|
+
export declare function useStableCallbackInvoke<T extends Fun>(...args: PropsType<T>): ReturnType<T>;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
type SetTimeoutFn = (callback: () => void, delay?: number) => void;
|
|
2
|
+
type ClearTimeoutFn = () => void;
|
|
3
|
+
/**
|
|
4
|
+
* React-хук для управления единичным таймером.
|
|
5
|
+
*
|
|
6
|
+
* Хук возвращает кортеж `[setTimeout, clearTimeout]`, который позволяет:
|
|
7
|
+
* - установить таймер, который выполнит переданную функцию через заданную задержку
|
|
8
|
+
* - сбросить активный таймер, если он существует
|
|
9
|
+
* - автоматически очищать таймер при размонтировании компонента
|
|
10
|
+
*
|
|
11
|
+
* Повторный вызов `setTimeout` сбрасывает предыдущий таймер.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* const [setTimeout, clearTimeout] = useTimeout()
|
|
15
|
+
*
|
|
16
|
+
* // Таймер сработает через 500 мс
|
|
17
|
+
* setTimeout(() => {
|
|
18
|
+
* console.log('Привет через 500 мс')
|
|
19
|
+
* }, 500)
|
|
20
|
+
*
|
|
21
|
+
* // Сброс таймера
|
|
22
|
+
* clearTimeout()
|
|
23
|
+
*
|
|
24
|
+
* @returns [setTimeout, clearTimeout] — функции для управления таймером
|
|
25
|
+
*/
|
|
26
|
+
export declare function useTimeout(): [SetTimeoutFn, ClearTimeoutFn];
|
|
27
|
+
export {};
|
|
@@ -20,11 +20,16 @@ export type Undefinable<T> = undefined | (IsObject<T> extends true ? IsArray<T>
|
|
|
20
20
|
[K in keyof T]?: T[K] | undefined;
|
|
21
21
|
} : T);
|
|
22
22
|
export type Merge<A extends Record<any, any>, B extends Record<any, any>> = Omit<A, keyof B> & B;
|
|
23
|
-
|
|
23
|
+
type ComponentAttributes = {
|
|
24
|
+
[K in PropertyKey]: unknown;
|
|
25
|
+
};
|
|
26
|
+
export type AsProps<T extends ElementType, P extends ComponentAttributes = {}, IR = never> = Merge<React.ComponentPropsWithoutRef<T>, {
|
|
24
27
|
as?: T;
|
|
25
|
-
} & InstanceRefAttributes<IR> & P>;
|
|
28
|
+
} & (IR extends never ? {} : InstanceRefAttributes<IR>) & P>;
|
|
29
|
+
export type ComponentPropsWithoutInstanceRef<T extends ElementType> = Omit<React.ComponentProps<T>, keyof InstanceRefAttributes<T>>;
|
|
26
30
|
export type InstanceRefAttributes<T> = {
|
|
27
|
-
instanceRef?: React.
|
|
31
|
+
instanceRef?: React.RefObject<T> | React.RefCallback<T> | null;
|
|
28
32
|
};
|
|
29
|
-
export type ComponentPropsWithoutInstanceRef<T extends ElementType> = Omit<React.ComponentProps<T>, keyof InstanceRefAttributes<T>>;
|
|
30
33
|
export type ComponentInstanceRef<T extends ElementType> = React.ComponentProps<T> extends InstanceRefAttributes<infer Method> ? Method : never;
|
|
34
|
+
export type AcceptsComponentProps<T extends ElementType, P extends ComponentAttributes> = React.ComponentPropsWithoutRef<T> extends P ? T : never;
|
|
35
|
+
export {};
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { default as React, ElementType } from 'react';
|
|
2
|
-
import { AsProps
|
|
3
|
-
type PropsType<T extends ElementType> =
|
|
2
|
+
import { AsProps } from '../../../types';
|
|
3
|
+
type PropsType<T extends ElementType> = AsProps<T, {
|
|
4
|
+
text?: React.ReactNode;
|
|
5
|
+
icon?: React.ReactNode;
|
|
4
6
|
current?: boolean;
|
|
5
7
|
className?: string;
|
|
6
8
|
children?: React.ReactNode;
|
|
7
9
|
type?: 'text' | 'button-primary' | 'button-gray';
|
|
8
|
-
}
|
|
10
|
+
}, React.ComponentRef<T>>;
|
|
9
11
|
export declare function BreadcrumbButton<T extends ElementType = 'button'>(props: PropsType<T>): import("react/jsx-runtime").JSX.Element;
|
|
10
12
|
export {};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { AsProps
|
|
1
|
+
import { AsProps } from '../../../types';
|
|
2
2
|
import { default as React, ElementType } from 'react';
|
|
3
3
|
import { Divider } from './Divider';
|
|
4
|
-
type PropsType<T extends ElementType> =
|
|
4
|
+
type PropsType<T extends ElementType> = AsProps<T, {
|
|
5
5
|
children?: React.ReactNode;
|
|
6
|
+
className?: string;
|
|
6
7
|
type?: React.ComponentProps<typeof Divider>['type'];
|
|
7
|
-
}
|
|
8
|
+
}, React.ComponentRef<T>>;
|
|
8
9
|
export declare function Breadcrumbs<T extends ElementType = 'div'>(props: PropsType<T>): import("react/jsx-runtime").JSX.Element;
|
|
9
10
|
export {};
|
|
@@ -8,7 +8,8 @@ type PropsType<C extends ElementType, W extends ElementType> = AsProps<C, {
|
|
|
8
8
|
wrapperStyle?: CSSProperties;
|
|
9
9
|
onUpdateState?: (state: CollapseState) => void;
|
|
10
10
|
initialState?: CollapseState;
|
|
11
|
-
|
|
11
|
+
style?: CSSProperties;
|
|
12
|
+
}, React.ComponentRef<C>>;
|
|
12
13
|
type RefType = Omit<CollapsibleReturnType, 'getWrapperInitStyle' | 'getContentInitStyle'>;
|
|
13
14
|
/**
|
|
14
15
|
* Collapse — полиморфный JSX-компонент, являющийся компонентной реализацией хука `useCollapsible`.
|
|
@@ -7,7 +7,8 @@ type PropsType<T extends React.ElementType> = AsProps<T, {
|
|
|
7
7
|
avatar?: string;
|
|
8
8
|
subtitle?: React.ReactNode;
|
|
9
9
|
icon?: React.ReactNode;
|
|
10
|
+
className?: string;
|
|
10
11
|
size?: 'small' | 'medium';
|
|
11
|
-
}
|
|
12
|
+
}, React.ComponentRef<T>>;
|
|
12
13
|
export declare function DropdownItemV2<T extends React.ElementType = 'li'>(props: PropsType<T>): import("react/jsx-runtime").JSX.Element;
|
|
13
14
|
export {};
|
|
@@ -7,7 +7,7 @@ type PropsType<T extends React.ElementType> = AsProps<T, {
|
|
|
7
7
|
label?: React.ReactNode;
|
|
8
8
|
onClose?: () => void;
|
|
9
9
|
active?: boolean;
|
|
10
|
-
}
|
|
10
|
+
}, React.ComponentRef<T>>;
|
|
11
11
|
export declare const _FilterTag: <T extends React.ElementType>(props: PropsType<T>, ref: React.Ref<RefType<T>>) => import("react/jsx-runtime").JSX.Element;
|
|
12
12
|
export declare const FilterTag: <T extends React.ElementType = "button">(props: PropsType<T> & React.RefAttributes<RefType<T>>) => JSX.Element;
|
|
13
13
|
export {};
|
|
@@ -4,6 +4,6 @@ type PropsType<T extends React.ElementType> = AsProps<T, {
|
|
|
4
4
|
count?: React.ReactNode;
|
|
5
5
|
color?: 'gray' | 'color' | 'white';
|
|
6
6
|
size?: 'small' | 'medium' | 'large';
|
|
7
|
-
}
|
|
7
|
+
}, React.ComponentRef<T>>;
|
|
8
8
|
export declare function TagCount<T extends React.ElementType = 'span'>(props: PropsType<T>): import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
export {};
|
|
@@ -9,8 +9,9 @@ type PropsType<T extends React.ElementType> = AsProps<T, {
|
|
|
9
9
|
error?: boolean;
|
|
10
10
|
hover?: boolean;
|
|
11
11
|
disabled?: boolean;
|
|
12
|
+
className?: string;
|
|
12
13
|
/** @deprecated */
|
|
13
14
|
theme?: "light" | "dark";
|
|
14
|
-
}
|
|
15
|
+
}, React.ComponentRef<T>>;
|
|
15
16
|
export declare function ToggleBase<T extends React.ElementType>(props: PropsType<T>): import("react/jsx-runtime").JSX.Element;
|
|
16
17
|
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
1
2
|
import { AsProps } from '../../../types';
|
|
2
3
|
export type PropsType = AsProps<'div', {
|
|
3
4
|
/**
|
|
@@ -12,5 +13,5 @@ export type PropsType = AsProps<'div', {
|
|
|
12
13
|
* */
|
|
13
14
|
size?: '20' | '24' | '32' | '40' | '48' | '64' | '72' | '80' | '96' | '120' | '144' | '160' | number;
|
|
14
15
|
disabled?: boolean;
|
|
15
|
-
}
|
|
16
|
+
}, React.ComponentRef<'div'>>;
|
|
16
17
|
export declare function UserPick(props: PropsType): import("react/jsx-runtime").JSX.Element;
|
|
@@ -5,7 +5,7 @@ import { useSearching } from './useSearching';
|
|
|
5
5
|
import { useOptionsManagement } from './useOptionsManagement';
|
|
6
6
|
import { useValueBuffer } from './useValueBuffer';
|
|
7
7
|
import { useWrapperServices } from './useWrapperServices';
|
|
8
|
-
type PropsType<D, M extends boolean> = Pick<ReturnType<typeof useModalServices>, 'isShow'> & Pick<ReturnType<typeof useSearching<D, M>>, 'searchString' | 'canSearch'> & Pick<ReturnType<typeof useOptionsManagement<D, M>>, 'options'> & Pick<ReturnType<typeof useWrapperServices>, 'blurWrapper'> & Pick<ReturnType<typeof useValueBuffer<D, M>>, 'bufValueOptions'> & Pick<FieldPropsType<ValueType<D, M>>, 'value' | 'onChange'
|
|
8
|
+
type PropsType<D, M extends boolean> = Pick<ReturnType<typeof useModalServices>, 'isShow'> & Pick<ReturnType<typeof useSearching<D, M>>, 'searchString' | 'canSearch'> & Pick<ReturnType<typeof useOptionsManagement<D, M>>, 'options'> & Pick<ReturnType<typeof useWrapperServices>, 'blurWrapper'> & Pick<ReturnType<typeof useValueBuffer<D, M>>, 'bufValueOptions'> & Pick<FieldPropsType<ValueType<D, M>>, 'value' | 'onChange'> & {
|
|
9
9
|
maxCount?: number;
|
|
10
10
|
multiple: M;
|
|
11
11
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useScrollHint';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ElementType } from 'react';
|
|
2
|
+
import { InstanceRef, PropsType as _PropsType } from '../types';
|
|
3
|
+
type PropsType<T extends ElementType> = Pick<_PropsType<T>, "instanceRef">;
|
|
4
|
+
export declare function useContainer<T extends ElementType>(props: PropsType<T>): {
|
|
5
|
+
containerRef: import('react').RefObject<InstanceRef<T>>;
|
|
6
|
+
};
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ScrollDirectionOptions } from '../../../../hooks';
|
|
2
|
+
type PropsType = ScrollDirectionOptions;
|
|
3
|
+
export declare function useHintPosition(props: PropsType): {
|
|
4
|
+
calcHorizontalHintPosition: (scroll: number, scrollSize: number, clientSize: number) => {
|
|
5
|
+
start: number;
|
|
6
|
+
end: number;
|
|
7
|
+
};
|
|
8
|
+
calcVerticalHintPosition: (scroll: number, scrollSize: number, clientSize: number) => {
|
|
9
|
+
start: number;
|
|
10
|
+
end: number;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ElementType } from 'react';
|
|
2
|
+
import { useContainer } from './useContainer';
|
|
3
|
+
type PropsType<T extends ElementType> = Pick<ReturnType<typeof useContainer<T>>, 'containerRef'> & {
|
|
4
|
+
onScrollHandler: (ev: Event) => void;
|
|
5
|
+
};
|
|
6
|
+
export declare function useScrollListener<T extends ElementType>(props: PropsType<T>): {};
|
|
7
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ui';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as HintStyle } from './Hint.module.scss';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as ScrollHintStyle } from './ScrollHint.module.scss';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { default as React, ElementType } from 'react';
|
|
2
|
+
import { AsProps } from '../../../../types';
|
|
3
|
+
export type DefaultElementType = 'div';
|
|
4
|
+
export type InstanceRef<T extends ElementType> = React.ComponentRef<T>;
|
|
5
|
+
export type PropsType<T extends ElementType> = AsProps<T, {
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
className?: string;
|
|
8
|
+
}, InstanceRef<T>>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ElementType } from 'react';
|
|
2
|
+
import { useScrollHint } from '../hooks';
|
|
3
|
+
type PropsType<T extends ElementType> = Parameters<typeof useScrollHint<T>>[number];
|
|
4
|
+
export declare function ScrollHint<T extends ElementType>(props: PropsType<T>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Hint';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ScrollHint';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function assertHTMLElement(instance: any): asserts instance is HTMLElement;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useShimmer';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { default as React, ElementType } from 'react';
|
|
2
|
+
import { AsProps } from '../../../../types';
|
|
3
|
+
export type DefaultElementType = 'div';
|
|
4
|
+
type PropsType<T extends ElementType> = AsProps<T, {
|
|
5
|
+
/** Состояние шимера */
|
|
6
|
+
activeShimmer?: boolean;
|
|
7
|
+
}, React.ComponentRef<T>>;
|
|
8
|
+
export declare function useShimmer<T extends ElementType = DefaultElementType>(props: PropsType<T>): {
|
|
9
|
+
resClassName: string;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ui';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as ShimmerContentStyle } from './ShimmerContent.module.scss';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ElementType } from 'react';
|
|
2
|
+
import { DefaultElementType, useShimmer } from '../hooks';
|
|
3
|
+
type PropsType<T extends ElementType> = Parameters<typeof useShimmer<T>>[number];
|
|
4
|
+
export declare function Shimmer<T extends ElementType = DefaultElementType>(props: PropsType<T>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export {};
|