@up42/up-components 5.16.0-date-pickers.0 → 5.16.0
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/cjs/index.js +2 -2
- package/dist/cjs/types/components/FormDatePickers/FormDatePicker/FormDatePicker.d.ts +2 -2
- package/dist/cjs/types/components/FormDatePickers/FormDateRangePicker/FormDateRangePicker.d.ts +19 -31
- package/dist/cjs/types/components/FormDatePickers/FormDateRangePickerList/FormDateRangePickerList.d.ts +22 -3
- package/dist/cjs/types/index.d.ts +3 -3
- package/dist/cjs/types/utils/hooks/useCursorPagination.d.ts +4 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/types/components/FormDatePickers/FormDatePicker/FormDatePicker.d.ts +2 -2
- package/dist/esm/types/components/FormDatePickers/FormDateRangePicker/FormDateRangePicker.d.ts +19 -31
- package/dist/esm/types/components/FormDatePickers/FormDateRangePickerList/FormDateRangePickerList.d.ts +22 -3
- package/dist/esm/types/index.d.ts +3 -3
- package/dist/esm/types/utils/hooks/useCursorPagination.d.ts +4 -1
- package/dist/index.d.ts +39 -30
- package/package.json +1 -1
|
@@ -2,8 +2,8 @@ import { DatePickerProps as MuiDatePickerProps } from '@mui/x-date-pickers-pro';
|
|
|
2
2
|
import { Dayjs } from 'dayjs';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { type DatePickerWrapperProps } from '../FormDatePickerWrapper';
|
|
5
|
-
export type
|
|
6
|
-
type NonGenericMuiDatePickerProps = MuiDatePickerProps<
|
|
5
|
+
export type DatePickerDateType = Dayjs | null | undefined;
|
|
6
|
+
type NonGenericMuiDatePickerProps = MuiDatePickerProps<DatePickerDateType>;
|
|
7
7
|
export type FormDatePickerProps = NonGenericMuiDatePickerProps & DatePickerWrapperProps;
|
|
8
8
|
export declare const FormDatePicker: React.ForwardRefExoticComponent<NonGenericMuiDatePickerProps & DatePickerWrapperProps & React.RefAttributes<HTMLDivElement>>;
|
|
9
9
|
export {};
|
package/dist/cjs/types/components/FormDatePickers/FormDateRangePicker/FormDateRangePicker.d.ts
CHANGED
|
@@ -1,35 +1,23 @@
|
|
|
1
|
+
import { DatePickerProps as MuiDatePickerProps } from '@mui/x-date-pickers-pro';
|
|
1
2
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
export type
|
|
6
|
-
start:
|
|
7
|
-
|
|
3
|
+
import type { MUIGlobalOmit } from '@global/utils/types';
|
|
4
|
+
import { DatePickerDateType, FormDatePickerProps } from '../FormDatePicker/FormDatePicker';
|
|
5
|
+
type NonGenericMuiDatePickerProps = MuiDatePickerProps<DatePickerDateType>;
|
|
6
|
+
export type FormDateRangePickerProps = Omit<MUIGlobalOmit<NonGenericMuiDatePickerProps>, 'value' | 'onChange'> & {
|
|
7
|
+
start: DatePickerDateType;
|
|
8
|
+
onStartChange: (date: DatePickerDateType) => void;
|
|
9
|
+
end: DatePickerDateType;
|
|
10
|
+
onEndChange: (date: DatePickerDateType) => void;
|
|
11
|
+
label?: string;
|
|
12
|
+
startPickerProps?: {
|
|
13
|
+
slotProps: FormDatePickerProps['slotProps'];
|
|
14
|
+
};
|
|
15
|
+
endPickerProps?: {
|
|
16
|
+
slotProps: FormDatePickerProps['slotProps'];
|
|
17
|
+
};
|
|
8
18
|
};
|
|
9
|
-
export declare const DEFAULT_FORMAT = "YYYY\u2013MM\u2013DD";
|
|
10
|
-
export type FormDateRangePickerProps = {
|
|
11
|
-
startLabel?: string;
|
|
12
|
-
startPlaceholder?: string;
|
|
13
|
-
endLabel?: string;
|
|
14
|
-
endPlaceholder?: string;
|
|
15
|
-
value: DateRange | null;
|
|
16
|
-
onChange?: (value: DateRange | null) => void;
|
|
17
|
-
disabled?: boolean;
|
|
18
|
-
/**
|
|
19
|
-
* Defines whether or not the user can input values and navigate in the calendars using the keyboard.
|
|
20
|
-
*/
|
|
21
|
-
allowKeyboard?: boolean;
|
|
22
|
-
/**
|
|
23
|
-
* Defines the minimum number of days after the "start date" that the "end date" can be selected.
|
|
24
|
-
*/
|
|
25
|
-
minEndDateOffset?: number;
|
|
26
|
-
/**
|
|
27
|
-
* Defines the maximum number of days after the "start date" that the "end date" can be selected.
|
|
28
|
-
*/
|
|
29
|
-
maxEndDateOffset?: number;
|
|
30
|
-
} & DatePickerWrapperProps & Omit<DateRangePickerProps<FormDatePickerDateType | Date>, 'value' | 'onChange'>;
|
|
31
19
|
/**
|
|
32
|
-
*
|
|
33
|
-
* Documentation: https://up-components.up42.com/?path=/docs-patterns-form-formdaterangepicker--docs
|
|
20
|
+
* Documentation: https://up-components.up42.com/?path=/docs/patterns-form-formdaterangepicker--docs
|
|
34
21
|
*/
|
|
35
|
-
export declare const FormDateRangePicker: ({
|
|
22
|
+
export declare const FormDateRangePicker: ({ start, onStartChange, end, onEndChange, label, minDate, maxDate, startPickerProps, endPickerProps, ...props }: FormDateRangePickerProps) => React.JSX.Element;
|
|
23
|
+
export {};
|
|
@@ -1,17 +1,36 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { DateRangePickerProps } from '@mui/x-date-pickers-pro/DateRangePicker';
|
|
2
3
|
import { type DatePickerWrapperProps } from '../FormDatePickerWrapper';
|
|
3
|
-
import {
|
|
4
|
+
import { DatePickerDateType } from '../FormDatePicker/FormDatePicker';
|
|
5
|
+
export type DateRange = {
|
|
6
|
+
start: DatePickerDateType | Date;
|
|
7
|
+
end: DatePickerDateType | Date;
|
|
8
|
+
};
|
|
4
9
|
export type FormDateRangePickerListProps = {
|
|
10
|
+
startLabel?: string;
|
|
11
|
+
endLabel?: string;
|
|
5
12
|
value: DateRange[];
|
|
6
13
|
onChange?: (value: DateRange[]) => void;
|
|
7
14
|
disabled?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Defines whether or not the user can input values and navigate in the calendars using the keyboard.
|
|
17
|
+
*/
|
|
18
|
+
allowKeyboard?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Defines the minimum number of days after the "start date" that the "end date" can be selected.
|
|
21
|
+
*/
|
|
22
|
+
minEndDateOffset?: number;
|
|
23
|
+
/**
|
|
24
|
+
* Defines the maximum number of days after the "start date" that the "end date" can be selected.
|
|
25
|
+
*/
|
|
26
|
+
maxEndDateOffset?: number;
|
|
8
27
|
/**
|
|
9
28
|
* Defines the text to display in the action button to add a new Date Range.
|
|
10
29
|
* It defaults to "Add new date".
|
|
11
30
|
*/
|
|
12
31
|
addButtonText?: string;
|
|
13
|
-
} & DatePickerWrapperProps & Omit<
|
|
32
|
+
} & DatePickerWrapperProps & Omit<DateRangePickerProps<DatePickerDateType | Date>, 'value' | 'onChange'>;
|
|
14
33
|
/**
|
|
15
34
|
* Documentation: https://up-components.up42.com/?path=/docs/patterns-form-formdaterangepickerlist--docs
|
|
16
35
|
*/
|
|
17
|
-
export declare const FormDateRangePickerList: ({ value, onChange, label, helperText, error, disabled, addButtonText, ...props }: FormDateRangePickerListProps) => React.JSX.Element;
|
|
36
|
+
export declare const FormDateRangePickerList: ({ value, onChange, label, helperText, error, startLabel, endLabel, disabled, minEndDateOffset, maxEndDateOffset, allowKeyboard, addButtonText, ...props }: FormDateRangePickerListProps) => React.JSX.Element;
|
|
@@ -10,10 +10,10 @@ export { GridContainer, type GridContainerProps, GridItem, type GridItemProps }
|
|
|
10
10
|
export { PageContainer, type PageContainerProps } from './components/PageContainer/PageContainer';
|
|
11
11
|
export { Checkbox, type CheckboxProps } from './components/Checkbox/Checkbox';
|
|
12
12
|
export { FormCheckbox, type FormCheckboxProps } from './components/FormCheckbox/FormCheckbox';
|
|
13
|
-
export { FormDatePicker, type FormDatePickerProps, type
|
|
14
|
-
export { FormDateRangePicker, type FormDateRangePickerProps,
|
|
13
|
+
export { FormDatePicker, type FormDatePickerProps, type DatePickerDateType, } from './components/FormDatePickers/FormDatePicker/FormDatePicker';
|
|
14
|
+
export { FormDateRangePicker, type FormDateRangePickerProps, } from './components/FormDatePickers/FormDateRangePicker/FormDateRangePicker';
|
|
15
15
|
export { FormDateTimePicker, type FormDateTimePickerProps, } from './components/FormDatePickers/FormDateTimePicker/FormDateTimePicker';
|
|
16
|
-
export { FormDateRangePickerList, type FormDateRangePickerListProps, } from './components/FormDatePickers/FormDateRangePickerList/FormDateRangePickerList';
|
|
16
|
+
export { FormDateRangePickerList, type FormDateRangePickerListProps, type DateRange, } from './components/FormDatePickers/FormDateRangePickerList/FormDateRangePickerList';
|
|
17
17
|
export { Radio, type RadioProps } from './components/Radio/Radio';
|
|
18
18
|
export { FormRadio, type FormRadioProps } from './components/FormRadio/FormRadio';
|
|
19
19
|
export { Switch, type SwitchProps } from './components/Switch/Switch';
|
|
@@ -3,6 +3,9 @@ export interface CursorPaginatedResponse<T> {
|
|
|
3
3
|
nextCursor: number | null;
|
|
4
4
|
prevCursor: number | null;
|
|
5
5
|
}
|
|
6
|
+
export interface UseCursorPaginationOptions {
|
|
7
|
+
defaultPageSize?: number;
|
|
8
|
+
}
|
|
6
9
|
type UseCursorPaginationResponse = {
|
|
7
10
|
pageSize: number;
|
|
8
11
|
page: number;
|
|
@@ -30,5 +33,5 @@ export declare const useCursorPagination: (fetchingHook: ({ params }: {
|
|
|
30
33
|
isRefetching: boolean;
|
|
31
34
|
}, searchParams?: {
|
|
32
35
|
[paramName: string]: string;
|
|
33
|
-
} | undefined) => UseCursorPaginationResponse;
|
|
36
|
+
} | undefined, options?: UseCursorPaginationOptions) => UseCursorPaginationResponse;
|
|
34
37
|
export {};
|