Skip to content

Commit

Permalink
remove corejs from babelrc (#105)
Browse files Browse the repository at this point in the history
  • Loading branch information
ErrorPro authored May 2, 2021
1 parent cb60de1 commit b924e98
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 109 deletions.
4 changes: 1 addition & 3 deletions .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@
[
"@babel/preset-env",
{
"useBuiltIns": "usage",
"targets": {
"ie": "11"
},
"corejs": "3.6.5"
}
}
]
// TODO: Minify breaks IE 11
Expand Down
70 changes: 24 additions & 46 deletions lib/ReactGoogleAutocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,44 +2,22 @@

function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }

require("core-js/modules/es.symbol.js");

require("core-js/modules/es.object.assign.js");

require("core-js/modules/es.array.iterator.js");

require("core-js/modules/es.object.to-string.js");

require("core-js/modules/es.string.iterator.js");

require("core-js/modules/es.weak-map.js");

require("core-js/modules/web.dom-collections.iterator.js");

require("core-js/modules/es.object.get-own-property-descriptor.js");

require("core-js/modules/es.symbol.description.js");

require("core-js/modules/es.symbol.iterator.js");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

require("core-js/modules/es.object.keys.js");
exports["default"] = void 0;

var _react = _interopRequireWildcard(require("react"));

var _propTypes = _interopRequireDefault(require("prop-types"));

var _usePlacesWidget2 = _interopRequireDefault(require("./usePlacesWidget"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }

function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }

function _extends() { _extends = Object.assign || 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); }

