[geo] provide more flexible Spatial controls (#4032)

Before this PR the only way to query lat/long is in the shape of 2
columns that contains lat and long.

Now we're adding 2 more options:
* a single column that has lat and long with a delimiter in between
* support for geohashes - geohashes are cool
This commit is contained in:
Maxime Beauchemin
2017-12-15 11:47:27 -08:00
committed by GitHub
parent cf1d9ce1e6
commit ec752b1378
15 changed files with 434 additions and 66 deletions

View File

@@ -24,6 +24,7 @@ const propTypes = {
valueRenderer: PropTypes.func,
valueKey: PropTypes.string,
options: PropTypes.array,
placeholder: PropTypes.string,
};
const defaultProps = {
@@ -105,10 +106,11 @@ export default class SelectControl extends React.PureComponent {
}
render() {
// Tab, comma or Enter will trigger a new option created for FreeFormSelect
const placeholder = this.props.placeholder || t('Select %s', this.state.options.length);
const selectProps = {
multi: this.props.multi,
name: `select-${this.props.name}`,
placeholder: t('Select %s', this.state.options.length),
placeholder,
options: this.state.options,
value: this.props.value,
labelKey: 'label',