indicator-ui 1.1.8 → 1.1.10
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 +7 -7
- package/dist/index.js +6964 -6886
- package/dist/types/src/ui/formFields/dates/FormDateField/hooks/useDateDraft.d.ts +3 -3
- package/dist/types/src/ui/formFields/dates/FormDateField/hooks/useDateFormats.d.ts +11 -10
- package/dist/types/src/ui/formFields/dates/FormDateField/hooks/useDatePickerController.d.ts +2 -2
- package/dist/types/src/ui/formFields/dates/FormDateField/hooks/useDateUtils.d.ts +2 -1
- package/dist/types/src/ui/formFields/dates/FormDateField/hooks/useFormDateFieldProvider.d.ts +1 -1
- package/dist/types/src/ui/formFields/dates/FormDateRangeField/hooks/useDateRangeDraft.d.ts +8 -8
- package/dist/types/src/ui/formFields/dates/FormDateRangeField/hooks/useDateRangeFormats.d.ts +11 -9
- package/dist/types/src/ui/formFields/dates/FormDateRangeField/hooks/useDateTimePickerController.d.ts +2 -2
- package/dist/types/src/ui/formFields/dates/FormDateRangeField/hooks/useDateUtils.d.ts +5 -5
- package/dist/types/src/ui/formFields/dates/FormDateRangeField/hooks/useFormDateRangeFieldProvider.d.ts +2 -2
- package/dist/types/src/ui/formFields/dates/FormDateTimeField/hooks/useDateTimeDraft.d.ts +6 -6
- package/dist/types/src/ui/formFields/dates/FormDateTimeField/hooks/useDateTimeFormats.d.ts +10 -9
- package/dist/types/src/ui/formFields/dates/FormDateTimeField/hooks/useDateTimePickerController.d.ts +2 -2
- package/dist/types/src/ui/formFields/dates/FormDateTimeField/hooks/useDateUtils.d.ts +4 -4
- package/dist/types/src/ui/formFields/dates/FormDateTimeField/hooks/useFormDateTimeFieldProvider.d.ts +2 -2
- package/dist/types/src/ui/formFields/dates/FormTimeField/hooks/useDateUtils.d.ts +3 -3
- package/dist/types/src/ui/formFields/dates/FormTimeField/hooks/useFormTimeFieldProvider.d.ts +1 -1
- package/dist/types/src/ui/formFields/dates/FormTimeField/hooks/useTimeDraft.d.ts +3 -3
- package/dist/types/src/ui/formFields/dates/FormTimeField/hooks/useTimeFormats.d.ts +6 -5
- package/dist/types/src/ui/formFields/dates/FormTimeField/hooks/useTimePickerController.d.ts +2 -2
- package/dist/types/src/ui/formFields/dates/FormTimeRangeField/hooks/useDateUtils.d.ts +4 -4
- package/dist/types/src/ui/formFields/dates/FormTimeRangeField/hooks/useFormTimeRangeFieldProvider.d.ts +2 -2
- package/dist/types/src/ui/formFields/dates/FormTimeRangeField/hooks/{useSyncDateTimeValues.d.ts → useSyncTimeRangeValues.d.ts} +2 -2
- package/dist/types/src/ui/formFields/dates/FormTimeRangeField/hooks/useTimeRangeDraft.d.ts +8 -8
- package/dist/types/src/ui/formFields/dates/FormTimeRangeField/hooks/useTimeRangeFormats.d.ts +6 -5
- package/dist/types/src/ui/formFields/dates/utils/safeDate.d.ts +5 -0
- package/package.json +6 -6
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { useFormDateFieldProvider } from './useFormDateFieldProvider';
|
|
2
2
|
import { useDateFormats } from './useDateFormats';
|
|
3
3
|
type UseFormDateFieldProps = Parameters<typeof useFormDateFieldProvider>[number];
|
|
4
|
-
export type
|
|
4
|
+
export type DateInputValue = string | undefined;
|
|
5
5
|
type PropsType = Pick<UseFormDateFieldProps, 'value'> & Pick<ReturnType<typeof useDateFormats>, 'formatValueToDateInput'>;
|
|
6
6
|
export declare function useDateDraft(props: PropsType): {
|
|
7
|
-
dateInputValue:
|
|
8
|
-
setDateInputValue: import('react').Dispatch<import('react').SetStateAction<
|
|
7
|
+
dateInputValue: DateInputValue;
|
|
8
|
+
setDateInputValue: import('react').Dispatch<import('react').SetStateAction<DateInputValue>>;
|
|
9
9
|
isFullDateInput: () => boolean;
|
|
10
10
|
clearDateValue: () => void;
|
|
11
11
|
};
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { DatePickerV2 } from '../../../..';
|
|
3
3
|
import { useFormDateFieldProvider, ValueType } from './useFormDateFieldProvider';
|
|
4
|
-
import {
|
|
4
|
+
import { DateInputValue } from './useDateDraft';
|
|
5
|
+
type ParsedDate = Date | undefined;
|
|
5
6
|
type DatePickerV2Props = React.ComponentProps<typeof DatePickerV2>;
|
|
6
|
-
type DatePickerValue =
|
|
7
|
+
type DatePickerValue = DatePickerV2Props['date'];
|
|
7
8
|
type PropsType = Required<Pick<Parameters<typeof useFormDateFieldProvider>[number], 'outFormat' | 'inputDateFormat'>>;
|
|
8
9
|
export declare function useDateFormats(props: PropsType): {
|
|
9
|
-
formatDateInputToValue: (instance:
|
|
10
|
-
parseDateInput: (instance:
|
|
11
|
-
parseValue: (instance: ValueType) =>
|
|
12
|
-
formatValueToDateInput: (instance: ValueType) =>
|
|
13
|
-
formatPickerValueToDateInput: (instance: DatePickerValue) =>
|
|
14
|
-
formatValueToDatePickerValue: (instance: ValueType) =>
|
|
15
|
-
extractDateInputToPickerInputs: (instance:
|
|
10
|
+
formatDateInputToValue: (instance: DateInputValue) => ValueType;
|
|
11
|
+
parseDateInput: (instance: DateInputValue) => ParsedDate;
|
|
12
|
+
parseValue: (instance: ValueType) => ParsedDate;
|
|
13
|
+
formatValueToDateInput: (instance: ValueType) => DateInputValue;
|
|
14
|
+
formatPickerValueToDateInput: (instance: DatePickerValue) => DateInputValue;
|
|
15
|
+
formatValueToDatePickerValue: (instance: ValueType) => DatePickerValue;
|
|
16
|
+
extractDateInputToPickerInputs: (instance: DateInputValue) => {
|
|
16
17
|
year: number;
|
|
17
18
|
monthYear: string;
|
|
18
19
|
dayMonthYear: string;
|
|
19
|
-
};
|
|
20
|
+
} | undefined;
|
|
20
21
|
};
|
|
21
22
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { DateInputValue } from './useDateDraft';
|
|
3
3
|
import { useInputFieldController } from './useInputFieldController';
|
|
4
4
|
import { useDateFormats } from './useDateFormats';
|
|
5
5
|
type PropsType = Pick<ReturnType<typeof useDateFormats>, 'extractDateInputToPickerInputs'> & Pick<ReturnType<typeof useInputFieldController>, 'doubleInputRef'> & {
|
|
@@ -39,7 +39,7 @@ export declare function useDatePickerController(props: PropsType): {
|
|
|
39
39
|
}>;
|
|
40
40
|
}>;
|
|
41
41
|
datePickerWrapperRef: React.RefObject<never>;
|
|
42
|
-
moveToInputtedDateInPicker: (instance:
|
|
42
|
+
moveToInputtedDateInPicker: (instance: DateInputValue) => Promise<(void | undefined)[]> | undefined;
|
|
43
43
|
clearDateInputInPicker: () => void;
|
|
44
44
|
switchingPicker: () => void;
|
|
45
45
|
closePicker: () => void;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useDateFormats } from './useDateFormats';
|
|
2
|
+
import { DateInputValue } from './useDateDraft';
|
|
2
3
|
type PropsType = Pick<ReturnType<typeof useDateFormats>, 'parseDateInput'>;
|
|
3
4
|
export declare function useDateUtils(props: PropsType): {
|
|
4
|
-
isValidDateInput: (instance:
|
|
5
|
+
isValidDateInput: (instance: DateInputValue) => boolean;
|
|
5
6
|
};
|
|
6
7
|
export {};
|
package/dist/types/src/ui/formFields/dates/FormDateField/hooks/useFormDateFieldProvider.d.ts
CHANGED
|
@@ -29,7 +29,7 @@ type PropsType = FieldProps & Pick<DatePickerV2Props, 'requestDaysData' | 'reque
|
|
|
29
29
|
disablePicker?: boolean;
|
|
30
30
|
};
|
|
31
31
|
export declare function useFormDateFieldProvider(props: PropsType): {
|
|
32
|
-
dateInputValue:
|
|
32
|
+
dateInputValue: import('./useDateDraft').DateInputValue;
|
|
33
33
|
onCompleteDate: NonNullable<((value: string, maskRef: import('imask').InputMask<{
|
|
34
34
|
[x: string]: unknown;
|
|
35
35
|
}>, e?: InputEvent) => void) | ((value: string, maskRef: import('imask').InputMask<{
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { useFormDateRangeFieldProvider } from './useFormDateRangeFieldProvider';
|
|
2
2
|
import { useDateRangeFormats } from './useDateRangeFormats';
|
|
3
|
-
export type
|
|
3
|
+
export type DateRangeInputValue = string | undefined;
|
|
4
4
|
type UseFormDateRangeFieldProps = Parameters<typeof useFormDateRangeFieldProvider>[number];
|
|
5
5
|
type PropsType = Pick<ReturnType<typeof useDateRangeFormats>, 'formatValueItemToDateInput'> & Pick<UseFormDateRangeFieldProps, 'value'>;
|
|
6
6
|
export declare function useDateRangeDraft(props: PropsType): {
|
|
7
|
-
fromDateValue:
|
|
8
|
-
toDateValue:
|
|
9
|
-
setFromDateValue: import('react').Dispatch<import('react').SetStateAction<
|
|
10
|
-
setToDateValue: import('react').Dispatch<import('react').SetStateAction<
|
|
11
|
-
getFromDateValue: () =>
|
|
12
|
-
getToDateValue: () =>
|
|
7
|
+
fromDateValue: DateRangeInputValue;
|
|
8
|
+
toDateValue: DateRangeInputValue;
|
|
9
|
+
setFromDateValue: import('react').Dispatch<import('react').SetStateAction<DateRangeInputValue>>;
|
|
10
|
+
setToDateValue: import('react').Dispatch<import('react').SetStateAction<DateRangeInputValue>>;
|
|
11
|
+
getFromDateValue: () => DateRangeInputValue;
|
|
12
|
+
getToDateValue: () => DateRangeInputValue;
|
|
13
13
|
clearDateRangeValue: () => void;
|
|
14
|
-
isFullDateInput: (fromDate:
|
|
14
|
+
isFullDateInput: (fromDate: DateRangeInputValue, toDate: DateRangeInputValue) => boolean;
|
|
15
15
|
isFullCurrentDateInput: () => boolean;
|
|
16
16
|
};
|
|
17
17
|
export {};
|
package/dist/types/src/ui/formFields/dates/FormDateRangeField/hooks/useDateRangeFormats.d.ts
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { DateRangePickerV2 } from '../../../..';
|
|
3
3
|
import { useFormDateRangeFieldProvider, ValueItemType, ValueType } from './useFormDateRangeFieldProvider';
|
|
4
|
-
import {
|
|
5
|
-
type
|
|
4
|
+
import { DateRangeInputValue } from './useDateRangeDraft';
|
|
5
|
+
type ParsedDate = Date | undefined;
|
|
6
|
+
type DatePickerValue = React.ComponentProps<typeof DateRangePickerV2>['dateRange'];
|
|
7
|
+
type DatePickerValueItem = NonNullable<DatePickerValue>[number];
|
|
6
8
|
type PropsType = Required<Pick<Parameters<typeof useFormDateRangeFieldProvider>[number], 'outFormat' | 'inputDateFormat'>>;
|
|
7
9
|
export declare function useDateRangeFormats(props: PropsType): {
|
|
8
|
-
formatDateInputToValue: (instance: NonNullable<
|
|
9
|
-
formatValueItemToDateInput: (instance: ValueItemType) =>
|
|
10
|
-
formatValueToDatePickerValue: (instance: ValueType) =>
|
|
11
|
-
parseInputDate: (instance: NonNullable<
|
|
12
|
-
parseValue: (instance: ValueItemType) =>
|
|
13
|
-
formatDatePickerToDateInput: (instance?:
|
|
10
|
+
formatDateInputToValue: (instance: NonNullable<DateRangeInputValue>) => ValueItemType | undefined;
|
|
11
|
+
formatValueItemToDateInput: (instance: ValueItemType) => DateRangeInputValue;
|
|
12
|
+
formatValueToDatePickerValue: (instance: ValueType) => DatePickerValue;
|
|
13
|
+
parseInputDate: (instance: NonNullable<DateRangeInputValue>) => ParsedDate;
|
|
14
|
+
parseValue: (instance: ValueItemType) => ParsedDate;
|
|
15
|
+
formatDatePickerToDateInput: (instance?: DatePickerValueItem) => DateRangeInputValue;
|
|
14
16
|
};
|
|
15
17
|
export {};
|
package/dist/types/src/ui/formFields/dates/FormDateRangeField/hooks/useDateTimePickerController.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { DateRangeInputValue } from './useDateRangeDraft';
|
|
3
3
|
import { useInputFieldController } from './useInputFieldController';
|
|
4
4
|
import { useDateUtils } from './useDateUtils';
|
|
5
5
|
type PropsType = Pick<ReturnType<typeof useInputFieldController>, 'doubleInputRef'> & Pick<ReturnType<typeof useDateUtils>, 'extractDateInputToPickerData'> & {
|
|
@@ -34,7 +34,7 @@ export declare function useDateTimePickerController(props: PropsType): {
|
|
|
34
34
|
}>;
|
|
35
35
|
}>;
|
|
36
36
|
dateTimePickerWrapperRef: React.RefObject<never>;
|
|
37
|
-
moveToInputtedDateInPicker: (instance: NonNullable<
|
|
37
|
+
moveToInputtedDateInPicker: (instance: NonNullable<DateRangeInputValue>) => Promise<(void | undefined)[]> | undefined;
|
|
38
38
|
clearDateRangeInputInPicker: () => void;
|
|
39
39
|
closePicker: () => void;
|
|
40
40
|
openPicker: () => void;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { ValueType } from './useFormDateRangeFieldProvider';
|
|
2
2
|
import { useDateRangeFormats } from './useDateRangeFormats';
|
|
3
|
-
import {
|
|
3
|
+
import { DateRangeInputValue } from './useDateRangeDraft';
|
|
4
4
|
type PropsType = Pick<ReturnType<typeof useDateRangeFormats>, 'parseInputDate' | 'parseValue'>;
|
|
5
5
|
export declare function useDateUtils(props: PropsType): {
|
|
6
|
-
extractDateInputToPickerData: (instance:
|
|
6
|
+
extractDateInputToPickerData: (instance: DateRangeInputValue) => {
|
|
7
7
|
year: number;
|
|
8
8
|
monthYear: string;
|
|
9
9
|
dayMonthYear: string;
|
|
10
|
-
};
|
|
11
|
-
isAfterInputDate: (a:
|
|
10
|
+
} | undefined;
|
|
11
|
+
isAfterInputDate: (a: DateRangeInputValue, b: DateRangeInputValue) => boolean;
|
|
12
12
|
sortDateValue: (instance: ValueType) => string[];
|
|
13
|
-
isValidDateInput: (instance:
|
|
13
|
+
isValidDateInput: (instance: DateRangeInputValue) => boolean;
|
|
14
14
|
};
|
|
15
15
|
export {};
|
|
@@ -33,8 +33,8 @@ type PropsType = FieldProps & Pick<DateRangePickerV2Props, 'requestedDaysData' |
|
|
|
33
33
|
disablePicker?: boolean;
|
|
34
34
|
};
|
|
35
35
|
export declare function useFormDateRangeFieldProvider(props: PropsType): {
|
|
36
|
-
fromDateValue: import('./useDateRangeDraft').
|
|
37
|
-
toDateValue: import('./useDateRangeDraft').
|
|
36
|
+
fromDateValue: import('./useDateRangeDraft').DateRangeInputValue;
|
|
37
|
+
toDateValue: import('./useDateRangeDraft').DateRangeInputValue;
|
|
38
38
|
onCompleteDateTo: NonNullable<((value: string, maskRef: import('imask').InputMask<{
|
|
39
39
|
[x: string]: unknown;
|
|
40
40
|
}>, e?: InputEvent) => void) | ((value: string, maskRef: import('imask').InputMask<{
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { useFormDateTimeFieldProvider } from './useFormDateTimeFieldProvider';
|
|
2
2
|
import { useDateTimeFormats } from './useDateTimeFormats';
|
|
3
3
|
type UseFormDateTimeFieldProps = Parameters<typeof useFormDateTimeFieldProvider>[number];
|
|
4
|
-
export type DateInputValue = string;
|
|
5
|
-
export type TimeInputValue = string;
|
|
4
|
+
export type DateInputValue = string | undefined;
|
|
5
|
+
export type TimeInputValue = string | undefined;
|
|
6
6
|
type PropsType = Pick<UseFormDateTimeFieldProps, 'value'> & Pick<ReturnType<typeof useDateTimeFormats>, 'formatValueToDateInput' | 'formatValueToTimeInput'>;
|
|
7
7
|
export declare function useDateTimeDraft(props: PropsType): {
|
|
8
|
-
dateInputValue:
|
|
9
|
-
timeInputValue:
|
|
10
|
-
setDateInputValue: import('react').Dispatch<import('react').SetStateAction<
|
|
11
|
-
setTimeInputValue: import('react').Dispatch<import('react').SetStateAction<
|
|
8
|
+
dateInputValue: DateInputValue;
|
|
9
|
+
timeInputValue: TimeInputValue;
|
|
10
|
+
setDateInputValue: import('react').Dispatch<import('react').SetStateAction<DateInputValue>>;
|
|
11
|
+
setTimeInputValue: import('react').Dispatch<import('react').SetStateAction<TimeInputValue>>;
|
|
12
12
|
clearDateTimeValue: () => void;
|
|
13
13
|
isFullDateInput: () => boolean;
|
|
14
14
|
};
|
|
@@ -2,18 +2,19 @@ import { default as React } from 'react';
|
|
|
2
2
|
import { DateTimePickerV2 } from '../../../..';
|
|
3
3
|
import { useFormDateTimeFieldProvider, ValueType } from './useFormDateTimeFieldProvider';
|
|
4
4
|
import { DateInputValue, TimeInputValue } from './useDateTimeDraft';
|
|
5
|
+
type ParsedDate = Date | undefined;
|
|
5
6
|
type DateTimePickerV2Props = React.ComponentProps<typeof DateTimePickerV2>;
|
|
6
|
-
type DateTimePickerValue =
|
|
7
|
+
type DateTimePickerValue = DateTimePickerV2Props['dateTime'];
|
|
7
8
|
type PropsType = Required<Pick<Parameters<typeof useFormDateTimeFieldProvider>[number], 'outFormat' | 'inputDateFormat' | 'inputTimeFormat'>>;
|
|
8
9
|
export declare function useDateTimeFormats(props: PropsType): {
|
|
9
10
|
formatDateTimeInputToValue: (dateValue: DateInputValue, timeValue: TimeInputValue) => ValueType;
|
|
10
|
-
parseDateInput: (instance: DateInputValue) =>
|
|
11
|
-
parseTimeInput: (instance: TimeInputValue) =>
|
|
12
|
-
formatValueToDatePickerValue: (instance: ValueType) => DateTimePickerValue
|
|
13
|
-
formatPickerValueToDateInput: (instance: DateTimePickerValue) => DateInputValue
|
|
14
|
-
formatPickerValueToTimeInput: (instance: DateTimePickerValue) => TimeInputValue
|
|
15
|
-
formatValueToDateInput: (instance: ValueType) => DateInputValue
|
|
16
|
-
formatValueToTimeInput: (instance: ValueType) => TimeInputValue
|
|
17
|
-
parseValue: (instance: ValueType) =>
|
|
11
|
+
parseDateInput: (instance: DateInputValue) => ParsedDate;
|
|
12
|
+
parseTimeInput: (instance: TimeInputValue) => ParsedDate;
|
|
13
|
+
formatValueToDatePickerValue: (instance: ValueType) => DateTimePickerValue;
|
|
14
|
+
formatPickerValueToDateInput: (instance: DateTimePickerValue) => DateInputValue;
|
|
15
|
+
formatPickerValueToTimeInput: (instance: DateTimePickerValue) => TimeInputValue;
|
|
16
|
+
formatValueToDateInput: (instance: ValueType) => DateInputValue;
|
|
17
|
+
formatValueToTimeInput: (instance: ValueType) => TimeInputValue;
|
|
18
|
+
parseValue: (instance: ValueType) => ParsedDate;
|
|
18
19
|
};
|
|
19
20
|
export {};
|
package/dist/types/src/ui/formFields/dates/FormDateTimeField/hooks/useDateTimePickerController.d.ts
CHANGED
|
@@ -51,8 +51,8 @@ export declare function useDateTimePickerController(props: PropsType): {
|
|
|
51
51
|
}>;
|
|
52
52
|
}>;
|
|
53
53
|
dateTimePickerWrapperRef: React.RefObject<never>;
|
|
54
|
-
moveToInputtedDateInPicker: (instance: DateInputValue) => Promise<(void | undefined)[]
|
|
55
|
-
moveToInputtedTimeInPicker: (instance: TimeInputValue) => Promise<(void | undefined)[]
|
|
54
|
+
moveToInputtedDateInPicker: (instance: DateInputValue) => Promise<(void | undefined)[]> | undefined;
|
|
55
|
+
moveToInputtedTimeInPicker: (instance: TimeInputValue) => Promise<(void | undefined)[]> | undefined;
|
|
56
56
|
showTimePicker: () => void;
|
|
57
57
|
showDatePicker: () => void;
|
|
58
58
|
clearDateTimeInputInPicker: () => void;
|
|
@@ -6,12 +6,12 @@ export declare function useDateUtils(props: PropsType): {
|
|
|
6
6
|
year: number;
|
|
7
7
|
monthYear: string;
|
|
8
8
|
dayMonthYear: string;
|
|
9
|
-
};
|
|
9
|
+
} | undefined;
|
|
10
10
|
extractTimeInputValue: (instance: TimeInputValue) => {
|
|
11
11
|
hours: number;
|
|
12
12
|
minutes: number;
|
|
13
|
-
};
|
|
14
|
-
isValidDateInput: (instance:
|
|
15
|
-
isValidTimeInput: (instance:
|
|
13
|
+
} | undefined;
|
|
14
|
+
isValidDateInput: (instance: DateInputValue) => boolean;
|
|
15
|
+
isValidTimeInput: (instance: TimeInputValue) => boolean;
|
|
16
16
|
};
|
|
17
17
|
export {};
|
package/dist/types/src/ui/formFields/dates/FormDateTimeField/hooks/useFormDateTimeFieldProvider.d.ts
CHANGED
|
@@ -39,8 +39,8 @@ type PropsType = FieldProps & Pick<DateTimePickerV2Props, 'requestDaysData' | 'r
|
|
|
39
39
|
disablePicker?: boolean;
|
|
40
40
|
};
|
|
41
41
|
export declare function useFormDateTimeFieldProvider(props: PropsType): {
|
|
42
|
-
dateInputValue:
|
|
43
|
-
timeInputValue:
|
|
42
|
+
dateInputValue: import('./useDateTimeDraft').DateInputValue;
|
|
43
|
+
timeInputValue: import('./useDateTimeDraft').TimeInputValue;
|
|
44
44
|
onCompleteDate: NonNullable<((value: string, maskRef: import('imask').InputMask<{
|
|
45
45
|
[x: string]: unknown;
|
|
46
46
|
}>, e?: InputEvent) => void) | ((value: string, maskRef: import('imask').InputMask<{
|
|
@@ -2,10 +2,10 @@ import { TimeInputValue } from './useTimeDraft';
|
|
|
2
2
|
import { useTimeFormats } from './useTimeFormats';
|
|
3
3
|
type PropsType = Pick<ReturnType<typeof useTimeFormats>, 'parseTimeInput'>;
|
|
4
4
|
export declare function useDateUtils(props: PropsType): {
|
|
5
|
-
|
|
5
|
+
extractTimeInput: (instance: TimeInputValue) => {
|
|
6
6
|
hours: number;
|
|
7
7
|
minutes: number;
|
|
8
|
-
};
|
|
9
|
-
isValidTimeInput: (instance:
|
|
8
|
+
} | undefined;
|
|
9
|
+
isValidTimeInput: (instance: TimeInputValue) => boolean;
|
|
10
10
|
};
|
|
11
11
|
export {};
|
package/dist/types/src/ui/formFields/dates/FormTimeField/hooks/useFormTimeFieldProvider.d.ts
CHANGED
|
@@ -29,7 +29,7 @@ type PropsType = FieldProps & {
|
|
|
29
29
|
disablePicker?: boolean;
|
|
30
30
|
};
|
|
31
31
|
export declare function useFormTimeFieldProvider(props: PropsType): {
|
|
32
|
-
timeInputValue:
|
|
32
|
+
timeInputValue: import('./useTimeDraft').TimeInputValue;
|
|
33
33
|
onCompleteTime: NonNullable<((value: string, maskRef: import('imask').InputMask<{
|
|
34
34
|
[x: string]: unknown;
|
|
35
35
|
}>, e?: InputEvent) => void) | ((value: string, maskRef: import('imask').InputMask<{
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { useFormTimeFieldProvider } from './useFormTimeFieldProvider';
|
|
2
2
|
import { useTimeFormats } from './useTimeFormats';
|
|
3
3
|
type UseFormDateTimeFieldProps = Parameters<typeof useFormTimeFieldProvider>[number];
|
|
4
|
-
export type TimeInputValue = string;
|
|
4
|
+
export type TimeInputValue = string | undefined;
|
|
5
5
|
type PropsType = Pick<UseFormDateTimeFieldProps, 'value'> & Pick<ReturnType<typeof useTimeFormats>, 'formatValueToTimeInput'>;
|
|
6
6
|
export declare function useTimeDraft(props: PropsType): {
|
|
7
|
-
timeInputValue:
|
|
8
|
-
setTimeInputValue: import('react').Dispatch<import('react').SetStateAction<
|
|
7
|
+
timeInputValue: TimeInputValue;
|
|
8
|
+
setTimeInputValue: import('react').Dispatch<import('react').SetStateAction<TimeInputValue>>;
|
|
9
9
|
clearTimeValue: () => void;
|
|
10
10
|
isFullDateInput: () => boolean;
|
|
11
11
|
};
|
|
@@ -2,14 +2,15 @@ import { default as React } from 'react';
|
|
|
2
2
|
import { TimePickerV2 } from '../../../..';
|
|
3
3
|
import { useFormTimeFieldProvider, ValueType } from './useFormTimeFieldProvider';
|
|
4
4
|
import { TimeInputValue } from './useTimeDraft';
|
|
5
|
+
type ParsedDate = Date | undefined;
|
|
5
6
|
type TimePickerV2Props = React.ComponentProps<typeof TimePickerV2>;
|
|
6
|
-
type
|
|
7
|
+
type TimePickerValue = TimePickerV2Props['time'];
|
|
7
8
|
type PropsType = Required<Pick<Parameters<typeof useFormTimeFieldProvider>[number], 'outFormat' | 'inputTimeFormat'>>;
|
|
8
9
|
export declare function useTimeFormats(props: PropsType): {
|
|
9
10
|
formatDateTimeInputToValue: (timeValue: TimeInputValue) => ValueType;
|
|
10
|
-
parseTimeInput: (instance: TimeInputValue) =>
|
|
11
|
-
parseValueTime: (instance: ValueType) =>
|
|
12
|
-
formatPickerValueToTimeInput: (instance:
|
|
13
|
-
formatValueToTimeInput: (instance: ValueType) => TimeInputValue
|
|
11
|
+
parseTimeInput: (instance: TimeInputValue) => ParsedDate;
|
|
12
|
+
parseValueTime: (instance: ValueType) => ParsedDate;
|
|
13
|
+
formatPickerValueToTimeInput: (instance: TimePickerValue) => TimeInputValue;
|
|
14
|
+
formatValueToTimeInput: (instance: ValueType) => TimeInputValue;
|
|
14
15
|
};
|
|
15
16
|
export {};
|
|
@@ -2,7 +2,7 @@ import { default as React } from 'react';
|
|
|
2
2
|
import { TimeInputValue } from './useTimeDraft';
|
|
3
3
|
import { useInputFieldController } from './useInputFieldController';
|
|
4
4
|
import { useDateUtils } from './useDateUtils';
|
|
5
|
-
type PropsType = Pick<ReturnType<typeof useInputFieldController>, 'doubleInputRef'> & Pick<ReturnType<typeof useDateUtils>, '
|
|
5
|
+
type PropsType = Pick<ReturnType<typeof useInputFieldController>, 'doubleInputRef'> & Pick<ReturnType<typeof useDateUtils>, 'extractTimeInput'> & {
|
|
6
6
|
disablePicker?: boolean;
|
|
7
7
|
};
|
|
8
8
|
export declare function useTimePickerController(props: PropsType): {
|
|
@@ -24,7 +24,7 @@ export declare function useTimePickerController(props: PropsType): {
|
|
|
24
24
|
}>;
|
|
25
25
|
}>;
|
|
26
26
|
timePickerWrapperRef: React.RefObject<never>;
|
|
27
|
-
moveToInputtedTimeInPicker: (instance: TimeInputValue) => Promise<(void | undefined)[]
|
|
27
|
+
moveToInputtedTimeInPicker: (instance: TimeInputValue) => Promise<(void | undefined)[]> | undefined;
|
|
28
28
|
clearTimeInputInPicker: () => void;
|
|
29
29
|
closePicker: () => void;
|
|
30
30
|
switchingPicker: () => void;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { useTimeRangeFormats } from './useTimeRangeFormats';
|
|
2
2
|
import { ValueType } from './useFormTimeRangeFieldProvider';
|
|
3
|
-
import {
|
|
4
|
-
type PropsType = Pick<ReturnType<typeof useTimeRangeFormats>, 'parseTimeValue' | '
|
|
3
|
+
import { TimeInputValue } from './useTimeRangeDraft';
|
|
4
|
+
type PropsType = Pick<ReturnType<typeof useTimeRangeFormats>, 'parseTimeValue' | 'parseTimeInputValue'>;
|
|
5
5
|
export declare function useDateUtils(props: PropsType): {
|
|
6
6
|
sortValue: (instance: ValueType) => string[];
|
|
7
|
-
isAfterInputTime: (a:
|
|
8
|
-
isValidTimeInput: (instance:
|
|
7
|
+
isAfterInputTime: (a: TimeInputValue, b: TimeInputValue) => boolean;
|
|
8
|
+
isValidTimeInput: (instance: TimeInputValue) => boolean;
|
|
9
9
|
};
|
|
10
10
|
export {};
|
|
@@ -28,8 +28,8 @@ type PropsType = FieldProps & {
|
|
|
28
28
|
onDismissClick?: DoubleInputItemProps['onDismissClick'] | false;
|
|
29
29
|
};
|
|
30
30
|
export declare function useFormTimeRangeFieldProvider(props: PropsType): {
|
|
31
|
-
fromTimeValue:
|
|
32
|
-
toTimeValue:
|
|
31
|
+
fromTimeValue: import('./useTimeRangeDraft').TimeInputValue;
|
|
32
|
+
toTimeValue: import('./useTimeRangeDraft').TimeInputValue;
|
|
33
33
|
onCompleteTimeTo: NonNullable<((value: string, maskRef: import('imask').InputMask<{
|
|
34
34
|
[x: string]: unknown;
|
|
35
35
|
}>, e?: InputEvent) => void) | ((value: string, maskRef: import('imask').InputMask<{
|
|
@@ -2,6 +2,6 @@ import { useTimeRangeDraft } from './useTimeRangeDraft';
|
|
|
2
2
|
import { useTimeRangeFormats } from './useTimeRangeFormats';
|
|
3
3
|
import { useFormTimeRangeFieldProvider } from './useFormTimeRangeFieldProvider';
|
|
4
4
|
import { useDateUtils } from './useDateUtils';
|
|
5
|
-
type PropsType = Pick<Parameters<typeof useFormTimeRangeFieldProvider>[number], 'onChange' | 'value'> & Pick<ReturnType<typeof useTimeRangeDraft>, 'setFromTimeValue' | 'setToTimeValue' | 'fromTimeValue' | 'toTimeValue'> & Pick<ReturnType<typeof useTimeRangeFormats>, 'formatTimeInputToValue' | 'formatValueItemToTimeInput'
|
|
6
|
-
export declare function
|
|
5
|
+
type PropsType = Pick<Parameters<typeof useFormTimeRangeFieldProvider>[number], 'onChange' | 'value'> & Pick<ReturnType<typeof useTimeRangeDraft>, 'setFromTimeValue' | 'setToTimeValue' | 'fromTimeValue' | 'toTimeValue'> & Pick<ReturnType<typeof useTimeRangeFormats>, 'formatTimeInputToValue' | 'formatValueItemToTimeInput'> & Pick<ReturnType<typeof useDateUtils>, 'sortValue'>;
|
|
6
|
+
export declare function useSyncTimeRangeValues(props: PropsType): void;
|
|
7
7
|
export {};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { useFormTimeRangeFieldProvider } from './useFormTimeRangeFieldProvider';
|
|
2
2
|
import { useTimeRangeFormats } from './useTimeRangeFormats';
|
|
3
|
-
export type
|
|
3
|
+
export type TimeInputValue = string | undefined;
|
|
4
4
|
type UseFormDateRangeFieldProps = Parameters<typeof useFormTimeRangeFieldProvider>[number];
|
|
5
5
|
type PropsType = Pick<ReturnType<typeof useTimeRangeFormats>, 'formatValueItemToTimeInput'> & Pick<UseFormDateRangeFieldProps, 'value'>;
|
|
6
6
|
export declare function useTimeRangeDraft(props: PropsType): {
|
|
7
|
-
fromTimeValue:
|
|
8
|
-
toTimeValue:
|
|
9
|
-
setFromTimeValue: import('react').Dispatch<import('react').SetStateAction<
|
|
10
|
-
setToTimeValue: import('react').Dispatch<import('react').SetStateAction<
|
|
11
|
-
getFromTimeValue: () =>
|
|
12
|
-
getToTimeValue: () =>
|
|
7
|
+
fromTimeValue: TimeInputValue;
|
|
8
|
+
toTimeValue: TimeInputValue;
|
|
9
|
+
setFromTimeValue: import('react').Dispatch<import('react').SetStateAction<TimeInputValue>>;
|
|
10
|
+
setToTimeValue: import('react').Dispatch<import('react').SetStateAction<TimeInputValue>>;
|
|
11
|
+
getFromTimeValue: () => TimeInputValue;
|
|
12
|
+
getToTimeValue: () => TimeInputValue;
|
|
13
13
|
clearTimeRangeValue: () => void;
|
|
14
|
-
isFullDateInput: (fromDate
|
|
14
|
+
isFullDateInput: (fromDate: TimeInputValue, toDate: TimeInputValue) => boolean;
|
|
15
15
|
isFullCurrentDateInput: () => boolean;
|
|
16
16
|
};
|
|
17
17
|
export {};
|
package/dist/types/src/ui/formFields/dates/FormTimeRangeField/hooks/useTimeRangeFormats.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { useFormTimeRangeFieldProvider, ValueItemType } from './useFormTimeRangeFieldProvider';
|
|
2
|
-
import {
|
|
2
|
+
import { TimeInputValue } from './useTimeRangeDraft';
|
|
3
|
+
type ParsedDate = Date | undefined;
|
|
3
4
|
type PropsType = Required<Pick<Parameters<typeof useFormTimeRangeFieldProvider>[number], 'outFormat' | 'inputTimeFormat'>>;
|
|
4
5
|
export declare function useTimeRangeFormats(props: PropsType): {
|
|
5
|
-
formatTimeInputToValue: (instance:
|
|
6
|
-
formatValueItemToTimeInput: (instance
|
|
7
|
-
|
|
8
|
-
parseTimeValue: (instance
|
|
6
|
+
formatTimeInputToValue: (instance: TimeInputValue) => ValueItemType | undefined;
|
|
7
|
+
formatValueItemToTimeInput: (instance: ValueItemType) => TimeInputValue;
|
|
8
|
+
parseTimeInputValue: (instance: TimeInputValue) => ParsedDate;
|
|
9
|
+
parseTimeValue: (instance: ValueItemType) => ParsedDate;
|
|
9
10
|
};
|
|
10
11
|
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { DateArg } from 'date-fns';
|
|
2
|
+
export declare function safeParse(str: string, fmt: string, ref: Date): Date | undefined;
|
|
3
|
+
export declare function safeParseISO(str: string): Date | undefined;
|
|
4
|
+
export declare function safeFormat(date: DateArg<Date>, fmt: string): string | undefined;
|
|
5
|
+
export declare function safeFormatISO(date: DateArg<Date>): string | undefined;
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"react-components",
|
|
12
12
|
"ui-kit"
|
|
13
13
|
],
|
|
14
|
-
"version": "1.1.
|
|
14
|
+
"version": "1.1.10",
|
|
15
15
|
"exports": {
|
|
16
16
|
".": {
|
|
17
17
|
"types": "./dist/types/index.d.ts",
|
|
@@ -50,9 +50,11 @@
|
|
|
50
50
|
"@types/react-dom": ">=18.0.0",
|
|
51
51
|
"@vitejs/plugin-react": "^5.1.2",
|
|
52
52
|
"ajv": "^8.17.1",
|
|
53
|
+
"baseline-browser-mapping": "^2.10.9",
|
|
53
54
|
"clsx": "^2.1.1",
|
|
54
55
|
"date-fns": "^4.1.0",
|
|
55
56
|
"date-fns-tz": "^3.2.0",
|
|
57
|
+
"gl-matrix": "^3.4.4",
|
|
56
58
|
"gsap": "^3.13.0",
|
|
57
59
|
"jest": "^29.7.0",
|
|
58
60
|
"mathjs": "^14.5.3",
|
|
@@ -66,17 +68,15 @@
|
|
|
66
68
|
"tsc-alias": "^1.8.10",
|
|
67
69
|
"tslib": "^2.8.1",
|
|
68
70
|
"typescript": "^5.9.3",
|
|
71
|
+
"uuid": "^13.0.0",
|
|
69
72
|
"vite": "^7.2.7",
|
|
70
73
|
"vite-plugin-dts": "^4.5.4",
|
|
71
74
|
"vite-plugin-static-copy": "^3.1.4",
|
|
72
75
|
"vite-plugin-svgr": "^4.5.0",
|
|
73
|
-
"vite-plugin-virtual-html": "^1.2.7"
|
|
74
|
-
"gl-matrix": "^3.4.4",
|
|
75
|
-
"uuid": "^13.0.0"
|
|
76
|
+
"vite-plugin-virtual-html": "^1.2.7"
|
|
76
77
|
},
|
|
77
78
|
"peerDependencies": {
|
|
78
79
|
"react": ">=18.0.0",
|
|
79
80
|
"react-dom": ">=18.0.0"
|
|
80
|
-
}
|
|
81
|
-
"dependencies": {}
|
|
81
|
+
}
|
|
82
82
|
}
|