@e-group/material-module
Version:
EGroup Team react component modules.
56 lines (55 loc) • 1.35 kB
TypeScript
import React, { ReactElement, ReactNode } from 'react';
import { TextFieldProps } from '@e-group/material/TextField';
export declare type Dist = {
name: string;
zipCode: string;
};
export declare type City = {
city: string;
dists: Dist[];
};
export declare type Value = {
city: string;
area: string;
zipCode?: string;
};
export interface SimpleAddressProps {
/**
* location data.
*/
data?: City[];
/**
* Shared props apply on every field.
*/
MuiTextFieldProps?: TextFieldProps;
/**
* City field props.
*/
cityProps?: TextFieldProps;
/**
* Area field props.
*/
areaProps?: TextFieldProps;
/**
* Zip code field props.
*/
zipCodeProps?: TextFieldProps;
/**
* Set `true` to disable zip code field.
*/
disableZipCode?: boolean;
/**
* Customer render function provide three field.
*/
renderFields?: (city: ReactNode, area: ReactNode, zipCode?: ReactNode) => ReactElement;
/**
* Callback fired when the value is changed..
*/
onChange?: (value: Value) => void;
/**
* The value of the component.
*/
value?: Value;
}
declare const SimpleAddress: React.ForwardRefExoticComponent<SimpleAddressProps & React.RefAttributes<HTMLDivElement>>;
export default SimpleAddress;