jamis
Version:
一种支持通过JSON配置方式生成页面的组件库
48 lines (47 loc) • 1.38 kB
TypeScript
import React from 'react';
import type { LocaleProps, ThemeProps } from 'jamis-core';
export interface LocationProps extends ThemeProps, LocaleProps {
vendor: 'baidu' | 'gaode' | 'tenxun';
coordinatesType: 'bd09' | 'gcj02';
placeholder: string;
clearable: boolean;
ak: string;
value?: {
address: string;
lat: number;
lng: number;
city?: string;
};
disabled?: boolean;
popoverClassName?: string;
onChange: (value: any) => void;
popOverContainer?: any;
}
export interface LocationState {
isFocused: boolean;
isOpened: boolean;
}
export declare class LocationPicker extends React.Component<LocationProps, LocationState> {
static defaultProps: {
placeholder: string;
clearable: boolean;
};
domRef: React.RefObject<HTMLDivElement>;
state: {
isFocused: boolean;
isOpened: boolean;
};
handleKeyPress(e: React.KeyboardEvent): void;
handleFocus(): void;
handleBlur(): void;
handleClick(): void;
getTarget(): HTMLDivElement | null;
getParent(): HTMLElement | null | undefined;
open(fn?: () => void): void;
close(): void;
clearValue(e: React.MouseEvent<any>): void;
handlePopOverClick(e: React.MouseEvent<any>): void;
handleChange(value: any): void;
render(): JSX.Element;
}
export default LocationPicker;