import React from "react"; import BaseControl, { ControlProps } from "./BaseControl"; import styled from "styled-components"; import SearchBox from "react-google-maps/lib/components/places/SearchBox"; import StandaloneSearchBox from "react-google-maps/lib/components/places/StandaloneSearchBox"; import { getAppsmithConfigs } from "configs"; const { compose, withProps, lifecycle } = require("recompose"); const { withScriptjs } = require("react-google-maps"); const StyledInput = styled.input` box-sizing: border-box; border: 1px solid transparent; width: 100%; height: 32px; padding: 0 5px; border-radius: 3px; font-size: 14px; outline: none; text-overflow: ellipses; background: #272821; color: ${props => props.theme.colors.textOnDarkBG}; `; interface StandaloneSearchBoxProps { onSearchBoxMounted: (ref: any) => void; onPlacesChanged: () => void; } const { google } = getAppsmithConfigs(); const PlacesWithStandaloneSearchBox = compose( withProps({ googleMapURL: `https://maps.googleapis.com/maps/api/js?key=${google.apiKey}&v=3.exp&libraries=geometry,drawing,places`, loadingElement:
, containerElement: , }), lifecycle({ componentWillMount() { let searchBox: any = React.createRef