indicator-ui 0.1.7 → 0.1.9
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.css +0 -69
- package/dist/index.css.map +1 -1
- package/dist/index.js +216 -138
- package/dist/index.js.map +1 -1
- package/dist/types/src/hooks/controlsInput/index.d.ts +1 -1
- package/dist/types/src/hooks/controlsInput/useKeyboardInput.d.ts +2 -2
- package/dist/types/src/hooks/controlsInput/{useKeyboardPressed.d.ts → useKeyboardPressing.d.ts} +6 -5
- package/dist/types/src/ui/DateTimePicker/lib/index.d.ts +1 -0
- package/dist/types/src/ui/DateTimePicker/lib/sortDates.d.ts +2 -0
- package/dist/types/src/ui/InputFields/DateTimeRangeField/types/DateRangeFieldTypes.d.ts +2 -2
- package/dist/types/src/ui/InputFields/SelectField/types/SelectFieldTypes.d.ts +4 -1
- package/package.json +1 -1
|
@@ -4,12 +4,12 @@ type EventTypesType = 'keydown' | 'multiKeydown';
|
|
|
4
4
|
type EventDetailType = {
|
|
5
5
|
keyCode: KeyCodeType;
|
|
6
6
|
};
|
|
7
|
-
type
|
|
7
|
+
export type KeyboardInputEventType = {
|
|
8
8
|
type: EventTypesType;
|
|
9
9
|
detail: EventDetailType;
|
|
10
10
|
originalEvent: KeyboardEvent;
|
|
11
11
|
};
|
|
12
|
-
type OnKeyDownCallback = (event:
|
|
12
|
+
type OnKeyDownCallback = (event: KeyboardInputEventType) => void;
|
|
13
13
|
type CallbackType = OnKeyDownCallback;
|
|
14
14
|
type PropsType<T extends HTMLElement = HTMLElement> = [
|
|
15
15
|
ref: RefObject<T | null>,
|
package/dist/types/src/hooks/controlsInput/{useKeyboardPressed.d.ts → useKeyboardPressing.d.ts}
RENAMED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { RefObject } from "react";
|
|
2
2
|
import { KeyCodeType } from "../../../../types";
|
|
3
|
-
type
|
|
3
|
+
type PressingEventDetailType = {
|
|
4
4
|
keyCode: KeyCodeType;
|
|
5
5
|
duration: number;
|
|
6
|
+
status: 'pressing' | 'released';
|
|
6
7
|
};
|
|
7
|
-
type
|
|
8
|
+
export type KeyboardPressingEventType = {
|
|
8
9
|
originalEvent: KeyboardEvent;
|
|
9
|
-
detail:
|
|
10
|
+
detail: PressingEventDetailType;
|
|
10
11
|
};
|
|
11
|
-
type CallbackType = (event:
|
|
12
|
+
type CallbackType = (event: KeyboardPressingEventType) => void;
|
|
12
13
|
type OptionsType = {
|
|
13
14
|
/** Минимальное время удержания в миллисекундах */
|
|
14
15
|
MIN_PRESSING_DURATION?: number;
|
|
@@ -18,5 +19,5 @@ type PropsType<T extends HTMLElement = HTMLElement> = [
|
|
|
18
19
|
callback?: CallbackType,
|
|
19
20
|
options?: OptionsType
|
|
20
21
|
];
|
|
21
|
-
export declare function
|
|
22
|
+
export declare function useKeyboardPressing(...args: PropsType): void;
|
|
22
23
|
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { FieldsBasePropsType } from "../../../../ui";
|
|
3
3
|
import { DateTimeRangeFieldValueType } from "./DateTimeRangeFieldTypes";
|
|
4
|
-
import {
|
|
5
|
-
type PositionType = Exclude<Parameters<typeof
|
|
4
|
+
import { useModal } from "../../../../hooks";
|
|
5
|
+
type PositionType = Exclude<Parameters<typeof useModal>[1], undefined>['position'];
|
|
6
6
|
export type DateRangeFieldPropsType = FieldsBasePropsType<DateTimeRangeFieldValueType> & {
|
|
7
7
|
firstPlaceholder?: string;
|
|
8
8
|
secondPlaceholder?: string;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { FieldsBasePropsType } from '../../FieldsBase';
|
|
3
3
|
import { DropdownItemPropsType, FlexFieldPropsType } from "../../../../ui";
|
|
4
|
+
import { useModal } from "../../../../hooks";
|
|
5
|
+
type UseModalOptionsPropsType = Exclude<Parameters<typeof useModal>['1'], undefined>;
|
|
4
6
|
export type SelectFieldOptionsItemType<T = unknown> = DropdownItemPropsType & {
|
|
5
7
|
value: T;
|
|
6
8
|
label?: React.ReactNode | React.ReactElement<Record<string, unknown> & {
|
|
@@ -11,7 +13,7 @@ export type SelectFieldOptionsType<T = unknown> = Array<SelectFieldOptionsItemTy
|
|
|
11
13
|
export type SelectFieldValueType<T = unknown, Multiple extends boolean = boolean> = Multiple extends true ? Array<T> : Multiple extends false ? T : T | Array<T>;
|
|
12
14
|
export type SelectFieldPaginationType<T = unknown> = (optionsCount: number, searchString?: string) => Promise<SelectFieldOptionsType<T> | undefined>;
|
|
13
15
|
export type SelectFieldSearchingType<T = unknown> = (searchString: string, curOptions: SelectFieldOptionsType) => Promise<SelectFieldOptionsType<T> | undefined>;
|
|
14
|
-
export type SelectFieldPropsType<T = unknown, Multiple extends boolean = boolean> = FieldsBasePropsType<SelectFieldValueType<T, Multiple>> & Pick<FlexFieldPropsType, 'placeholder'> & {
|
|
16
|
+
export type SelectFieldPropsType<T = unknown, Multiple extends boolean = boolean> = FieldsBasePropsType<SelectFieldValueType<T, Multiple>> & Pick<FlexFieldPropsType, 'placeholder'> & Pick<UseModalOptionsPropsType, 'position'> & {
|
|
15
17
|
options?: SelectFieldOptionsType<T>;
|
|
16
18
|
multiple?: Multiple;
|
|
17
19
|
/**
|
|
@@ -34,3 +36,4 @@ export type SelectFieldPropsType<T = unknown, Multiple extends boolean = boolean
|
|
|
34
36
|
* */
|
|
35
37
|
isActiveItem?: (item: T) => boolean;
|
|
36
38
|
};
|
|
39
|
+
export {};
|