@widergy/energy-ui 2.11.0 → 2.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -34,6 +34,7 @@ const UTMapPropTypes = exports.UTMapPropTypes = {
|
|
|
34
34
|
field: _formTypes.fieldType,
|
|
35
35
|
meta: _formTypes.metaPropTypes,
|
|
36
36
|
input: _formTypes.inputPropTypes,
|
|
37
|
+
apiKey: _propTypes.string,
|
|
37
38
|
disabled: _propTypes.bool
|
|
38
39
|
};
|
|
39
40
|
const GoogleMapsPropTypes = exports.GoogleMapsPropTypes = {
|
|
@@ -6,18 +6,26 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _withScriptjs = _interopRequireDefault(require("react-google-maps/lib/withScriptjs"));
|
|
9
|
+
var _types = require("./types");
|
|
9
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
11
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
11
12
|
const WithGoogleMapScript = () => WrappedComponent => {
|
|
12
13
|
const Component = (0, _withScriptjs.default)(WrappedComponent);
|
|
13
|
-
const WithGoogleMap =
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
const WithGoogleMap = _ref => {
|
|
15
|
+
let {
|
|
16
|
+
apiKey,
|
|
17
|
+
...props
|
|
18
|
+
} = _ref;
|
|
19
|
+
return /*#__PURE__*/_react.default.createElement(Component, _extends({
|
|
20
|
+
googleMapURL: "https://maps.googleapis.com/maps/api/js?libraries=places,geometry&key=".concat(apiKey),
|
|
21
|
+
loadingElement: /*#__PURE__*/_react.default.createElement("div", {
|
|
22
|
+
style: {
|
|
23
|
+
height: "100%"
|
|
24
|
+
}
|
|
25
|
+
})
|
|
26
|
+
}, props));
|
|
27
|
+
};
|
|
28
|
+
WithGoogleMap.propTypes = _types.UTMapPropTypes.propTypes;
|
|
21
29
|
return WithGoogleMap;
|
|
22
30
|
};
|
|
23
31
|
var _default = exports.default = WithGoogleMapScript;
|