indicator-ui 0.1.7 → 0.1.8
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.js +180 -94
- 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/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;
|