Expand All @@ -56,7 +34,7 @@ function ReactGoogleAutocomplete(props) {
refProp = props.refProp,
rest = _objectWithoutProperties(props, ["onPlaceSelected", "apiKey", "inputAutocompleteValue", "options", "googleMapsScriptBaseUrl", "refProp"]);

var _usePlacesWidget = (0, _usePlacesWidget2.default)({
var _usePlacesWidget = (0, _usePlacesWidget2["default"])({
ref: refProp,
googleMapsScriptBaseUrl: googleMapsScriptBaseUrl,
onPlaceSelected: onPlaceSelected,
Expand All @@ -66,37 +44,37 @@ function ReactGoogleAutocomplete(props) {
}),
ref = _usePlacesWidget.ref;

return /*#__PURE__*/_react.default.createElement("input", _extends({
return /*#__PURE__*/_react["default"].createElement("input", _extends({
ref: ref
}, rest));
}

ReactGoogleAutocomplete.propTypes = {
apiKey: _propTypes.default.string,
ref: _propTypes.default.oneOfType([// Either a function
_propTypes.default.func, // Or anything shaped { current: any }
_propTypes.default.shape({
current: _propTypes.default.any
apiKey: _propTypes["default"].string,
ref: _propTypes["default"].oneOfType([// Either a function
_propTypes["default"].func, // Or anything shaped { current: any }
_propTypes["default"].shape({
current: _propTypes["default"].any
})]),
googleMapsScriptBaseUrl: _propTypes.default.string,
onPlaceSelected: _propTypes.default.func,
inputAutocompleteValue: _propTypes.default.string,
options: _propTypes.default.shape({
componentRestrictions: _propTypes.default.object,
bounds: _propTypes.default.object,
location: _propTypes.default.object,
offset: _propTypes.default.number,
origin: _propTypes.default.object,
radius: _propTypes.default.number,
sessionToken: _propTypes.default.object,
types: _propTypes.default.arrayOf(_propTypes.default.string)
googleMapsScriptBaseUrl: _propTypes["default"].string,
onPlaceSelected: _propTypes["default"].func,
inputAutocompleteValue: _propTypes["default"].string,
options: _propTypes["default"].shape({
componentRestrictions: _propTypes["default"].object,
bounds: _propTypes["default"].object,
location: _propTypes["default"].object,
offset: _propTypes["default"].number,
origin: _propTypes["default"].object,
radius: _propTypes["default"].number,
sessionToken: _propTypes["default"].object,
types: _propTypes["default"].arrayOf(_propTypes["default"].string)
})
};

var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
return /*#__PURE__*/_react.default.createElement(ReactGoogleAutocomplete, _extends({}, props, {
return /*#__PURE__*/_react["default"].createElement(ReactGoogleAutocomplete, _extends({}, props, {
refProp: ref
}));
});

exports.default = _default;
exports["default"] = _default;
6 changes: 3 additions & 3 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@ Object.defineProperty(exports, "__esModule", {
Object.defineProperty(exports, "default", {
enumerable: true,
get: function get() {
return _ReactGoogleAutocomplete.default;
return _ReactGoogleAutocomplete["default"];
}
});
Object.defineProperty(exports, "usePlacesWidget", {
enumerable: true,
get: function get() {
return _usePlacesWidget.default;
return _usePlacesWidget["default"];
}
});

var _ReactGoogleAutocomplete = _interopRequireDefault(require("./ReactGoogleAutocomplete"));

var _usePlacesWidget = _interopRequireDefault(require("./usePlacesWidget"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
40 changes: 4 additions & 36 deletions lib/usePlacesAutocompleteService.js
Original file line number Diff line number Diff line change
@@ -1,41 +1,9 @@
"use strict";

require("core-js/modules/es.symbol.js");

require("core-js/modules/es.symbol.description.js");

require("core-js/modules/es.object.to-string.js");

require("core-js/modules/es.symbol.iterator.js");

require("core-js/modules/es.array.iterator.js");

require("core-js/modules/es.string.iterator.js");

require("core-js/modules/web.dom-collections.iterator.js");

require("core-js/modules/es.array.slice.js");

require("core-js/modules/es.function.name.js");

require("core-js/modules/es.array.from.js");

require("core-js/modules/es.object.keys.js");

require("core-js/modules/es.array.filter.js");

require("core-js/modules/es.object.get-own-property-descriptor.js");

require("core-js/modules/web.dom-collections.for-each.js");

require("core-js/modules/es.object.get-own-property-descriptors.js");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = usePlacesAutocompleteService;

require("core-js/modules/es.array.concat.js");
exports["default"] = usePlacesAutocompleteService;

var _react = require("react");

Expand All @@ -45,7 +13,7 @@ var _utils = require("./utils");

var _constants = require("./constants");

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }

Expand Down Expand Up @@ -111,15 +79,15 @@ function usePlacesAutocompleteService(_ref) {
var handleLoadScript = (0, _react.useCallback)(function () {
return (0, _utils.loadGoogleMapScript)(googleMapsScriptBaseUrl, googleMapsScriptUrl);
}, [googleMapsScriptBaseUrl, googleMapsScriptUrl]);
var debouncedPlacePredictions = (0, _react.useCallback)((0, _lodash.default)(function (optionsArg) {
var debouncedPlacePredictions = (0, _react.useCallback)((0, _lodash["default"])(function (optionsArg) {
if (googleAutocompleteService.current && optionsArg.input) googleAutocompleteService.current.getPlacePredictions(_objectSpread(_objectSpread(_objectSpread({}, options), optionsArg), sessionToken && autocompleteSession.current ? {
sessionToken: autocompleteSession.current
} : {}), function (r) {
setIsPlacePredsLoading(false);
setPlacePredictions(r || []);
});
}, debounce), [debounce]);
var debouncedQueryPredictions = (0, _react.useCallback)((0, _lodash.default)(function (optionsArg) {
var debouncedQueryPredictions = (0, _react.useCallback)((0, _lodash["default"])(function (optionsArg) {
if (googleAutocompleteService.current && optionsArg.input) googleAutocompleteService.current.getQueryPredictions(_objectSpread(_objectSpread(_objectSpread({}, options), optionsArg), sessionToken && autocompleteSession.current ? {
sessionToken: autocompleteSession.current
} : {}), function (r) {
Expand Down
16 changes: 1 addition & 15 deletions lib/usePlacesWidget.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,9 @@
"use strict";

require("core-js/modules/es.symbol.js");

require("core-js/modules/es.array.filter.js");

require("core-js/modules/es.object.get-own-property-descriptor.js");

require("core-js/modules/web.dom-collections.for-each.js");

require("core-js/modules/es.object.get-own-property-descriptors.js");

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = usePlacesWidget;

require("core-js/modules/es.array.concat.js");

require("core-js/modules/es.object.keys.js");
exports["default"] = usePlacesWidget;

var _react = require("react");

Expand Down
5 changes: 0 additions & 5 deletions lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@ Object.defineProperty(exports, "__esModule", {
value: true
});
exports.loadGoogleMapScript = exports.isBrowser = void 0;

require("core-js/modules/es.object.to-string.js");

require("core-js/modules/es.promise.js");

var isBrowser = typeof window !== "undefined" && window.document;
exports.isBrowser = isBrowser;

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-google-autocomplete",
"version": "2.1.1",
"version": "2.1.2",
"description": "React component for google autocomplete.",
"main": "index.js",
"types": "index.d.ts",
Expand Down

0 comments on commit b924e98

Please sign in to comment.