@televet/kibble-ui 1.14.0 → 1.14.1-beta.2f7t91q.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/build/components/Forms/DatePicker/components/Day/day.component.d.ts +7 -0
- package/build/components/Forms/DatePicker/components/Month/month.component.d.ts +9 -0
- package/build/components/Forms/DatePicker/datepicker.component.d.ts +13 -0
- package/build/components/Forms/DatePicker/datepicker.context.d.ts +20 -0
- package/build/components/Forms/DatePicker/index.d.ts +2 -0
- package/build/components/Forms/Select/select.component.d.ts +18 -10
- package/build/components/Forms/Select/select.types.d.ts +1 -0
- package/build/components/Forms/index.d.ts +1 -0
- package/build/index.js +3055 -17
- package/build/index.js.map +1 -1
- package/package.json +128 -127
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FirstDayOfWeek } from '@datepicker-react/hooks';
|
|
2
|
+
export interface MonthProps {
|
|
3
|
+
year: number;
|
|
4
|
+
month: number;
|
|
5
|
+
firstDayOfWeek: FirstDayOfWeek;
|
|
6
|
+
onDaySelected: () => void;
|
|
7
|
+
}
|
|
8
|
+
declare const Month: ({ year, month, firstDayOfWeek, onDaySelected }: MonthProps) => JSX.Element;
|
|
9
|
+
export default Month;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface DatePickerProps {
|
|
2
|
+
date: Date | null;
|
|
3
|
+
onDateChange?: (date: Date | null) => void;
|
|
4
|
+
dateFormat?: string;
|
|
5
|
+
inputIsReadonly?: boolean;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* A simple date picker component.
|
|
9
|
+
*
|
|
10
|
+
* Note: Be careful with dateFormat and allowing search (inputIsReadonly = false) as changing the format
|
|
11
|
+
* can cause exceptions to be thrown.
|
|
12
|
+
*/
|
|
13
|
+
export declare const BetaDatePicker: ({ date, onDateChange, dateFormat, inputIsReadonly, }: DatePickerProps) => JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface IDatePickerContext {
|
|
3
|
+
focusedDate: Date | null;
|
|
4
|
+
isDateFocused: (date: Date) => boolean;
|
|
5
|
+
isDateSelected: (date: Date) => boolean;
|
|
6
|
+
isDateHovered: (date: Date) => boolean;
|
|
7
|
+
isDateBlocked: (date: Date) => boolean;
|
|
8
|
+
isFirstOrLastSelectedDate: (date: Date) => boolean;
|
|
9
|
+
onDateFocus: (date: Date) => void;
|
|
10
|
+
onDateHover: (date: Date) => void;
|
|
11
|
+
onDateSelect: (date: Date) => void;
|
|
12
|
+
}
|
|
13
|
+
export declare const DatePickerContext: React.Context<IDatePickerContext>;
|
|
14
|
+
export declare const useDatePickerContext: () => IDatePickerContext;
|
|
15
|
+
interface IDatePickerProvider extends IDatePickerContext {
|
|
16
|
+
date?: Date;
|
|
17
|
+
children: React.ReactNode;
|
|
18
|
+
}
|
|
19
|
+
declare const DatePickerProvider: ({ date, children, ...rest }: IDatePickerProvider) => JSX.Element;
|
|
20
|
+
export default DatePickerProvider;
|
|
@@ -1,18 +1,26 @@
|
|
|
1
|
-
import React, { ReactNode } from 'react';
|
|
1
|
+
import React, { ReactNode, ChangeEvent } from 'react';
|
|
2
2
|
import { SelectProps as CSelectProps } from '@chakra-ui/react';
|
|
3
|
+
import { MenuListProps } from 'components/Overlay/Menu/components/MenuList/menuList.component';
|
|
3
4
|
import { WithFormControlProps } from '../FormControl/formControl.component';
|
|
4
5
|
import { SelectOptionProps } from 'components/Forms/Select/select.types';
|
|
5
|
-
export interface
|
|
6
|
-
|
|
6
|
+
export interface SelectListProps extends Omit<MenuListProps, 'canSelectAll' | 'canSelectGroups' | 'isMultiSelect' | 'onSelectAll' | 'menuItems' | 'shouldTruncateText'> {
|
|
7
|
+
onClose?: (selectedOption: (SelectOptionProps | undefined)[]) => void;
|
|
8
|
+
defaultLeftElement?: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
export interface SelectBaseProps extends WithFormControlProps, CSelectProps {
|
|
7
11
|
options: SelectOptionProps[];
|
|
8
|
-
listProps?: {
|
|
9
|
-
isGrouped?: boolean;
|
|
10
|
-
isSearchable?: boolean;
|
|
11
|
-
onSelect?: (selectedOption: SelectOptionProps) => void;
|
|
12
|
-
onClose?: (selectedOption: (SelectOptionProps | undefined)[]) => void;
|
|
13
|
-
defaultLeftElement?: ReactNode;
|
|
14
|
-
};
|
|
15
12
|
shouldTruncateText?: boolean;
|
|
16
13
|
}
|
|
14
|
+
export interface BrowserDefaultSelect extends SelectBaseProps {
|
|
15
|
+
useBrowserDefaultMenu?: boolean;
|
|
16
|
+
onChange: (e: ChangeEvent<HTMLSelectElement>) => void;
|
|
17
|
+
listProps?: never;
|
|
18
|
+
}
|
|
19
|
+
export interface CustomSelect extends SelectBaseProps {
|
|
20
|
+
useBrowserDefaultMenu?: never;
|
|
21
|
+
onChange?: never;
|
|
22
|
+
listProps?: SelectListProps;
|
|
23
|
+
}
|
|
24
|
+
export declare type SelectProps = BrowserDefaultSelect | CustomSelect;
|
|
17
25
|
declare const WrappedSelect: React.FC<SelectProps>;
|
|
18
26
|
export { WrappedSelect as Select };
|