tdesign-react
Version:
TDesign Component for React
113 lines (112 loc) • 4.57 kB
TypeScript
import React from 'react';
import { RangeInputRefInterface } from '../../range-input';
import { TdDateRangePickerProps } from '../type';
import type { TdPopupProps } from '../../popup/type';
export declare const PARTIAL_MAP: {
first: string;
second: string;
};
export default function useRange(props: TdDateRangePickerProps): {
year: number[];
month: number[];
value: import("../type").DateRangeValue;
time: string[];
inputValue: any;
popupVisible: boolean;
rangeInputProps: {
ref: React.MutableRefObject<RangeInputRefInterface>;
borderless: boolean;
size: import("../../common").SizeEnum;
separator: string;
clearable: boolean;
prefixIcon: React.ReactElement<any, string | React.JSXElementConstructor<any>>;
readonly: boolean;
placeholder: any;
activeIndex: number;
suffixIcon: React.JSX.Element;
label: React.ReactNode;
className: string;
onClick: ({ position }: {
position: any;
}) => void;
onClear: ({ e }: {
e: any;
}) => void;
onBlur: (newVal: string[], { e, position }: {
e: any;
position: any;
}) => void;
onFocus: (newVal: string[], { e, position }: {
e: any;
position: any;
}) => void;
onChange: (newVal: string[], { e, position }: {
e: any;
position: any;
}) => void;
onEnter: (newVal: string[]) => void;
disabled?: boolean;
format?: import("../..").InputFormatType | Array<import("../..").InputFormatType>;
inputProps?: import("../..").InputProps | Array<import("../..").InputProps>;
showClearIconOnEmpty?: boolean;
status?: "default" | "success" | "warning" | "error";
suffix?: import("../../common").TNode;
tips?: import("../../common").TNode;
value?: import("../../range-input").RangeInputValue;
defaultValue?: import("../../range-input").RangeInputValue;
onMouseenter?: (context: {
e: React.MouseEvent<HTMLDivElement>;
}) => void;
onMouseleave?: (context: {
e: React.MouseEvent<HTMLDivElement>;
}) => void;
style?: React.CSSProperties;
};
popupProps: {
trigger: TdPopupProps["trigger"];
overlayInnerStyle: React.CSSProperties | ((triggerElement: HTMLElement, popupElement: HTMLElement) => import("../../common").Styles);
overlayClassName: string;
onVisibleChange: (visible: boolean, context: any) => void;
expandAnimation: boolean;
updateScrollTop?: (content: HTMLDivElement) => void;
attach?: import("../../common").AttachNode;
children?: import("../../common").TNode;
content?: import("../../common").TNode;
delay?: number | Array<number>;
destroyOnClose?: boolean;
disabled?: boolean;
hideEmptyPopup?: boolean;
overlayInnerClassName?: import("../../common").ClassName;
overlayStyle?: import("../../common").Styles | ((triggerElement: HTMLElement, popupElement: HTMLElement) => import("../../common").Styles);
placement?: import("../../popup/type").PopupPlacement;
popperOptions?: object;
showArrow?: boolean;
triggerElement?: import("../../common").TNode;
visible?: boolean;
defaultVisible?: boolean;
zIndex?: number;
onScroll?: (context: {
e: React.WheelEvent<HTMLDivElement>;
}) => void;
onScrollToBottom?: (context: {
e: React.WheelEvent<HTMLDivElement>;
}) => void;
};
isHoverCell: boolean;
onChange: import("../../hooks/useControlled").ChangeHandler<import("../type").DateRangeValue, [context: {
dayjsValue?: import("dayjs").Dayjs[];
trigger?: import("../type").DatePickerTriggerSource;
}]>;
setYear: React.Dispatch<React.SetStateAction<number[]>>;
setMonth: React.Dispatch<React.SetStateAction<number[]>>;
setTime: React.Dispatch<React.SetStateAction<string[]>>;
setIsHoverCell: React.Dispatch<React.SetStateAction<boolean>>;
setInputValue: React.Dispatch<any>;
setPopupVisible: React.Dispatch<React.SetStateAction<boolean>>;
activeIndex: number;
setActiveIndex: React.Dispatch<React.SetStateAction<number>>;
isFirstValueSelected: boolean;
setIsFirstValueSelected: React.Dispatch<React.SetStateAction<boolean>>;
cacheValue: any;
setCacheValue: React.Dispatch<any>;
};