gui-one-nutui-react-taro
Version:
京东风格的轻量级移动端 React 组件库,支持一套代码生成 H5 和小程序
1,680 lines (1,593 loc) • 60.9 kB
TypeScript
import React$1, { CSSProperties, ReactNode, FunctionComponent, ReactHTML, ReactElement, MouseEvent as MouseEvent$1, MouseEventHandler, ChangeEvent, FocusEvent, HTMLInputTypeAttribute, RefObject, ForwardRefExoticComponent, PropsWithChildren, Component } from 'react';
import { ButtonProps as ButtonProps$1 } from '@tarojs/components';
import Taro from '@tarojs/taro';
interface IComponent {
className?: string;
style?: CSSProperties;
iconFontClassName?: string;
iconClassPrefix?: string;
children?: ReactNode;
}
declare type OmitMiniProgramButtonProps = Omit<ButtonProps$1, 'size' | 'type' | 'onClick'>;
interface ButtonProps extends IComponent, OmitMiniProgramButtonProps {
className: string;
color: string;
shape: ButtonShape;
plain: boolean;
loading: boolean;
disabled: boolean;
style: React$1.CSSProperties;
type: ButtonType;
size: ButtonSize;
block: boolean;
icon: string;
children: any;
onClick: (e: MouseEvent) => void;
}
declare type ButtonType = 'default' | 'primary' | 'info' | 'success' | 'warning' | 'danger';
declare type ButtonSize = 'large' | 'normal' | 'small';
declare type ButtonShape = 'square' | 'round';
declare const Button: FunctionComponent<Partial<ButtonProps>>;
interface CellProps extends IComponent {
title: ReactNode;
subTitle: ReactNode;
desc: string;
descTextAlign: string;
isLink: boolean;
icon: string;
roundRadius: string | number;
url: string;
to: string;
replace: boolean;
center: boolean;
size: string;
className: string;
iconSlot: ReactNode;
linkSlot: ReactNode;
click: (event: React$1.MouseEvent<HTMLDivElement, MouseEvent>) => void;
onClick: (event: React$1.MouseEvent<HTMLDivElement, MouseEvent>) => void;
}
declare const Cell: FunctionComponent<Partial<CellProps> & Omit<React$1.HTMLAttributes<HTMLDivElement>, 'title'>>;
interface CellGroupProps {
title: ReactNode;
desc: ReactNode;
titleSlot: ReactNode;
descSlot: ReactNode;
className: string;
children?: ReactNode;
}
declare const CellGroup: FunctionComponent<Partial<CellGroupProps>>;
interface IconProps {
name: string;
size: string | number;
classPrefix: string;
color: string;
tag: keyof ReactHTML;
onClick: (e: MouseEvent) => void;
fontClassName: string;
className: string;
style: React$1.CSSProperties;
children: React$1.ReactNode;
}
declare function Icon<T>(props: Partial<IconProps> & T): ReactElement;
declare namespace Icon {
var defaultProps: IconProps;
var displayName: string;
}
interface OverlayProps {
zIndex: number;
duration: number;
overlayClass: string;
overlayStyle: React$1.CSSProperties;
closeOnClickOverlay: boolean;
visible: boolean;
lockScroll: boolean;
}
declare const Overlay: FunctionComponent<Partial<OverlayProps> & React$1.HTMLAttributes<HTMLDivElement>>;
declare type Teleport = HTMLElement | (() => HTMLElement) | null;
interface PopupProps extends OverlayProps, IComponent {
position: string;
transition: string;
style: React$1.CSSProperties;
popClass: string;
closeable: boolean;
closeIconPosition: string;
closeIcon: string;
destroyOnClose: boolean;
teleport: Teleport;
overlay: boolean;
round: boolean;
onOpen: () => void;
onClose: () => void;
onClick: (e: MouseEvent$1) => void;
onOpened: (e: HTMLElement) => void;
onClosed: (e: HTMLElement) => void;
onClickOverlay: (e: MouseEvent$1) => void;
onClickCloseIcon: (e: MouseEvent$1) => void;
}
declare const Popup: FunctionComponent<Partial<PopupProps> & React$1.HTMLAttributes<HTMLDivElement>>;
interface BaseLang {
save: string;
confirm: string;
cancel: string;
done: string;
noData: string;
placeholder: string;
select: string;
video: {
errorTip: string;
clickRetry: string;
};
fixednav: {
activeText: string;
unActiveText: string;
};
infiniteloading: {
pullRefreshText: string;
loadText: string;
loadMoreText: string;
};
pagination: {
prev: string;
next: string;
};
range: {
rangeText: string;
};
calendaritem: {
weekdays: Array<string>;
end: string;
start: string;
title: string;
monthTitle: Function;
today: string;
loadPreviousMonth: string;
noEarlierMonth: string;
};
shortpassword: {
title: string;
desc: string;
tips: string;
};
uploader: {
ready: string;
readyUpload: string;
waitingUpload: string;
uploading: string;
success: string;
error: string;
deleteWord: string;
};
countdown: {
day: string;
hour: string;
minute: string;
second: string;
};
address: {
selectRegion: string;
deliveryTo: string;
chooseAnotherAddress: string;
};
signature: {
reSign: string;
unSupportTpl: string;
};
ecard: {
chooseText: string;
otherValueText: string;
placeholder: string;
};
timeselect: {
pickupTime: string;
};
sku: {
buyNow: string;
buyNumber: string;
addToCard: string;
};
skuheader: {
skuId: string;
};
addresslist: {
addAddress: string;
};
comment: {
complaintsText: string;
additionalReview: Function;
additionalImages: Function;
};
searchbar: {
basePlaceholder: string;
text: string;
test: string;
title1: string;
title2: string;
title3: string;
title4: string;
title5: string;
title6: string;
};
audio: {
back: string;
forward: string;
pause: string;
start: string;
mute: string;
tips: string;
};
datepicker: {
year: string;
month: string;
day: string;
hour: string;
min: string;
seconds: string;
};
pullToRefresh: {
pullingText: string;
canReleaseText: string;
refreshingText: string;
completeText: string;
};
}
interface ConfigProviderProps {
locale: BaseLang;
}
declare const ConfigProvider: FunctionComponent<Partial<ConfigProviderProps> & React$1.HTMLAttributes<HTMLDivElement>>;
interface LayoutProps {
}
declare const Layout: FunctionComponent<Partial<LayoutProps> & React$1.HTMLAttributes<HTMLDivElement>>;
declare type EventType$1 = 'row' | 'col';
interface ColProps {
span: string | number;
offset: string | number;
gutter: string | number;
onClick: (e: any, type: EventType$1) => void;
}
declare const Col: FunctionComponent<Partial<ColProps> & Omit<React$1.HTMLAttributes<HTMLDivElement>, 'onClick'>>;
declare type EventType = 'row' | 'col';
interface RowProps {
type: string;
justify: string;
align: string;
wrap: string;
gutter: string | number;
onClick: (e: any, type: EventType) => void;
}
declare const Row: FunctionComponent<Partial<RowProps> & Omit<React$1.HTMLAttributes<HTMLDivElement>, 'onClick'>>;
declare type ContentPositionType = 'left' | 'center' | 'right';
declare type DirectionType = 'horizontal' | 'vertical';
interface DividerProps {
contentPosition: ContentPositionType;
dashed: boolean;
hairline: boolean;
styles?: React$1.CSSProperties;
className?: string;
direction?: DirectionType;
}
declare const Divider: FunctionComponent<Partial<DividerProps> & React$1.HTMLAttributes<HTMLDivElement>>;
declare type GridDirection$1 = 'horizontal' | 'vertical';
interface GridProps {
columnNum: string | number;
border: boolean;
gutter: string | number;
center: boolean;
square: boolean;
reverse: boolean;
direction: GridDirection$1;
className?: string;
iconSize?: string | number;
iconColor?: string;
style?: CSSProperties;
}
declare const Grid: FunctionComponent<Partial<GridProps> & React$1.HTMLAttributes<HTMLDivElement>>;
declare type GridDirection = 'horizontal' | 'vertical';
interface GridItemProps extends IComponent {
text: string | ReactNode;
icon: string | ReactNode;
iconSize?: string | number;
iconColor?: string;
parentIconSize?: string | number;
parentIconColor?: string;
index: number;
columnNum: string | number;
border: boolean;
gutter: string | number;
center: boolean;
square: boolean;
reverse: boolean;
direction: GridDirection;
}
declare const GridItem: FunctionComponent<Partial<GridItemProps> & React$1.HTMLAttributes<HTMLDivElement>>;
interface StickyProps {
}
declare const Sticky: FunctionComponent<Partial<StickyProps> & React$1.HTMLAttributes<HTMLDivElement>>;
interface NavBarProps$1 extends IComponent {
leftShow: boolean;
title: string;
titIcon: string;
leftText: string;
desc: string;
className: string;
fixed: boolean;
safeAreaInsetTop: boolean;
border: boolean;
placeholder: boolean;
zIndex: number | string;
style: React$1.CSSProperties;
onClickTitle: (e: React$1.MouseEvent<HTMLDivElement>) => void;
onClickIcon: (e: React$1.MouseEvent<HTMLDivElement>) => void;
onClickBack: (e: React$1.MouseEvent<HTMLElement>) => void;
onClickRight: (e: React$1.MouseEvent<HTMLDivElement>) => void;
children?: React$1.ReactNode;
}
declare const NavBar: FunctionComponent<Partial<NavBarProps$1>>;
declare type Direction$1 = 'right' | 'left';
declare type Position$2 = {
top?: string;
bottom?: string;
};
interface FixedNavProps extends IComponent {
fixednavClass: string;
visible: boolean;
overlay: boolean;
navList: Array<any>;
activeText: string;
unActiveText: string;
position: Position$2;
type: Direction$1;
onChange: (v: any) => void;
onSelected: (item: any, e: any) => void;
slotList: React$1.ReactNode;
slotBtn: React$1.ReactNode;
}
declare const FixedNav: FunctionComponent<Partial<FixedNavProps> & React$1.HTMLAttributes<HTMLDivElement>>;
interface TabbarProps {
visible: number | string;
bottom: boolean;
size: string | number;
unactiveColor: string;
activeColor: string;
safeAreaInsetBottom: boolean;
className: string;
style: React$1.CSSProperties;
tabSwitch: (child: React$1.ReactElement<any>, active: number) => void;
onSwitch: (child: React$1.ReactElement<any>, active: number) => void;
children?: React$1.ReactNode;
}
declare const Tabbar: FunctionComponent<Partial<TabbarProps>>;
interface TabbarItemProps extends IComponent {
dot: boolean;
size: string | number;
className: string;
tabTitle: string;
icon: string;
href: string;
to: any;
num: string | number;
active: boolean;
activeColor: string;
unactiveColor: string;
index: number;
handleClick: (idx: number) => void;
}
declare const TabbarItem: FunctionComponent<Partial<TabbarItemProps>>;
interface ElevatorProps {
height: number | string;
acceptKey: string;
indexList: any[];
isSticky: boolean;
spaceHeight: number;
titleHeight: number;
className: string;
style: React$1.CSSProperties;
children: React$1.ReactNode;
onClickItem: (key: string, item: ElevatorData) => void;
onClickIndex: (key: string) => void;
}
interface ElevatorData {
name: string;
id: number | string;
[key: string]: string | number;
}
declare const Elevator: FunctionComponent<Partial<ElevatorProps> & React$1.HTMLAttributes<HTMLDivElement>>;
interface PaginationProps {
defaultValue: number;
modelValue: number;
mode: 'multi' | 'simple';
prevText?: React$1.ReactNode;
nextText?: React$1.ReactNode;
pageCount: string | number;
totalItems: string | number;
itemsPerPage: string | number;
showPageSize: string | number;
forceEllipses: boolean;
pageNodeRender: (page: any) => React$1.ReactNode;
onChange: (currPage: number) => void;
updatecurrent: (currPage: number) => void;
style?: React$1.CSSProperties;
className?: string;
}
declare const Pagination: FunctionComponent<Partial<PaginationProps> & Omit<React$1.HTMLAttributes<HTMLDivElement>, 'onChange'>>;
declare class Title {
title: string;
paneKey: string;
disabled: boolean;
index: number;
constructor();
}
declare type TabsSize = 'large' | 'normal' | 'small';
interface TabsProps extends IComponent {
className: string;
style: React$1.CSSProperties;
tabStyle: React$1.CSSProperties;
value: string | number;
color: string;
background: string;
direction: string;
type: string;
titleScroll: boolean;
ellipsis: boolean;
animatedTime: number | string;
titleGutter: number | string;
size: TabsSize;
titleNode: () => JSX.Element[];
onChange: (t: Title) => void;
onClick: (t: Title) => void;
autoHeight: boolean;
children?: React$1.ReactNode;
}
declare const Tabs: FunctionComponent<Partial<TabsProps>>;
interface TabPanelInnerProps {
autoHeightClassName: string;
}
interface TabPaneProps {
title: string | number;
paneKey: string | number;
activeKey: string | number;
disabled: boolean;
autoHeightClassName: string;
className: string;
children?: React$1.ReactNode;
}
declare const TabPane: FunctionComponent<Partial<TabPaneProps & TabPanelInnerProps>>;
interface IndicatorProps {
size: number;
current: number;
block: boolean;
align: 'left' | 'right' | 'center';
fillZero: boolean;
vertical: boolean;
}
declare const Indicator: FunctionComponent<Partial<IndicatorProps> & React$1.HTMLAttributes<HTMLDivElement>>;
declare type NavBarProps = {
showhead?: boolean;
};
interface SideNavBarProps extends React$1.HTMLAttributes<HTMLDivElement>, NavBarProps {
title: string;
visible: boolean;
width?: string;
offset?: number;
position?: 'left' | 'right';
onClose: () => void;
children?: React$1.ReactNode;
}
declare const SideNavBar: FunctionComponent<SideNavBarProps>;
declare type SubSideNavBarProps = {
title: string;
ikey: string | number;
open?: boolean;
children?: React$1.ReactNode;
onClick?: ({ title, ikey, isShow, }: {
title: string;
ikey: string | number;
isShow: boolean;
}) => void;
};
declare const SubSideNavBar: FunctionComponent<SubSideNavBarProps>;
declare type SideNavBarItemProps = {
title: string;
ikey: string | number;
onClick?: ({ title, ikey }: {
title: string;
ikey: string | number;
}) => void;
children?: React$1.ReactNode;
};
declare const SideNavBarItem: FunctionComponent<SideNavBarItemProps>;
interface MenuProps extends IComponent {
className: string;
style: React$1.CSSProperties;
activeColor: string;
closeOnClickOverlay: boolean;
scrollFixed: boolean | string | number;
lockScroll: boolean;
titleIcon: string;
children: React$1.ReactNode;
}
declare const Menu: FunctionComponent<Partial<MenuProps>>;
interface OptionItem {
text: string;
value: string | number;
}
interface MenuItemProps extends IComponent {
className: string;
style: React$1.CSSProperties;
title: React$1.ReactNode;
options: OptionItem[];
disabled: boolean;
columns: number;
optionsIcon: string;
direction: string;
activeTitleClass: string;
inactiveTitleClass: string;
fontClassName: string;
iconClassPrefix: string;
value: string | number;
onChange: (event: any) => void;
children: React$1.ReactNode;
}
declare const MenuItem: React$1.ForwardRefExoticComponent<Partial<MenuItemProps> & React$1.RefAttributes<unknown>>;
declare type SliderValue = number | number[];
interface RangeProps {
className: string;
style: CSSProperties;
range: boolean;
disabled: boolean;
activeColor: string;
inactiveColor: string;
buttonColor: string;
hiddenRange: boolean;
hiddenTag: boolean;
min: number | string;
max: number | string;
step: number | string;
modelValue: SliderValue;
button: React$1.ReactNode;
vertical: boolean;
marks: Record<string, unknown>;
change?: (value: number) => void;
dragStart?: () => void;
dragEnd?: () => void;
onChange?: (value: number) => void;
onDragStart?: () => void;
onDragEnd?: () => void;
}
declare const Range: FunctionComponent<Partial<RangeProps> & Omit<React$1.HTMLAttributes<HTMLDivElement>, 'onClick' | 'onChange'>>;
interface CalendarProps {
type?: string;
isAutoBackFill?: boolean;
poppable?: boolean;
visible?: boolean;
title?: string;
defaultValue?: string | string[];
startDate?: string;
endDate?: string;
onClose?: () => void;
onChoose?: (param: string) => void;
}
declare const Calendar: FunctionComponent<Partial<CalendarProps> & React$1.HTMLAttributes<HTMLDivElement>>;
interface RadioGroupOptionType {
label: string;
value: string;
disabled?: boolean;
onChange?: MouseEventHandler<HTMLDivElement>;
}
interface CheckboxGroupProps {
disabled: boolean;
checkedValue: string[];
max: number | undefined;
onChange: (value: string[]) => void;
options: RadioGroupOptionType[];
}
declare const CheckboxGroup: React$1.ForwardRefExoticComponent<Partial<CheckboxGroupProps> & Omit<React$1.HTMLAttributes<HTMLDivElement>, "onChange"> & React$1.RefAttributes<unknown>>;
interface InheritParentProps {
getParentVals?: () => string[] | undefined;
max?: number | undefined;
}
interface CheckboxProps extends IComponent {
checked: boolean;
disabled: boolean;
textPosition: 'left' | 'right';
iconSize: string | number;
iconName: string;
iconActiveName: string;
iconIndeterminateName: string;
iconClassPrefix: string;
iconFontClassName: string;
indeterminate: boolean;
label: string;
onChange: (state: boolean, label: string) => void;
}
declare const Checkbox: FunctionComponent<Partial<CheckboxProps> & Omit<React$1.HTMLAttributes<HTMLDivElement>, 'onChange'> & InheritParentProps> & {
Group: typeof CheckboxGroup;
};
interface PickerOption$1 {
text: string | number;
value: string | number;
disabled?: string;
children?: PickerOption$1[];
className?: string | number;
}
interface DatePickerProps {
modelValue: Date | null;
visible: boolean;
title: string;
type: 'date' | 'time' | 'year-month' | 'month-day' | 'datehour' | 'datetime';
isShowChinese: boolean;
minuteStep: number;
minDate: Date;
maxDate: Date;
threeDimensional: boolean;
className?: string;
style?: React$1.CSSProperties;
formatter: (type: string, option: PickerOption$1) => PickerOption$1;
filter: (type: string, option: PickerOption$1[]) => PickerOption$1[];
onCloseDatePicker: () => void;
onConfirmDatePicker: (values: (string | number)[], options: PickerOption$1[]) => void;
onChange: (columnIndex: string | number, values: (string | number)[], options: PickerOption$1[]) => void;
}
declare const DatePicker: FunctionComponent<Partial<DatePickerProps> & Omit<React$1.HTMLAttributes<HTMLDivElement>, 'onChange'>>;
interface InputNumberProps extends IComponent {
disabled: boolean;
buttonSize: string | number;
min: string | number;
max: string | number;
inputWidth: string | number;
readonly: boolean;
modelValue: string | number;
step: string | number;
decimalPlaces: string | number;
isAsync: boolean;
className: string;
style: React$1.CSSProperties;
add: (e: MouseEvent) => void;
reduce: (e: MouseEvent) => void;
overlimit: (e: MouseEvent) => void;
blur: (e: ChangeEvent<HTMLInputElement>) => void;
focus: (e: FocusEvent<HTMLInputElement>) => void;
change: (param: string | number, e: MouseEvent | ChangeEvent<HTMLInputElement>) => void;
onAdd: (e: MouseEvent) => void;
onReduce: (e: MouseEvent) => void;
onOverlimit: (e: MouseEvent) => void;
onBlurFuc: (e: ChangeEvent<HTMLInputElement>) => void;
onFocus: (e: FocusEvent<HTMLInputElement>) => void;
onChangeFuc: (param: string | number, e: MouseEvent | ChangeEvent<HTMLInputElement>) => void;
}
declare const InputNumber: FunctionComponent<Partial<InputNumberProps> & React$1.HTMLAttributes<HTMLDivElement>>;
declare type InputAlignType = 'left' | 'center' | 'right';
declare type InputFormatTrigger = 'onChange' | 'onBlur';
declare type InputType = HTMLInputTypeAttribute;
declare type InputRule = {
pattern?: RegExp;
message?: string;
required?: boolean;
};
interface InputProps extends IComponent {
type: InputType;
name: string;
defaultValue: any;
placeholder: string;
label: string;
labelClass: string;
labelWidth: string | number;
labelAlign: InputAlignType;
colon: boolean;
inputAlign: InputAlignType;
center: boolean;
required: boolean;
disabled: boolean;
readonly: boolean;
error: boolean;
maxlength: any;
leftIcon: string;
leftIconSize: string | number;
rightIcon: string;
rightIconSize: string | number;
clearable: boolean;
clearIcon: string;
clearSize: string | number;
border: boolean;
formatTrigger: InputFormatTrigger;
rules: Array<InputRule>;
errorMessage: string;
errorMessageAlign: InputAlignType;
rows: string | number;
showWordLimit: boolean;
autofocus: boolean;
style?: CSSProperties;
className?: string;
slotButton?: React$1.ReactNode;
slotInput?: React$1.ReactNode;
formatter: (value: string) => void;
onChange?: (value: any, event: Event) => void;
onBlur?: (value: any, event: Event) => void;
onFocus?: (value: any, event: Event) => void;
onClear?: (value: any, event: Event) => void;
keypress?: (value: any, event: Event) => void;
onClickInput?: (value: any) => void;
onClickLeftIcon?: (value: any) => void;
onClickRightIcon?: (value: any) => void;
onClick?: (value: any) => void;
change?: (value: any, event: Event) => void;
blur?: (value: any, event: Event) => void;
focus?: (value: any, event: Event) => void;
clear?: (value: any, event: Event) => void;
clickInput?: (value: any) => void;
clickLeftIcon?: (value: any) => void;
clickRightIcon?: (value: any) => void;
click?: (value: any) => void;
}
declare const Input: FunctionComponent<Partial<InputProps> & Omit<React$1.HTMLAttributes<HTMLDivElement>, 'onChange' | 'onBlur' | 'onFocus' | 'onClick'>>;
declare type Position$1 = 'left' | 'right';
declare type Direction = 'horizontal' | 'vertical';
interface RadioGroupProps {
value: string | number | boolean | null;
textPosition: Position$1;
direction: Direction;
onChange: (value: string | number | boolean) => void;
options: RadioGroupOptionType[];
}
declare const RadioGroup: React$1.ForwardRefExoticComponent<Partial<RadioGroupProps> & Omit<React$1.HTMLAttributes<HTMLDivElement>, "onChange"> & React$1.RefAttributes<unknown>>;
declare type Shape = 'button' | 'round';
declare type Position = 'right' | 'left';
interface RadioProps extends IComponent {
className: string;
style: React$1.CSSProperties;
disabled: boolean;
checked: boolean;
shape: Shape;
textPosition: Position;
value: string | number | boolean;
iconName: string;
iconActiveName: string;
iconSize: string | number;
onChange: MouseEventHandler<HTMLDivElement>;
}
declare const Radio: FunctionComponent<Partial<RadioProps> & React$1.HTMLAttributes<HTMLDivElement>> & {
RadioGroup: typeof RadioGroup;
};
interface RateProps extends IComponent {
count: string | number;
modelValue: string | number;
minimizeValue: string | number;
iconSize: string | number;
activeColor: string;
voidColor: string;
checkedIcon: string;
uncheckedIcon: string;
disabled: boolean;
readonly: boolean;
allowHalf: boolean;
spacing: string | number;
onChange: (val: number) => void;
}
declare const Rate: FunctionComponent<Partial<RateProps>>;
declare type InputDate = string | string[];
interface CalendarItemProps {
type?: string;
isAutoBackFill?: boolean;
poppable?: boolean;
visible?: boolean;
title?: string;
defaultValue: InputDate;
startDate?: InputDate;
endDate?: InputDate;
onChoose?: (data: any) => void;
onUpdate?: () => void;
onClose?: () => void;
}
declare const CalendarItem: FunctionComponent<Partial<CalendarItemProps> & React$1.HTMLAttributes<HTMLDivElement>>;
interface PickerOption {
text: string | number;
value: string | number;
disabled?: string;
children?: PickerOption[];
className?: string | number;
}
interface PickerProps {
isVisible: boolean;
title?: string;
listData: (PickerOption | PickerOption[])[];
defaultValueData?: (number | string)[];
className?: '';
style?: React$1.CSSProperties;
threeDimensional?: boolean;
swipeDuration: number | string;
onConfirm?: (selectedValue: (string | number)[], selectedOptions: PickerOption[]) => void;
onClose?: (selectedValue: (string | number)[], selectedOptions: PickerOption[]) => void;
onCloseUpdate?: (selectedValue: (string | number)[], list: PickerOption[], pickerRef: RefObject<HTMLDivElement>) => void;
onChange?: (index: number, value: (string | number)[], selectedOptions: PickerOption[]) => void;
}
declare const Picker: React$1.ForwardRefExoticComponent<Partial<PickerProps> & React$1.RefAttributes<unknown>>;
interface ShortPasswordProps extends IComponent {
title: string;
desc: string;
tips: string;
visible: boolean;
modelValue: string | number;
errorMsg: string;
noButton: boolean;
closeOnClickOverlay: boolean;
length: string | number;
className: string;
style?: CSSProperties;
onChange: (value: string | number) => void;
onOk: (value: string | number) => void;
onCancel: () => void;
onClose: () => void;
onTips: () => void;
onComplete: (value: string | number) => void;
}
declare const ShortPassword: FunctionComponent<Partial<ShortPasswordProps> & Omit<React$1.HTMLAttributes<HTMLDivElement>, 'onChange'>>;
interface TextAreaProps {
className?: string;
defaultValue: string | number | any;
textAlign?: string | any;
limitshow?: boolean;
maxlength?: any;
rows?: any;
placeholder?: string;
readonly?: boolean;
disabled?: boolean;
autosize?: boolean;
style?: CSSProperties;
onChange?: (value: any, event: Event) => void;
onBlur?: (event: Event) => void;
onFocus?: (event: Event) => void;
}
declare const TextArea: FunctionComponent<Partial<TextAreaProps> & Omit<React$1.HTMLAttributes<HTMLDivElement>, 'onChange' | 'onBlur' | 'onFocus'>>;
declare class UploadOptions {
url: string;
name: string;
fileType?: string | undefined;
formData?: FormData;
sourceFile: any;
method: string;
xhrState: string | number;
timeout: number;
headers: {};
withCredentials: boolean;
onStart?: Function;
taroFilePath?: string;
onProgress?: Function;
onSuccess?: Function;
onFailure?: Function;
beforeXhrUpload?: Function;
}
declare type FileType$1<T> = {
[key: string]: T;
};
declare type FileItemStatus = 'ready' | 'uploading' | 'success' | 'error' | 'removed';
/** 图片的尺寸 */
interface sizeType {
/** 原图 */
original: string;
/** compressed */
compressed: string;
}
/** 图片的来源 */
interface sourceType {
/** 从相册选图 */
album: string;
/** 使用相机 */
camera: string;
/** 使用前置摄像头(仅H5纯浏览器使用) */
user: string;
/** 使用后置摄像头(仅H5纯浏览器) */
environment: string;
}
interface UploaderProps extends IComponent {
url: string;
maximum: string | number;
sizeType: (keyof sizeType)[];
sourceType: (keyof sourceType)[];
maximize: number;
defaultFileList: FileType$1<string>[];
listType: string;
uploadIcon: string;
uploadIconSize: string | number;
name: string;
disabled: boolean;
autoUpload: boolean;
timeout: number;
data: object;
method: string;
xhrState: number | string;
headers: object;
isPreview: boolean;
isDeletable: boolean;
className: string;
defaultImg: string;
style: React$1.CSSProperties;
onStart?: (option: UploadOptions) => void;
onRemove?: (file: FileItem, fileList: FileType$1<string>[]) => void;
onSuccess?: (param: {
responseText: XMLHttpRequest['responseText'];
option: UploadOptions;
}) => void;
onProgress?: (param: {
e: ProgressEvent<XMLHttpRequestEventTarget>;
option: UploadOptions;
percentage: string | number;
}) => void;
onFailure?: (param: {
responseText: XMLHttpRequest['responseText'];
option: UploadOptions;
}) => void;
onUpdate?: (fileList: FileType$1<string>[]) => void;
onOversize?: (file: Taro.chooseImage.ImageFile[]) => void;
onChange?: (param: {
fileList: FileType$1<string>[];
}) => void;
onBeforeUpload?: (file: Taro.chooseImage.ImageFile[]) => Promise<any[]>;
onBeforeXhrUpload?: (xhr: XMLHttpRequest, options: any) => void;
onBeforeDelete?: (file: FileItem, files: FileType$1<string>[]) => boolean;
onFileItemClick?: (file: FileItem) => void;
}
declare class FileItem {
status: FileItemStatus;
message: string;
uid: string;
name?: string;
url?: string;
type?: string;
path?: string;
percentage: string | number;
formData: any;
}
declare const Uploader: React$1.ForwardRefExoticComponent<Partial<UploaderProps> & {
children?: React$1.ReactNode;
} & React$1.RefAttributes<unknown>>;
interface CascaderOption {
text?: string;
value?: number | string;
paneKey?: string;
disabled?: boolean;
children?: CascaderOption[];
leaf?: boolean;
level?: number;
loading?: boolean;
root?: boolean;
}
interface CascaderProps {
className: string;
style: CSSProperties;
poppable: boolean;
visible: boolean;
options: CascaderOption[];
value: string[];
title: string;
textKey: string;
valueKey: string;
childrenKey: string;
convertConfig: Record<string, string | number | null>;
closeable: boolean;
closeIconPosition: string;
closeIcon: string;
lazy: boolean;
lazyLoad: (node: any, resolve: any) => void;
onClose?: () => void;
onChange: (value: any, params: any) => void;
onPathChange: (value: any, params: any) => void;
}
declare const Cascader: React$1.ForwardRefExoticComponent<Partial<CascaderProps> & {
children?: React$1.ReactNode;
} & React$1.RefAttributes<unknown>>;
interface SearchBarProps extends IComponent {
/** 文本值 */
value?: number | string;
/** 输入框占位提示文字 */
placeholder?: string;
/** 搜索框形状,可选值为 round */
shape?: 'square' | 'round';
/** 自定义class名 */
className?: string;
/** 是否禁用输入框 */
disabled?: boolean;
/** 最大输入长度 */
maxLength?: number;
/** 是否启用清除图标,点击清除图标后会清空输入框 */
clearable?: boolean;
/** 搜索框外部背景色 */
background?: string;
/** 搜索框背景色 */
inputBackground?: string;
/** 输入框内容对齐方式 */
align?: string;
/** 是否将输入框设为只读状态,只读状态下无法输入内容 */
readOnly?: boolean;
/** 是否自动聚焦,iOS 系统不支持该属性 */
autoFocus?: boolean;
/** 搜索框左侧文本 */
label?: React$1.ReactNode;
/** 输入框内 左icon */
leftinIcon?: React$1.ReactNode;
/** 输入框内 右icon */
rightinIcon?: React$1.ReactNode;
/** 输入框外 左icon */
leftoutIcon?: React$1.ReactNode;
/** 输入框外 右icon */
rightoutIcon?: React$1.ReactNode;
/** 取消按钮文字 */
actionText?: React$1.ReactNode;
/** 确定搜索时触发 */
onSearch?: (val: string) => void;
/** 输入框内容变化时触发 */
onChange?: (value: string, event: Event) => void;
/** 输入框获得焦点时触发 */
onFocus?: (value: string, event: Event) => void;
/** 输入框失去焦点时触发 */
onBlur?: (value: string, event: Event) => void;
/** 点击清除按钮后触发 */
onClear?: (event: Event) => void;
/** 点击取消按钮后触发 */
onCancel?: () => void;
/** 点击输入区域时触发 */
onClickInput?: (event: Event) => void;
/** 点击输入框内左侧图标时触发 */
onClickLeftinIcon?: (value: string, event: Event) => void;
/** 点击输入框外左侧图标时触发 */
onClickLeftoutIcon?: (value: string, event: Event) => void;
/** 点击输入框内右侧图标时触发 */
onClickRightinIcon?: (value: string, event: Event) => void;
/** 点击输入框外右侧图标时触发 */
onClickRightoutIcon?: (value: string, event: Event) => void;
}
declare const SearchBar: FunctionComponent<Partial<SearchBarProps> & Omit<React$1.HTMLAttributes<HTMLDivElement>, 'onChange' | 'onFocus' | 'onBlur'>>;
interface NumberKeyboardProps {
confirmText: string;
title: string;
visible: boolean;
type: string;
customKey: Array<string>;
randomKeys: boolean;
popClass: string;
className: string;
style?: CSSProperties;
onChange?: (value: string) => void;
onDelete?: () => void;
onClose: () => void;
}
declare const NumberKeyboard: FunctionComponent<Partial<NumberKeyboardProps> & Omit<React$1.HTMLAttributes<HTMLDivElement>, 'onChange'>>;
declare type ItemType<T> = {
[key: string]: T;
};
interface ActionSheetProps {
cancelTxt: string;
optionTag: string;
optionSubTag: string;
chooseTagValue: string;
title: string;
color: string;
description: string;
menuItems: ItemType<string | boolean>[];
onCancel: () => void;
onChoose: (item: any, index: number) => void;
visible: boolean;
className: string;
style: React$1.CSSProperties;
}
declare const ActionSheet: FunctionComponent<Partial<ActionSheetProps> & React$1.HTMLAttributes<HTMLDivElement>>;
interface BackTopProps extends IComponent {
className?: string;
bottom: number;
right: number;
elId: string;
distance: number;
zIndex: number;
isAnimation: boolean;
duration: number;
children?: HTMLElement | any;
style?: React$1.CSSProperties;
onClick?: (event: MouseEvent) => void;
}
declare const BackTop: FunctionComponent<Partial<BackTopProps> & Omit<React$1.HTMLAttributes<HTMLDivElement>, 'onClick'>>;
interface DragProps {
attract: boolean;
direction: 'x' | 'y' | 'lock' | undefined;
boundary: {
top: number;
left: number;
right: number;
bottom: number;
};
className: string;
style: React$1.CSSProperties;
}
declare const Drag: FunctionComponent<Partial<DragProps> & React$1.HTMLAttributes<HTMLDivElement>>;
declare type DialogConfigType = {
prefixCls?: string;
simple?: boolean;
};
interface IDialogProps {
className?: string;
style?: CSSProperties;
visible?: boolean;
title?: ReactNode;
content?: ReactNode;
footer?: ReactNode;
okText?: ReactNode;
cancelText?: ReactNode;
mask?: boolean;
noOkBtn?: boolean;
noCancelBtn?: boolean;
okBtnDisabled?: boolean;
noFooter?: boolean;
closeOnClickOverlay?: boolean;
cancelAutoClose?: boolean;
textAlign?: string;
footerDirection?: string;
lockScroll?: boolean;
onClosed?: () => void;
onOk?: (e?: MouseEvent) => Promise<() => void> | void;
onCancel?: () => void;
onClickSelf?: () => void;
onConfirm?: (e?: MouseEvent) => Promise<() => void> | void;
}
declare type DialogReturnProps = {
update: (newConfig: ConfirmProps) => void;
close: () => void;
};
interface ConfirmProps extends IDialogProps {
content?: ReactNode;
icon?: ReactNode | null;
isNotice?: boolean;
noticeType?: string;
}
interface DialogComponent extends ForwardRefExoticComponent<PropsWithChildren<IDialogProps>> {
confirm: (props: ConfirmProps) => DialogReturnProps;
alert: (props: ConfirmProps) => DialogReturnProps;
config: (config: DialogConfigType) => void;
destroyAll: () => void;
}
declare type DialogProps = IDialogProps;
declare const Dialog: DialogComponent;
interface InfiniteloadingProps extends IComponent {
hasMore: boolean;
upperThreshold: number;
containerId: string;
isOpenRefresh: boolean;
pullIcon: string;
pullTxt: string;
loadIcon: string;
loadTxt: string;
loadMoreTxt: string;
className: string;
style: React$1.CSSProperties;
onRefresh: (param: () => void) => void;
onLoadMore: (param: () => void) => void;
onScrollChange: (param: number) => void;
}
declare const Infiniteloading: FunctionComponent<Partial<InfiniteloadingProps> & React$1.HTMLAttributes<HTMLDivElement>>;
interface NotifyProps {
id?: string;
style?: React$1.CSSProperties;
msg: string;
color: string;
duration: number;
type: string;
className: string;
background: string;
position: string;
isWrapTeleport: boolean;
visible: boolean;
onClosed: () => void;
onClick: () => void;
}
declare const Notify: FunctionComponent<Partial<NotifyProps> & React$1.HTMLAttributes<HTMLDivElement>>;
interface SwitchProps {
isAsync: boolean;
checked: boolean;
disable: boolean;
activeColor: string;
inactiveColor: string;
activeText: string;
inactiveText: string;
className: string;
style: React$1.CSSProperties;
onChange: (val: boolean, event: React$1.MouseEvent) => void;
}
declare const Switch: FunctionComponent<Partial<SwitchProps>>;
interface ToastProps {
id?: string;
style?: React$1.CSSProperties;
icon: string | null;
iconSize: string;
msg: string | React$1.ReactNode;
bottom: number | string;
duration: number;
center: boolean;
type: string;
title: string;
customClass: string;
size: string | number;
textAlignCenter: boolean;
bgColor: string;
cover: boolean;
coverColor: string;
closeOnClickOverlay: boolean;
visible: boolean;
onClose: () => void;
}
declare const Toast: FunctionComponent<Partial<ToastProps> & React$1.HTMLAttributes<HTMLDivElement>>;
declare type SwipeSide = 'left' | 'right';
declare type SwipePosition = SwipeSide | 'cell' | 'outside';
interface SwipeInstance {
open: (side: SwipeSide) => void;
close: () => void;
}
interface SwipeProps {
/** 自定义类名 */
className: string;
/** 自定义样式 */
style: React$1.CSSProperties;
/** 标识符,可以在事件参数中获取到 */
name?: string | number;
/** 指定左侧滑动区域宽度,单位为px */
leftWidth?: string | number;
/** 指定右侧滑动区域宽度,单位为 px */
rightWidth?: string | number;
/** 左侧滑动区域的内容 */
leftAction?: React$1.ReactNode;
/** 右侧滑动区域的内容 */
rightAction?: React$1.ReactNode;
/** 关闭前的回调函数,返回 false 可阻止关闭,支持返回 Promise */
beforeClose?: (position: string) => void;
/** 是否禁用 */
disabled?: boolean;
/** 打开时触发 */
onOpen?: ({ name, position, }: {
name: string | number;
position: SwipeSide;
}) => void;
/** 关闭时触发 */
onClose?: ({ name, position, }: {
name: string | number;
position: SwipePosition;
}) => void;
/** 点击时触发 */
onActionClick?: (event: Event, position: SwipePosition) => void;
children?: React$1.ReactNode;
}
declare const Swipe: React$1.ForwardRefExoticComponent<Partial<SwipeProps> & React$1.HTMLAttributes<HTMLDivElement> & React$1.RefAttributes<SwipeInstance>>;
declare type PullStatus = 'pulling' | 'canRelease' | 'refreshing' | 'complete';
interface PullToRefreshProps {
className: string;
style: React$1.CSSProperties;
onRefresh: () => Promise<any>;
pullingText: ReactNode;
canReleaseText: ReactNode;
refreshingText: ReactNode;
completeText: ReactNode;
completeDelay: number;
headHeight: number;
threshold: number;
disabled: boolean;
renderText: (status: PullStatus) => ReactNode;
children: React$1.ReactNode;
}
declare const PullToRefresh: FunctionComponent<Partial<PullToRefreshProps>>;
interface CircleProgressProps {
progress: string | number;
strokeWidth?: string | number;
radius?: number | string;
strokeLinecap?: 'butt' | 'round' | 'square' | 'inherit' | undefined;
circleColor?: object | string;
pathColor?: string;
clockwise?: boolean;
className?: string;
}
declare const CircleProgress: FunctionComponent<CircleProgressProps & React$1.HTMLAttributes<HTMLDivElement>>;
interface NoticeBarProps extends IComponent {
direction: string;
className?: string;
style?: CSSProperties;
list: any;
standTime: number;
complexAm: boolean;
height: number;
text: string;
closeMode: boolean;
wrapable: boolean;
leftIcon: string;
color: string;
background: string;
delay: string | number;
scrollable: boolean | null;
speed: number;
rightIcon?: HTMLElement | any;
close?: (list?: any) => void;
click?: (item?: any) => void;
onClose?: (list?: any) => void;
onClick?: (item?: any) => void;
}
declare const NoticeBar: FunctionComponent<Partial<NoticeBarProps> & Omit<React$1.HTMLAttributes<HTMLDivElement>, 'onClick'>>;
interface StepsProps {
current: number;
direction: string;
progressDot: boolean;
className: string;
style: React$1.CSSProperties;
clickStep: (index: number) => void;
onClickStep: (index: number) => void;
}
declare const Steps: FunctionComponent<Partial<StepsProps> & React$1.HTMLAttributes<HTMLDivElement>>;
interface StepProps extends IComponent {
title: string;
content: string;
activeIndex: number;
icon: string;
iconColor: string;
size: string;
className: string;
style: React$1.CSSProperties;
renderContent: () => React$1.ReactNode;
}
declare const Step: FunctionComponent<Partial<StepProps> & React$1.HTMLAttributes<HTMLDivElement>>;
declare type SwiperRef = {
to: (index: number) => void;
next: () => void;
prev: () => void;
};
interface SwiperProps {
width: number | string;
height: number | string;
duration: number | string;
initPage: number | string;
autoPlay: number | string;
direction: 'horizontal' | 'vertical';
paginationColor: string;
paginationVisible: boolean;
loop: boolean;
touchable: boolean;
isPreventDefault: boolean;
isStopPropagation: boolean;
isCenter: boolean;
className?: string;
style?: React$1.CSSProperties;
pageContent?: React$1.ReactNode;
onChange?: (currPage: number) => void;
}
declare const Swiper: React$1.ForwardRefExoticComponent<Partial<SwiperProps> & Omit<React$1.HTMLAttributes<HTMLDivElement>, "onChange"> & React$1.RefAttributes<SwiperRef>>;
interface SwiperItemProps {
direction?: string;
size?: 0;
}
declare const SwiperItem: React$1.ForwardRefExoticComponent<Partial<SwiperItemProps> & React$1.HTMLAttributes<HTMLDivElement> & React$1.RefAttributes<HTMLDivElement>>;
interface AvatarProps extends IComponent {
size: string;
icon: string;
iconSize?: string | number;
shape: AvatarShape;
bgColor: string;
color: string;
prefixCls: string;
url: string;
className: string;
style: React$1.CSSProperties;
activeAvatar: (e: MouseEvent) => void;
onActiveAvatar: (e: MouseEvent) => void;
onError: (e: any) => void;
}
declare type AvatarShape = 'round' | 'square';
declare const Avatar: FunctionComponent<Partial<AvatarProps> & React$1.HTMLAttributes<HTMLDivElement>>;
interface AvatarGroupProps {
maxContent: string;
maxCount: string | number;
maxBgColor: string;
maxColor: string;
size: string;
shape: string;
span: string;
zIndex: string;
className: string;
style: React$1.CSSProperties;
}
declare const AvatarGroup: FunctionComponent<Partial<AvatarGroupProps> & React$1.HTMLAttributes<HTMLDivElement>>;
interface PriceProps {
price: number | string;
needSymbol: boolean;
symbol: string;
decimalDigits: number;
thousands: boolean;
position: string;
size: string;
className: string;
style: React$1.CSSProperties;
}
declare const Price: FunctionComponent<Partial<PriceProps>>;
interface BadgeProps extends IComponent {
value: any;
dot: boolean;
max: number;
top: string;
right: string;
zIndex: string;
color: string;
icons: any;
children?: ReactNode;
}
declare const Badge: FunctionComponent<Partial<BadgeProps>>;
interface TagProps extends IComponent {
type: TagType;
color: string;
textColor: string;
plain: boolean;
round: boolean;
mark: boolean;
closeable: boolean;
prefixCls: string;
onClick: (e: MouseEvent) => void;
onClose: (e?: any) => void;
children?: React$1.ReactNode;
}
declare type TagType = 'default' | 'primary' | 'success' | 'warning' | 'danger';
declare const Tag: FunctionComponent<Partial<TagProps>>;
declare type PopoverTheme = 'light' | 'dark';
declare type PopoverLocation = 'bottom' | 'top' | 'left' | 'right' | 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end' | 'left-start' | 'left-end' | 'right-start' | 'right-end';
interface List {
name: string;
icon?: string;
disabled?: boolean;
}
interface PopoverProps extends IComponent {
list: List[];
theme: PopoverTheme;
location: PopoverLocation | string;
visible: boolean;
offset: string | number;
className: string;
style?: CSSProperties;
children?: React$1.ReactNode;
onClick: (e: React$1.MouseEvent) => void;
onChoose: (item: List, index: number) => void;
}
declare const Popover: FunctionComponent<Partial<PopoverProps> & React$1.HTMLAttributes<HTMLDivElement>>;
declare type avatarShape = 'round' | 'square';
interface SkeletonProps {
width: string;
height: string;
animated: boolean;
row: number;
title: boolean;
avatar: boolean;
className?: string;
style?: React$1.CSSProperties;
avatarSize: string;
round: boolean;
loading: boolean;
avatarShape: avatarShape;
children?: React$1.ReactNode;
}
declare const Skeleton: FunctionComponent<Partial<SkeletonProps>>;
interface CountDownProps {
className?: string;
style?: CSSProperties;
paused: boolean;
startTime: number;
endTime: number;
millisecond: boolean;
format: string;
autoStart: boolean;
time: number;
onEnd: () => void;
onPaused: (restTime: number) => void;
onRestart: (restTime: number) => void;
onUpdate: (restTime: any) => void;
children: ReactNode;
}
declare const CountDown: React$1.ForwardRefExoticComponent<Partial<CountDownProps> & React$1.RefAttributes<unknown>>;
interface CollapseProps {
className: string;
style: React$1.CSSProperties;
activeName: Array<number | string> | number | string;
accordion: boolean;
icon: string;
iconSize: string;
iconColor: string;
rotate: number;
onChange: (isOpen: boolean, name: string) => void;
children?: React$1.ReactNode;
}
declare const Collapse: FunctionComponent<Partial<CollapseProps>>;
interface CollapseItemProps$1 extends IComponent {
title: string;
name: string;
isOpen: boolean;
icon: string;
iconSize: string;
iconColor: string;
disabled: boolean;
rotate: number;
subTitle: string;
titleIcon: string;
titleIconColor: string;
titleIconPosition: string;
titleIconSize: string;
childnull: boolean;
onToggle: (isOpen: boolean, name: string) => void;
}
declare const CollapseItem: FunctionComponent<Partial<CollapseItemProps$1> & React$1.HTMLAttributes<HTMLDivElement>>;
interface CountUpProps {
maxLen: number;
endNumber: string;
delaySpeed?: number;
easeSpeed: number;
thousands: boolean;
className: string;
style: React$1.CSSProperties;
}
interface AnimatingNumbersProps {
}
declare type AnimatingNumbersStates = {};
declare class AnimatingNumbers extends Component<AnimatingNumbersProps, AnimatingNumbersStates> {
static defaultProps: AnimatingNumbersProps;
static displayName: string;
static CountUp: React$1.FunctionComponent<Partial<CountUpProps>>;
constructor(props: AnimatingNumbersProps);
render(): JSX.Element;
}
interface EmptyProps {
image: ReactNode;
imageSize: number | string;
description: ReactNode;
className: string;
}
declare const Empty: FunctionComponent<Partial<EmptyProps> & React$1.HTMLAttributes<HTMLDivElement>>;
declare type Data = any;
interface IVirtualListProps {
className?: string;
style?: React.CSSProperties;
sourceData: Array<Data>;
containerSize?: number;
ItemRender?: React.FC<any>;
itemSize?: number;
itemEqualSize?: boolean;
horizontal?: boolean;
overscan?: number;
handleScroll?: (...args: any[]) => any;
onScroll?: (...args: any[]) => any;
key?: string;
locale?: {
[key in string]: string;
};
}
declare type VirtualListProps = IVirtualListProps;
declare const VirtualList: FunctionComponent<VirtualListProps & React$1.HTMLAttributes<HTMLDivElement>>;
interface ITableProps extends IComponent {
className: string;
style: React$1.CSSProperties;
columns: Array<TableColumnProps>;
data: Array<any>;
bordered: boolean;
summary?: React$1.ReactNode;
striped?: boolean;
noData?: React$1.ReactNode;
onSorter?: (item: TableColumnProps, data: Array<any>) => void;
}
interface TableColumnProps {
key: string;
title?: string;
align?: string;
sorter?: ((a: any, b: any) => number) | boolean | string;
render?: (rowData?: any, rowIndex?: number) => string | React$1.ReactNode;
}
declare type TableProps = ITableProps;
declare const Table: FunctionComponent<Partial<TableProps> & React$1.HTMLAttributes<HTMLDivElement>>;
interface VideoProps$1 {
source: {
type: string;
src: string;
};
options: {
controls?: boolean;
muted?: boolean;
autoplay?: boolean;
poster?: string;
playsinline?: boolean;
loop?: boolean;
};
className: string;
style: R