@appbaseio/reactivesearch-vue 1.34.0-alpha.2 → 1.34.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.
Files changed (104) hide show
  1. package/dist/@appbaseio/reactivesearch-vue.umd.js +10874 -8633
  2. package/dist/@appbaseio/reactivesearch-vue.umd.js.map +1 -1
  3. package/dist/@appbaseio/reactivesearch-vue.umd.min.js +12 -11
  4. package/dist/@appbaseio/reactivesearch-vue.umd.min.js.map +1 -1
  5. package/dist/cjs/Button-841fd06d.js +62 -0
  6. package/dist/cjs/{CancelSvg-062a42f0.js → CancelSvg-220a7cc3.js} +40 -32
  7. package/dist/cjs/Card-240f283d.js +30 -0
  8. package/dist/cjs/{ComponentWrapper-db45cc6d.js → ComponentWrapper-94c50228.js} +7 -7
  9. package/dist/cjs/Container-e699ea95.js +15 -0
  10. package/dist/cjs/DataSearch.js +1312 -20
  11. package/dist/cjs/{DropDown-3b899b20.js → DropDown-7a52c661.js} +79 -78
  12. package/dist/cjs/DynamicRangeSlider.js +46 -56
  13. package/dist/cjs/Flex-ddd7cb6b.js +50 -0
  14. package/dist/cjs/FormControlList-bbb5cd24.js +45 -0
  15. package/dist/cjs/Input-ead4cd84.js +77 -0
  16. package/dist/cjs/ListItem-5088bd6a.js +45 -0
  17. package/dist/cjs/MultiDropdownList.js +68 -74
  18. package/dist/cjs/MultiList.js +94 -89
  19. package/dist/cjs/MultiRange.js +44 -54
  20. package/dist/cjs/{Pagination-a468f960.js → Pagination-e56a5b79.js} +53 -56
  21. package/dist/cjs/{PreferencesConsumer-034c55e3.js → PreferencesConsumer-5e6e84a2.js} +5 -6
  22. package/dist/cjs/RangeInput.js +107 -115
  23. package/dist/cjs/RangeSlider.js +39 -50
  24. package/dist/cjs/ReactiveBase.js +55 -69
  25. package/dist/cjs/ReactiveComponent.js +316 -46
  26. package/dist/cjs/{ReactiveComponent-f0f486ca.js → ReactiveComponentPrivate-244c6055.js} +321 -618
  27. package/dist/cjs/ReactiveComponentPrivate.js +55 -0
  28. package/dist/cjs/ReactiveGoogleMap.js +439 -384
  29. package/dist/cjs/ReactiveList.js +128 -100
  30. package/dist/cjs/ResultCard.js +19 -26
  31. package/dist/cjs/ResultList.js +27 -31
  32. package/dist/cjs/SelectedFilters.js +34 -49
  33. package/dist/cjs/SingleDropdownList.js +66 -73
  34. package/dist/cjs/SingleList.js +96 -90
  35. package/dist/cjs/SingleRange.js +42 -48
  36. package/dist/cjs/StateProvider.js +2 -2
  37. package/dist/cjs/Tags-4ec43831.js +883 -0
  38. package/dist/cjs/Title-16042ea0.js +15 -0
  39. package/dist/cjs/ToggleButton.js +34 -39
  40. package/dist/cjs/{index-dc25b706.js → index-de136c17.js} +8 -6
  41. package/dist/cjs/index.js +27 -25
  42. package/dist/cjs/initReactivesearch.js +0 -3
  43. package/dist/cjs/install.js +23 -22
  44. package/dist/cjs/ssr-f2fc1bf6.js +36 -0
  45. package/dist/cjs/version.js +1 -1
  46. package/dist/cjs/{vueTypes-621a8143.js → vueTypes-b7007f5f.js} +3 -2
  47. package/dist/es/Button-153cd885.js +53 -0
  48. package/dist/es/{CancelSvg-14ebc9a1.js → CancelSvg-e40552a5.js} +37 -30
  49. package/dist/es/{Card-1951569e.js → Card-19ad6d90.js} +6 -5
  50. package/dist/es/{ComponentWrapper-bf443c0b.js → ComponentWrapper-edaeaceb.js} +6 -6
  51. package/dist/es/Container-d00219f7.js +1 -1
  52. package/dist/es/DataSearch.js +1312 -18
  53. package/dist/es/{DropDown-35e232b7.js → DropDown-2c0dd714.js} +78 -78
  54. package/dist/es/DynamicRangeSlider.js +43 -53
  55. package/dist/es/Flex-7c177a10.js +45 -0
  56. package/dist/es/FormControlList-99797d0a.js +38 -0
  57. package/dist/es/Input-c09c0b56.js +69 -0
  58. package/dist/es/{ListItem-47a6345a.js → ListItem-07888a65.js} +7 -6
  59. package/dist/es/MultiDropdownList.js +66 -72
  60. package/dist/es/MultiList.js +93 -88
  61. package/dist/es/MultiRange.js +42 -52
  62. package/dist/es/{Pagination-145b4ff2.js → Pagination-edeb7dbe.js} +53 -56
  63. package/dist/es/{PreferencesConsumer-7ea7313a.js → PreferencesConsumer-86a676c8.js} +4 -5
  64. package/dist/es/RangeInput.js +103 -112
  65. package/dist/es/RangeSlider.js +36 -47
  66. package/dist/es/ReactiveBase.js +53 -68
  67. package/dist/es/ReactiveComponent.js +316 -45
  68. package/dist/es/{ReactiveComponent-e2fb9eb4.js → ReactiveComponentPrivate-6f16e1b7.js} +316 -614
  69. package/dist/es/ReactiveComponentPrivate.js +47 -0
  70. package/dist/es/ReactiveGoogleMap.js +434 -380
  71. package/dist/es/ReactiveList.js +125 -98
  72. package/dist/es/ResultCard.js +18 -25
  73. package/dist/es/ResultList.js +26 -30
  74. package/dist/es/SelectedFilters.js +32 -47
  75. package/dist/es/SingleDropdownList.js +64 -71
  76. package/dist/es/SingleList.js +94 -88
  77. package/dist/es/SingleRange.js +40 -46
  78. package/dist/es/StateProvider.js +2 -2
  79. package/dist/es/Tags-1c2d6c4d.js +869 -0
  80. package/dist/es/Title-863dfa42.js +1 -1
  81. package/dist/es/ToggleButton.js +32 -37
  82. package/dist/es/{index-285a43a6.js → index-5509c0bc.js} +8 -6
  83. package/dist/es/index.js +20 -19
  84. package/dist/es/initReactivesearch.js +0 -3
  85. package/dist/es/install.js +20 -19
  86. package/dist/es/ssr-03607d84.js +1 -1
  87. package/dist/es/version.js +1 -1
  88. package/dist/es/{vueTypes-e4af6fe2.js → vueTypes-66ebc93e.js} +3 -2
  89. package/package.json +10 -10
  90. package/dist/cjs/Button-626c5e8e.js +0 -58
  91. package/dist/cjs/Card-c381ded3.js +0 -26
  92. package/dist/cjs/Container-29f049b2.js +0 -12
  93. package/dist/cjs/DataSearch-7c71ec9f.js +0 -2043
  94. package/dist/cjs/Flex-d5675ea6.js +0 -48
  95. package/dist/cjs/FormControlList-cf1ff2ca.js +0 -42
  96. package/dist/cjs/Input-4d278ca0.js +0 -74
  97. package/dist/cjs/ListItem-c067bc07.js +0 -41
  98. package/dist/cjs/Title-8802a218.js +0 -12
  99. package/dist/cjs/ssr-eb901d09.js +0 -35
  100. package/dist/es/Button-ebafa3d6.js +0 -52
  101. package/dist/es/DataSearch-4f9a4e46.js +0 -2028
  102. package/dist/es/Flex-a08e22d7.js +0 -46
  103. package/dist/es/FormControlList-fa5cf78b.js +0 -38
  104. package/dist/es/Input-3b8408a6.js +0 -69
@@ -1,22 +1,21 @@
1
1
  import { Actions, helper } from '@appbaseio/reactivecore';
2
2
  import { componentTypes } from '@appbaseio/reactivecore/lib/utils/constants';
3
3
  import { a as _extends, b as _objectWithoutPropertiesLoose, c as _toPropertyKey, d as _inheritsLoose, _ as _taggedTemplateLiteralLoose } from './_rollupPluginBabelHelpers-ded08042.js';
4
- import { createVNode, mergeProps } from 'vue';
5
4
  import VueTypes from 'vue-types';
6
- import { styled } from '@appbaseio/vue-emotion';
7
- import { css } from 'emotion';
5
+ import 'emotion';
6
+ import styled, { css } from '@appbaseio/vue-emotion';
8
7
  import 'polished';
9
- import './Button-ebafa3d6.js';
10
- import { t as types } from './vueTypes-e4af6fe2.js';
11
- import { P as Pagination } from './Pagination-145b4ff2.js';
8
+ import './Button-153cd885.js';
9
+ import { t as types } from './vueTypes-66ebc93e.js';
10
+ import { P as Pagination } from './Pagination-edeb7dbe.js';
12
11
  import '@appbaseio/reactivecore/lib/utils/transform';
13
12
  import 'redux';
14
- import { h as hasCustomRenderer, i as isQueryIdentical, g as getComponent, a as isFunction, c as connect } from './index-285a43a6.js';
15
- import { C as ComponentWrapper } from './ComponentWrapper-bf443c0b.js';
16
- import { P as PreferencesConsumer } from './PreferencesConsumer-7ea7313a.js';
17
- import _transformOn from '@vue/babel-helper-vue-transform-on';
18
- import { C as Checkbox } from './FormControlList-fa5cf78b.js';
19
- import VueGoogleMaps, { InfoWindow, MapElementMixin, Marker, GMapCluster, Map } from 'vue-google-maps-community-fork';
13
+ import { h as hasCustomRenderer, i as isQueryIdentical, g as getComponent, a as isFunction, c as connect } from './index-5509c0bc.js';
14
+ import { C as ComponentWrapper } from './ComponentWrapper-edaeaceb.js';
15
+ import { P as PreferencesConsumer } from './PreferencesConsumer-86a676c8.js';
16
+ import _mergeJSXProps from '@vue/babel-helper-vue-jsx-merge-props';
17
+ import { C as Checkbox } from './FormControlList-99797d0a.js';
18
+ import GmapVue, { components } from 'gmap-vue';
20
19
  import geohash from 'ngeohash';
21
20
 
22
21
  var setStreaming = Actions.setStreaming,
@@ -108,6 +107,7 @@ var ReactiveMap = {
108
107
  URLParams: VueTypes.bool,
109
108
  autoCenter: VueTypes.bool,
110
109
  getMapRef: VueTypes.func.isRequired,
110
+ getMapPromise: VueTypes.func,
111
111
  center: types.location,
112
112
  defaultCenter: types.location,
113
113
  defaultPin: types.string,
@@ -175,32 +175,37 @@ var ReactiveMap = {
175
175
  }
176
176
  },
177
177
  defaultQuery: function defaultQuery(newVal, oldVal) {
178
+ var _this = this;
178
179
  if (!isQueryIdentical(newVal, oldVal, null, this.$props)) {
179
- var options = getQueryOptions(this.$props);
180
- options.from = 0;
181
- this.$defaultQuery = newVal(null, this.$props);
182
- var _ref = this.$defaultQuery || {},
183
- sort = _ref.sort,
184
- query = _ref.query;
185
- if (sort) {
186
- options.sort = this.$defaultQuery.sort;
187
- }
188
- var queryOptions = getOptionsFromQuery(this.$defaultQuery);
189
- if (queryOptions) {
190
- options = _extends({}, options, getOptionsFromQuery(this.$defaultQuery));
191
- }
192
- // Update calculated default query in store
193
- this.setQueryOptions(this.$props.componentId, options, false);
194
- var persistMapQuery = true;
195
- var forceExecute = true;
196
- // Update default query to include the geo bounding box query
197
- this.setDefaultQueryForRSAPI();
198
- var meta = {
199
- mapBoxBounds: this.mapBoxBounds
200
- };
201
- this.setMapData(this.componentId, query, persistMapQuery, forceExecute, meta);
202
- this.currentPageState = 0;
203
- this.from = 0;
180
+ this.getMapPromise().then(function () {
181
+ var options = getQueryOptions(_this.$props);
182
+ options.from = 0;
183
+ _this.$defaultQuery = newVal(null, _this.$props);
184
+ // Update default query to include the geo bounding box query
185
+ _this.setDefaultQueryForRSAPI();
186
+ if (_this.$defaultQuery) {
187
+ var _ref = _this.$defaultQuery || {},
188
+ sort = _ref.sort,
189
+ query = _ref.query;
190
+ if (sort) {
191
+ options.sort = _this.$defaultQuery.sort;
192
+ }
193
+ var queryOptions = getOptionsFromQuery(_this.$defaultQuery);
194
+ if (queryOptions) {
195
+ options = _extends({}, options, getOptionsFromQuery(_this.$defaultQuery));
196
+ }
197
+ // Update calculated default query in store
198
+ _this.setQueryOptions(_this.$props.componentId, options, false);
199
+ var persistMapQuery = true;
200
+ var forceExecute = true;
201
+ var meta = {
202
+ mapBoxBounds: _this.mapBoxBounds
203
+ };
204
+ _this.setMapData(_this.componentId, query, persistMapQuery, forceExecute, meta);
205
+ _this.currentPageState = 0;
206
+ _this.from = 0;
207
+ }
208
+ });
204
209
  }
205
210
  },
206
211
  promotedResults: function promotedResults(newVal, oldVal) {
@@ -228,7 +233,7 @@ var ReactiveMap = {
228
233
  }
229
234
  },
230
235
  rawData: function rawData(newVal, oldVal) {
231
- var _this = this;
236
+ var _this2 = this;
232
237
  if (!isEqual(newVal, oldVal)) {
233
238
  var promotedResults = this.promotedResults,
234
239
  hits = this.hits;
@@ -247,10 +252,10 @@ var ReactiveMap = {
247
252
  filteredResults = [].concat(parsedPromotedResults, filteredResults);
248
253
  }
249
254
  filteredResults = filteredResults.filter(function (item) {
250
- return !!item[_this.dataField];
255
+ return !!item[_this2.dataField];
251
256
  }).map(function (item) {
252
257
  var _extends2;
253
- return _extends({}, item, (_extends2 = {}, _extends2[_this.dataField] = getLocationObject(item[_this.dataField]), _extends2));
258
+ return _extends({}, item, (_extends2 = {}, _extends2[_this2.dataField] = getLocationObject(item[_this2.dataField]), _extends2));
254
259
  });
255
260
  this.filteredResults = this.addNoise(filteredResults);
256
261
  if (this.calculateMarkers) {
@@ -295,15 +300,15 @@ var ReactiveMap = {
295
300
  return this.parseLocation(MAP_CENTER);
296
301
  },
297
302
  addNoise: function addNoise(hits) {
298
- var _this2 = this;
303
+ var _this3 = this;
299
304
  var hitMap = {};
300
305
  var updatedHits = [];
301
306
  hits.forEach(function (item) {
302
307
  var updatedItem = _extends({}, item);
303
- var location = _this2.parseLocation(item[_this2.dataField]);
308
+ var location = _this3.parseLocation(item[_this3.dataField]);
304
309
  var key = JSON.stringify(location);
305
310
  var count = hitMap[key] || 0;
306
- updatedItem[_this2.dataField] = count ? withDistinctLat(location, count) : location;
311
+ updatedItem[_this3.dataField] = count ? withDistinctLat(location, count) : location;
307
312
  updatedHits = [].concat(updatedHits, [updatedItem]);
308
313
  hitMap[key] = count + 1;
309
314
  });
@@ -316,9 +321,9 @@ var ReactiveMap = {
316
321
  return null;
317
322
  },
318
323
  getHitsCenter: function getHitsCenter(hits) {
319
- var _this3 = this;
324
+ var _this4 = this;
320
325
  var data = hits.map(function (hit) {
321
- return hit[_this3.dataField];
326
+ return hit[_this4.dataField];
322
327
  });
323
328
  if (data.length) {
324
329
  var numCoords = data.length;
@@ -357,7 +362,7 @@ var ReactiveMap = {
357
362
  return false;
358
363
  },
359
364
  getCenter: function getCenter(hits) {
360
- var _this4 = this;
365
+ var _this5 = this;
361
366
  if (this.center) {
362
367
  return this.parseLocation(this.center);
363
368
  }
@@ -365,7 +370,7 @@ var ReactiveMap = {
365
370
  if (mapRef && typeof mapRef.getCenter === 'function' && this.$options.preserveCenter) {
366
371
  var currentCenter = mapRef.getCenter();
367
372
  setTimeout(function () {
368
- _this4.$options.preserveCenter = false;
373
+ _this5.$options.preserveCenter = false;
369
374
  }, 100);
370
375
  return this.parseLocation({
371
376
  lat: currentCenter.lat(),
@@ -423,12 +428,14 @@ var ReactiveMap = {
423
428
  // or whenever searchAsMove is true and the map is dragged
424
429
  if (executeUpdate || !this.skipBoundingBox && !this.mapBoxBounds) {
425
430
  this.$defaultQuery = this.getGeoQuery();
426
- var persistMapQuery = !!this.center;
427
- var forceExecute = this.searchAsMove;
428
- var meta = {
429
- mapBoxBounds: this.mapBoxBounds
430
- };
431
- this.setMapData(this.componentId, this.$defaultQuery, persistMapQuery, forceExecute, meta);
431
+ if (this.$defaultQuery) {
432
+ var persistMapQuery = !!this.center;
433
+ var forceExecute = this.searchAsMove;
434
+ var meta = {
435
+ mapBoxBounds: this.mapBoxBounds
436
+ };
437
+ this.setMapData(this.componentId, this.$defaultQuery, persistMapQuery, forceExecute, meta);
438
+ }
432
439
  }
433
440
  this.skipBoundingBox = false;
434
441
  },
@@ -564,7 +571,8 @@ var ReactiveMap = {
564
571
  geo_bounding_box: (_geo_bounding_box = {}, _geo_bounding_box[this.dataField] = boundingBoxCoordinates, _geo_bounding_box)
565
572
  };
566
573
  if (this.$defaultQuery) {
567
- var query = this.$defaultQuery.query;
574
+ var _ref2 = this.$defaultQuery || {},
575
+ query = _ref2.query;
568
576
  if (query) {
569
577
  // adds defaultQuery's query to geo-query
570
578
  // to generate a map query
@@ -632,15 +640,16 @@ var ReactiveMap = {
632
640
  this.$emit('search-as-move', this.searchAsMove);
633
641
  },
634
642
  renderErrorComponent: function renderErrorComponent() {
635
- var renderError = this.$slots.renderError || this.$props.renderError;
643
+ var renderError = this.$scopedSlots.renderError || this.$props.renderError;
636
644
  if (renderError && this.error && !this.isLoading) {
637
645
  return isFunction(renderError) ? renderError(this.error) : renderError;
638
646
  }
639
647
  return null;
640
648
  },
641
649
  renderSearchAsMove: function renderSearchAsMove() {
650
+ var h = this.$createElement;
642
651
  if (this.showSearchAsMove) {
643
- return createVNode("div", {
652
+ return h("div", {
644
653
  "style": {
645
654
  position: 'absolute',
646
655
  bottom: '30px',
@@ -652,29 +661,40 @@ var ReactiveMap = {
652
661
  borderRadius: 2,
653
662
  zIndex: 10000
654
663
  },
655
- "className": getClassName(this.innerClass, 'checkboxContainer') || null
656
- }, [createVNode(Checkbox, {
657
- "type": "checkbox",
664
+ "attrs": {
665
+ "className": getClassName(this.innerClass, 'checkboxContainer') || null
666
+ }
667
+ }, [h(Checkbox, {
668
+ "attrs": {
669
+ "type": "checkbox",
670
+ "id": this.$props.componentId + "-searchasmove",
671
+ "checked": this.searchAsMove,
672
+ "show": true
673
+ },
658
674
  "class": getClassName(this.$props.innerClass, 'checkbox'),
659
- "id": this.$props.componentId + "-searchasmove",
660
- "onClick": this.toggleSearchAsMove,
661
- "checked": this.searchAsMove,
662
- "show": true
663
- }, null), createVNode("label", {
664
- "className": getClassName(this.innerClass, 'label') || null,
665
- "for": this.$props.componentId + "-searchasmove"
675
+ "on": {
676
+ "click": this.toggleSearchAsMove
677
+ }
678
+ }), h("label", {
679
+ "attrs": {
680
+ "className": getClassName(this.innerClass, 'label') || null,
681
+ "for": this.$props.componentId + "-searchasmove"
682
+ }
666
683
  }, [this.searchAsMoveLabel])]);
667
684
  }
668
685
  return null;
669
686
  },
670
687
  renderPagination: function renderPagination() {
671
- return createVNode(Pagination, {
672
- "pages": this.pages,
673
- "totalPages": this.totalPages,
674
- "currentPage": this.currentPageState,
675
- "setPage": this.setPage,
676
- "innerClass": this.innerClass
677
- }, null);
688
+ var h = this.$createElement;
689
+ return h(Pagination, {
690
+ "attrs": {
691
+ "pages": this.pages,
692
+ "totalPages": this.totalPages,
693
+ "currentPage": this.currentPageState,
694
+ "setPage": this.setPage,
695
+ "innerClass": this.innerClass
696
+ }
697
+ });
678
698
  }
679
699
  },
680
700
  created: function created() {
@@ -689,73 +709,82 @@ var ReactiveMap = {
689
709
  this.updateComponentProps(this.internalComponent, {
690
710
  from: this.from
691
711
  }, componentTypes.reactiveMap);
712
+ this.setDefaultQueryForRSAPI();
692
713
  },
693
714
  mounted: function mounted() {
694
- if (this.defaultPage < 0 && this.currentPage > 0) {
695
- if (this.$props.URLParams) {
696
- this.setPageURL(this.$props.componentId, this.currentPage, this.$props.componentId, false, true);
715
+ var _this6 = this;
716
+ this.getMapPromise().then(function () {
717
+ if (_this6.defaultPage < 0 && _this6.currentPage > 0) {
718
+ if (_this6.$props.URLParams) {
719
+ _this6.setPageURL(_this6.$props.componentId, _this6.currentPage, _this6.$props.componentId, false, true);
720
+ }
697
721
  }
698
- }
699
- var options = getQueryOptions(this.$props);
700
- options.from = this.$data.from;
701
- if (this.$props.sortBy) {
702
- var _ref2;
703
- options.sort = [(_ref2 = {}, _ref2[this.$props.dataField] = {
704
- order: this.$props.sortBy
705
- }, _ref2)];
706
- }
707
- this.$defaultQuery = null;
708
- if (this.$props.defaultQuery) {
709
- this.$defaultQuery = this.$props.defaultQuery();
710
- options = _extends({}, options, getOptionsFromQuery(this.$defaultQuery));
711
-
712
- // Override sort query with defaultQuery's sort if defined
713
- if (this.$defaultQuery.sort) {
714
- options.sort = this.$defaultQuery.sort;
722
+ var options = getQueryOptions(_this6.$props);
723
+ options.from = _this6.$data.from;
724
+ if (_this6.$props.sortBy) {
725
+ var _ref3;
726
+ options.sort = [(_ref3 = {}, _ref3[_this6.$props.dataField] = {
727
+ order: _this6.$props.sortBy
728
+ }, _ref3)];
715
729
  }
716
- // since we want defaultQuery to be executed anytime
717
- // map component's query is being executed
718
- var persistMapQuery = true;
719
- // no need to forceExecute because setReact() will capture the main query
720
- // and execute the defaultQuery along with it
721
- var forceExecute = false;
730
+ _this6.$defaultQuery = null;
731
+ if (_this6.$props.defaultQuery) {
732
+ _this6.$defaultQuery = _this6.$props.defaultQuery();
733
+ // Update default query for RS API
734
+ _this6.setDefaultQueryForRSAPI();
735
+ if (_this6.$defaultQuery) {
736
+ options = _extends({}, options, getOptionsFromQuery(_this6.$defaultQuery));
722
737
 
723
- // Update default query for RS API
724
- this.setDefaultQueryForRSAPI();
725
- var meta = {
726
- mapBoxBounds: this.mapBoxBounds
727
- };
728
- this.setMapData(this.componentId, this.$defaultQuery.query, persistMapQuery, forceExecute, meta);
729
- } else {
730
- // only apply geo-distance when defaultQuery prop is not set
731
- var query = this.getGeoDistanceQuery();
732
- if (query) {
733
- // - only persist the map query if center prop is set
734
- // - ideally, persist the map query if you want to keep executing it
735
- // whenever there is a change (due to subscription) in the component query
736
- var _persistMapQuery = !!this.center;
738
+ // Override sort query with defaultQuery's sort if defined
739
+ if (_this6.$defaultQuery.sort) {
740
+ options.sort = _this6.$defaultQuery.sort;
741
+ }
742
+ // since we want defaultQuery to be executed anytime
743
+ // map component's query is being executed
744
+ var persistMapQuery = true;
745
+ // no need to forceExecute because setReact() will capture the main query
746
+ // and execute the defaultQuery along with it
747
+ var forceExecute = false;
748
+ var meta = {
749
+ mapBoxBounds: _this6.mapBoxBounds
750
+ };
751
+ if (_this6.$defaultQuery) {
752
+ _this6.setMapData(_this6.componentId, _this6.$defaultQuery.query, persistMapQuery, forceExecute, meta);
753
+ _this6.setQueryOptions(_this6.componentId, options);
754
+ }
755
+ }
756
+ } else {
757
+ // only apply geo-distance when defaultQuery prop is not set
758
+ var query = _this6.getGeoDistanceQuery();
759
+ if (query) {
760
+ // - only persist the map query if center prop is set
761
+ // - ideally, persist the map query if you want to keep executing it
762
+ // whenever there is a change (due to subscription) in the component query
763
+ var _persistMapQuery = !!_this6.center;
737
764
 
738
- // - forceExecute will make sure that the component query + Map query gets executed
739
- // irrespective of the changes in the component query
740
- // - forceExecute will only come into play when searchAsMove is true
741
- // - kindly note that forceExecute may result in one additional network request
742
- // since it bypasses the gatekeeping
743
- var _forceExecute = this.searchAsMove;
744
- // Set meta for `distance` and `coordinates` in selected value
745
- var center = this.center || this.defaultCenter;
746
- var coordinatesObject = this.getArrPosition(center);
747
- var _meta = {
748
- distance: this.defaultRadius,
749
- coordinates: coordinatesObject.lat + ", " + coordinatesObject.lon
750
- };
751
- this.setMapData(this.componentId, query, _persistMapQuery, _forceExecute, _meta);
765
+ // - forceExecute will make sure that the component query + Map query gets executed
766
+ // irrespective of the changes in the component query
767
+ // - forceExecute will only come into play when searchAsMove is true
768
+ // - kindly note that forceExecute may result in one additional network request
769
+ // since it bypasses the gatekeeping
770
+ var _forceExecute = _this6.searchAsMove;
771
+ // Set meta for `distance` and `coordinates` in selected value
772
+ var center = _this6.center || _this6.defaultCenter;
773
+ var coordinatesObject = _this6.getArrPosition(center);
774
+ var _meta = {
775
+ distance: _this6.defaultRadius,
776
+ coordinates: coordinatesObject.lat + ", " + coordinatesObject.lon
777
+ };
778
+ _this6.setMapData(_this6.componentId, query, _persistMapQuery, _forceExecute, _meta);
779
+ }
780
+ _this6.setQueryOptions(_this6.componentId, options);
752
781
  }
753
- }
754
- this.setQueryOptions(this.componentId, options, !(this.$defaultQuery && this.$defaultQuery.query));
782
+ });
755
783
  },
756
784
  render: function render() {
757
- var loader = this.$slots.loader || this.$props.loader;
758
- return createVNode("div", {
785
+ var h = arguments[0];
786
+ var loader = this.$scopedSlots.loader || this.$props.loader;
787
+ return h("div", {
759
788
  "style": _extends({}, style, this.$props.style),
760
789
  "class": this.$props.className
761
790
  }, [this.renderErrorComponent(), this.isLoading && loader, this.hasCustomRender ? this.getComponent() : null, this.renderMap(this.getMapParams()), this.pagination ? this.renderPagination() : null]);
@@ -827,7 +856,7 @@ var infoWindowMappedProps = {
827
856
  */
828
857
  function bindEvents(vueInst, googleMapsInst, events) {
829
858
  events.forEach(function (eventName) {
830
- if (vueInst.$gmapOptions.autoBindAllEvents || vueInst.$attrs[eventName]) {
859
+ if (vueInst.$gmapOptions.autoBindAllEvents || vueInst.$listeners[eventName]) {
831
860
  googleMapsInst.addListener(eventName, function (ev) {
832
861
  vueInst.$emit(eventName, ev);
833
862
  });
@@ -950,7 +979,7 @@ function bindProps(vueInst, googleMapsInst, props) {
950
979
  googleMapsInst[setMethodName](vueInst[attribute]);
951
980
  }, vueInst[attribute] !== undefined);
952
981
  }
953
- if (twoWay && (vueInst.$gmapOptions.autoBindAllEvents || vueInst.$attrs[eventName])) {
982
+ if (twoWay && (vueInst.$gmapOptions.autoBindAllEvents || vueInst.$listeners[eventName])) {
954
983
  googleMapsInst.addListener(eventName, function () {
955
984
  vueInst.$emit(eventName, googleMapsInst[getMethodName]());
956
985
  });
@@ -1085,9 +1114,10 @@ var InfoWindowClusterManager = {
1085
1114
  }
1086
1115
  },
1087
1116
  render: function render() {
1088
- return createVNode("div", null, [createVNode("div", {
1117
+ var h = arguments[0];
1118
+ return h("div", [h("div", {
1089
1119
  "ref": "flyaway"
1090
- }, [this.$slots["default"]()])]);
1120
+ }, [this.$scopedSlots["default"]()])]);
1091
1121
  }
1092
1122
  };
1093
1123
 
@@ -1119,19 +1149,14 @@ var InfoWindowWrapper = {
1119
1149
  }
1120
1150
  },
1121
1151
  render: function render() {
1122
- var _this = this;
1152
+ var h = arguments[0];
1123
1153
  var renderPopover = this.renderPopover,
1124
1154
  events = this.events;
1125
- return createVNode(InfoWindowClusterManager, mergeProps({
1126
- "ref": this.id + "-Info-Window"
1127
- }, {
1128
- props: this.infoWindowProps,
1129
- on: events
1130
- }), {
1131
- "default": function _default() {
1132
- return [createVNode("div", null, [renderPopover(_this.handleClose)])];
1133
- }
1134
- });
1155
+ return h(InfoWindowClusterManager, {
1156
+ "ref": this.id + "-Info-Window",
1157
+ "props": _extends({}, this.infoWindowProps),
1158
+ "on": _extends({}, events)
1159
+ }, [h("div", [renderPopover(this.handleClose)])]);
1135
1160
  }
1136
1161
  };
1137
1162
 
@@ -1301,34 +1326,37 @@ var ClusterMarkers = {
1301
1326
  },
1302
1327
  render: function render() {
1303
1328
  var _this2 = this;
1329
+ var h = arguments[0];
1304
1330
  if (!this.renderPopover) {
1305
1331
  return null;
1306
1332
  }
1307
- return createVNode("div", null, [Object.keys(this.openMarkers).map(function (markerId) {
1333
+ return h("div", [Object.keys(this.openMarkers).map(function (markerId) {
1308
1334
  var marker = _this2.openMarkers[markerId];
1309
1335
  var item = marker.metaData;
1310
- return createVNode(InfoWindowWrapper, {
1336
+ return h(InfoWindowWrapper, {
1311
1337
  "key": markerId + "-InfoWindow",
1312
- "id": markerId,
1313
- "renderPopover": function renderPopover(_handleClose) {
1314
- return _this2.renderPopover({
1315
- item: item,
1316
- handleClose: function handleClose() {
1317
- _handleClose();
1318
- _this2.closeMarker(item);
1338
+ "attrs": {
1339
+ "id": markerId,
1340
+ "renderPopover": function renderPopover(_handleClose) {
1341
+ return _this2.renderPopover({
1342
+ item: item,
1343
+ handleClose: function handleClose() {
1344
+ _handleClose();
1345
+ _this2.closeMarker(item);
1346
+ }
1347
+ });
1348
+ },
1349
+ "marker": marker,
1350
+ "infoWindowProps": {
1351
+ zIndex: 500
1352
+ },
1353
+ "events": {
1354
+ closeclick: function closeclick() {
1355
+ return _this2.closeMarker(marker);
1319
1356
  }
1320
- });
1321
- },
1322
- "marker": marker,
1323
- "infoWindowProps": {
1324
- zIndex: 500
1325
- },
1326
- "events": {
1327
- closeclick: function closeclick() {
1328
- return _this2.closeMarker(marker);
1329
1357
  }
1330
1358
  }
1331
- }, null);
1359
+ });
1332
1360
  })]);
1333
1361
  }
1334
1362
  };
@@ -1339,6 +1367,7 @@ var ClusterManager = connect(function () {
1339
1367
  return null;
1340
1368
  }, mapDispatchToProps$1)(ClusterMarkers);
1341
1369
 
1370
+ var InfoWindow = components.InfoWindow;
1342
1371
  var InfoWindowWrapper$1 = {
1343
1372
  name: 'InfoWindowWrapper',
1344
1373
  props: {
@@ -1361,20 +1390,19 @@ var InfoWindowWrapper$1 = {
1361
1390
  }
1362
1391
  },
1363
1392
  render: function render() {
1364
- var _this = this;
1393
+ var h = arguments[0];
1365
1394
  var renderPopover = this.renderPopover,
1366
1395
  events = this.events;
1367
- return createVNode(InfoWindow, mergeProps({
1368
- "closeclick": "true",
1369
- "ref": this.id + "-Info-Window"
1370
- }, this.infoWindowProps, _transformOn(events)), {
1371
- "default": function _default() {
1372
- return [createVNode("div", null, [renderPopover(_this.handleClose)])];
1373
- }
1374
- });
1396
+ return h(InfoWindow, {
1397
+ "ref": this.id + "-Info-Window",
1398
+ "props": _extends({}, this.infoWindowProps),
1399
+ "on": _extends({}, events)
1400
+ }, [h("div", [renderPopover(this.handleClose)])]);
1375
1401
  }
1376
1402
  };
1377
1403
 
1404
+ var MapElementMixin = components.MapElementMixin;
1405
+
1378
1406
  // Note: This file has been taken from https://github.com/eregnier/vue2-gmap-custom-marker/blob/master/gmap-custom-marker.vue
1379
1407
  var MarkerWithLabel = {
1380
1408
  name: 'MarkerWithLabel',
@@ -1610,22 +1638,26 @@ var MarkerWithLabel = {
1610
1638
  }
1611
1639
  },
1612
1640
  render: function render() {
1613
- return createVNode("div", {
1641
+ var h = arguments[0];
1642
+ return h("div", {
1614
1643
  "style": {
1615
1644
  opacity: this.opacity
1616
1645
  },
1617
- "onmouseover": this.handleMouseOver,
1618
- "onmouseout": this.handleMouseOut,
1619
- "onclick": this.handleClick
1646
+ "on": {
1647
+ "mouseover": this.handleMouseOver,
1648
+ "mouseout": this.handleMouseOut,
1649
+ "click": this.handleClick
1650
+ }
1620
1651
  }, [this.renderMarker()]);
1621
1652
  }
1622
1653
  };
1623
1654
 
1624
- var _templateObject, _templateObject2;
1655
+ var _templateObject, _templateObject2, _templateObject3;
1625
1656
  var MapPin = styled('div')(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n\theight: 24px;\n\twidth: auto;\n\tbackground-color: #fff;\n\tborder-radius: 2px;\n\tcolor: #222;\n\tbox-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.15);\n\tpadding: 3px 6px;\n\tfont-size: 15px;\n"])));
1626
1657
  var MapPinArrow = styled('div')(_templateObject2 || (_templateObject2 = _taggedTemplateLiteralLoose(["\n\tborder-color: rgba(0, 0, 0, 0.2);\n\tborder-style: solid;\n\tborder-width: 0 1px 1px 0;\n\tmargin-left: -6px;\n\tbackground-color: #fff;\n\tmargin-top: -6px;\n\twidth: 12px;\n\theight: 12px;\n\t-webkit-transform: rotate(45deg);\n\t-ms-transform: rotate(45deg);\n\ttransform: rotate(45deg);\n"])));
1627
- var mapPinWrapper = "\n\t&:hover,\n\t&:focus {\n\t\tz-index: 200;\n\t}\n";
1658
+ var mapPinWrapper = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteralLoose(["\n\t&:hover,\n\t&:focus {\n\t\tz-index: 200;\n\t}\n"])));
1628
1659
 
1660
+ var Marker = components.Marker;
1629
1661
  var recordResultClick$2 = Actions.recordResultClick;
1630
1662
  var GoogleMapMarker = {
1631
1663
  name: 'GoogleMapMarker',
@@ -1703,6 +1735,7 @@ var GoogleMapMarker = {
1703
1735
  },
1704
1736
  renderPopoverClick: function renderPopoverClick(item) {
1705
1737
  var _this = this;
1738
+ var h = this.$createElement;
1706
1739
  var additionalProps = {};
1707
1740
  var _this$$props3 = this.$props,
1708
1741
  getPosition = _this$$props3.getPosition,
@@ -1715,35 +1748,38 @@ var GoogleMapMarker = {
1715
1748
  }
1716
1749
  };
1717
1750
  if (item._id in openMarkers) {
1718
- return createVNode(InfoWindowWrapper$1, {
1751
+ return h(InfoWindowWrapper$1, {
1719
1752
  "key": item._id + "-InfoWindow",
1720
- "id": item._id,
1721
- "renderPopover": function renderPopover(_handleClose) {
1722
- return _renderPopover({
1723
- item: item,
1724
- handleClose: function handleClose() {
1725
- _handleClose();
1726
- _this.closeMarker();
1753
+ "attrs": {
1754
+ "id": item._id,
1755
+ "renderPopover": function renderPopover(_handleClose) {
1756
+ return _renderPopover({
1757
+ item: item,
1758
+ handleClose: function handleClose() {
1759
+ _handleClose();
1760
+ _this.closeMarker();
1761
+ }
1762
+ });
1763
+ },
1764
+ "infoWindowProps": {
1765
+ zIndex: 500,
1766
+ position: additionalProps.position,
1767
+ options: additionalProps.defaultOptions
1768
+ },
1769
+ "events": {
1770
+ closeclick: function closeclick() {
1771
+ return _this.closeMarker();
1727
1772
  }
1728
- });
1729
- },
1730
- "infoWindowProps": {
1731
- zIndex: 500,
1732
- position: additionalProps.position,
1733
- options: additionalProps.defaultOptions
1734
- },
1735
- "events": {
1736
- closeclick: function closeclick() {
1737
- return _this.closeMarker();
1738
1773
  }
1739
1774
  }
1740
- }, null);
1775
+ });
1741
1776
  }
1742
1777
  return null;
1743
1778
  }
1744
1779
  },
1745
1780
  render: function render() {
1746
1781
  var _this2 = this;
1782
+ var h = arguments[0];
1747
1783
  var _this$$props4 = this.$props,
1748
1784
  getPosition = _this$$props4.getPosition,
1749
1785
  renderItem = _this$$props4.renderItem,
@@ -1759,70 +1795,74 @@ var GoogleMapMarker = {
1759
1795
  marker.setIcon = this.setIcon;
1760
1796
  var data = renderItem(marker);
1761
1797
  if ('label' in data) {
1762
- return createVNode(MarkerWithLabel, mergeProps({
1798
+ return h(MarkerWithLabel, {
1763
1799
  "key": marker._id,
1764
- "metaData": marker,
1765
- "marker": getPosition(marker),
1766
- "labelAnchor": new window.google.maps.Point(0, 30),
1767
- "handleMouseOver": this.increaseMarkerZIndex,
1768
- "handleMouseOut": this.removeMarkerZIndex,
1769
- "handleClick": this.openMarker,
1770
- "zIndex": markerProps.zIndex
1771
- }, customMarkerProps, {
1772
- "renderMarker": function renderMarker() {
1773
- return createVNode("div", {
1774
- "css": mapPinWrapper
1775
- }, [createVNode(MapPin, null, {
1776
- "default": function _default() {
1777
- return [data.label];
1778
- }
1779
- }), createVNode(MapPinArrow, null, null), renderPopover ? _this2.renderPopoverClick(marker, true) : null]);
1780
- }
1781
- }), null);
1800
+ "attrs": {
1801
+ "metaData": marker,
1802
+ "marker": getPosition(marker),
1803
+ "labelAnchor": new window.google.maps.Point(0, 30),
1804
+ "handleMouseOver": this.increaseMarkerZIndex,
1805
+ "handleMouseOut": this.removeMarkerZIndex,
1806
+ "handleClick": this.openMarker,
1807
+ "zIndex": markerProps.zIndex,
1808
+ "renderMarker": function renderMarker() {
1809
+ return h("div", {
1810
+ "attrs": {
1811
+ "css": mapPinWrapper
1812
+ }
1813
+ }, [h(MapPin, [data.label]), h(MapPinArrow), renderPopover ? _this2.renderPopoverClick(marker, true) : null]);
1814
+ }
1815
+ },
1816
+ "props": _extends({}, customMarkerProps)
1817
+ });
1782
1818
  }
1783
1819
  if ('icon' in data) {
1784
1820
  markerProps.icon = data.icon;
1785
1821
  } else {
1786
- return createVNode(MarkerWithLabel, mergeProps({
1822
+ return h(MarkerWithLabel, {
1787
1823
  "key": marker._id,
1788
- "metaData": marker,
1789
- "marker": getPosition(marker),
1790
- "handleClick": this.openMarker,
1791
- "handleMouseOver": this.increaseMarkerZIndex,
1792
- "handleMouseOut": this.removeMarkerZIndex,
1793
- "zIndex": markerProps.zIndex
1794
- }, customMarkerProps, {
1795
- "renderMarker": function renderMarker() {
1796
- return createVNode("div", {
1797
- "css": mapPinWrapper
1798
- }, [typeof data.custom === 'function' ? data.custom(marker) : data.custom, renderPopover ? _this2.renderPopoverClick(marker, true) : null]);
1799
- }
1800
- }), null);
1824
+ "attrs": {
1825
+ "metaData": marker,
1826
+ "marker": getPosition(marker),
1827
+ "handleClick": this.openMarker,
1828
+ "handleMouseOver": this.increaseMarkerZIndex,
1829
+ "handleMouseOut": this.removeMarkerZIndex,
1830
+ "zIndex": markerProps.zIndex,
1831
+ "renderMarker": function renderMarker() {
1832
+ return h("div", {
1833
+ "attrs": {
1834
+ "css": mapPinWrapper
1835
+ }
1836
+ }, [typeof data.custom === 'function' ? data.custom(marker) : data.custom, renderPopover ? _this2.renderPopoverClick(marker, true) : null]);
1837
+ }
1838
+ },
1839
+ "props": _extends({}, customMarkerProps)
1840
+ });
1801
1841
  }
1802
1842
  } else if (defaultPin) {
1803
1843
  markerProps.icon = {
1804
1844
  url: defaultPin
1805
1845
  };
1806
1846
  }
1807
- return createVNode(Marker, mergeProps({
1847
+ return h(Marker, {
1808
1848
  "key": marker._id,
1809
- "zIndex": markerProps.zIndex,
1810
- "onClick": function onClick() {
1811
- return _this2.openMarker();
1849
+ "attrs": {
1850
+ "zIndex": markerProps.zIndex,
1851
+ "position": getPosition(marker),
1852
+ "options": {
1853
+ metaData: marker
1854
+ },
1855
+ "icon": this.markerIcon || markerProps.icon
1812
1856
  },
1813
- "onMouseover": this.increaseMarkerZIndex,
1814
- "onMouseout": this.removeMarkerZIndex
1815
- }, customMarkerProps, {
1816
- "position": getPosition(marker),
1817
- "options": {
1818
- metaData: marker
1857
+ "on": {
1858
+ "click": function click() {
1859
+ return _this2.openMarker();
1860
+ },
1861
+ "mouseover": this.increaseMarkerZIndex,
1862
+ "mouseout": this.removeMarkerZIndex
1819
1863
  },
1820
- "icon": this.markerIcon || markerProps.icon
1821
- }), {
1822
- "default": function _default() {
1823
- return [renderPopover ? _this2.renderPopoverClick(marker) : null];
1824
- }
1825
- });
1864
+ "props": _extends({}, customMarkerProps)
1865
+ }, [renderPopover ? this.renderPopoverClick(marker) : null]);
1826
1866
  }
1827
1867
  };
1828
1868
  var mapDispatchToProps$2 = {
@@ -1832,6 +1872,7 @@ var GoogleMapMarker$1 = connect(function () {
1832
1872
  return null;
1833
1873
  }, mapDispatchToProps$2)(GoogleMapMarker);
1834
1874
 
1875
+ var Cluster = components.Cluster;
1835
1876
  var GoogleMapMarkers = {
1836
1877
  name: 'GoogleMapMarkers',
1837
1878
  props: {
@@ -1878,6 +1919,7 @@ var GoogleMapMarkers = {
1878
1919
  },
1879
1920
  render: function render() {
1880
1921
  var _this = this;
1922
+ var h = arguments[0];
1881
1923
  var resultsToRender = this.$props.resultsToRender;
1882
1924
  var openMarkers = this.openMarkers;
1883
1925
  var markerProps = {
@@ -1895,64 +1937,70 @@ var GoogleMapMarkers = {
1895
1937
  highlightMarkerOnHover: this.highlightMarkerOnHover
1896
1938
  };
1897
1939
  if (this.showMarkerClusters) {
1898
- return createVNode("div", null, [createVNode(GMapCluster, mergeProps(this.clusterProps, {
1899
- "onclick": function onclick(cluster) {
1900
- var markers = cluster.markers.map(function (i) {
1901
- return i.metaData;
1902
- });
1903
- _this.clickedCluster = cluster;
1904
- _this.clusterMarkers = markers;
1905
- _this.$emit('open-cluster-popover', _this.clusterMarkers);
1940
+ return h("div", [h(Cluster, {
1941
+ "props": _extends({}, this.clusterProps),
1942
+ "on": {
1943
+ "click": function click(cluster) {
1944
+ var markers = cluster.markers.map(function (i) {
1945
+ return i.metaData;
1946
+ });
1947
+ _this.clickedCluster = cluster;
1948
+ _this.clusterMarkers = markers;
1949
+ _this.$emit('open-cluster-popover', _this.clusterMarkers);
1950
+ }
1906
1951
  },
1907
1952
  "ref": "clusterRef"
1908
- }), {
1909
- "default": function _default() {
1910
- return [createVNode(ClusterManager, mergeProps({
1911
- "getPosition": markerProps.getPosition,
1912
- "markers": resultsToRender,
1913
- "defaultPin": markerProps.defaultPin,
1914
- "renderItem": markerProps.renderItem,
1915
- "markerProps": markerProps.markerProps,
1916
- "handlePreserveCenter": markerProps.handlePreserveCenter,
1917
- "autoClosePopover": markerProps.autoClosePopover,
1918
- "renderPopover": markerProps.renderPopover,
1919
- "highlightMarkerOnHover": markerProps.highlightMarkerOnHover
1920
- }, {
1921
- on: _this.$attrs
1922
- }), null)];
1923
- }
1924
- }), this.clickedCluster && this.renderClusterPopover ? createVNode(InfoWindowWrapper$1, {
1925
- "id": "cluster",
1926
- "infoWindowProps": {
1927
- zIndex: 500,
1928
- position: this.getAdditionalProps().position,
1929
- options: this.getAdditionalProps().defaultOptions
1953
+ }, [h(ClusterManager, {
1954
+ "attrs": {
1955
+ "getPosition": markerProps.getPosition,
1956
+ "markers": resultsToRender,
1957
+ "defaultPin": markerProps.defaultPin,
1958
+ "renderItem": markerProps.renderItem,
1959
+ "markerProps": markerProps.markerProps,
1960
+ "handlePreserveCenter": markerProps.handlePreserveCenter,
1961
+ "autoClosePopover": markerProps.autoClosePopover,
1962
+ "renderPopover": markerProps.renderPopover,
1963
+ "highlightMarkerOnHover": markerProps.highlightMarkerOnHover
1930
1964
  },
1931
- "renderPopover": function renderPopover(_handleClose) {
1932
- return _this.renderClusterPopover({
1933
- markers: _this.clusterMarkers,
1934
- cluster: _this.clickedCluster,
1935
- handleClose: function handleClose() {
1936
- _handleClose();
1937
- _this.closeMarker();
1938
- }
1939
- });
1940
- },
1941
- "events": {
1942
- closeclick: this.closeMarker
1965
+ "on": _extends({}, this.$listeners)
1966
+ })]), this.clickedCluster && this.renderClusterPopover ? h(InfoWindowWrapper$1, {
1967
+ "attrs": {
1968
+ "id": "cluster",
1969
+ "infoWindowProps": {
1970
+ zIndex: 500,
1971
+ position: this.getAdditionalProps().position,
1972
+ options: this.getAdditionalProps().defaultOptions
1973
+ },
1974
+ "renderPopover": function renderPopover(_handleClose) {
1975
+ return _this.renderClusterPopover({
1976
+ markers: _this.clusterMarkers,
1977
+ cluster: _this.clickedCluster,
1978
+ handleClose: function handleClose() {
1979
+ _handleClose();
1980
+ _this.closeMarker();
1981
+ }
1982
+ });
1983
+ },
1984
+ "events": {
1985
+ closeclick: this.closeMarker
1986
+ }
1943
1987
  }
1944
- }, null) : null]);
1988
+ }) : null]);
1945
1989
  }
1946
- return createVNode("div", null, [resultsToRender.map(function (marker, index) {
1947
- return createVNode(GoogleMapMarker$1, mergeProps({
1948
- "index": index,
1949
- "marker": marker
1950
- }, markerProps, _this.$attrs), null);
1990
+ return h("div", [resultsToRender.map(function (marker, index) {
1991
+ return h(GoogleMapMarker$1, {
1992
+ "attrs": {
1993
+ "index": index,
1994
+ "marker": marker
1995
+ },
1996
+ "props": _extends({}, markerProps),
1997
+ "on": _extends({}, _this.$listeners)
1998
+ });
1951
1999
  })]);
1952
2000
  }
1953
2001
  };
1954
2002
 
1955
- var _templateObject$1;
2003
+ var Map = components.MapLayer;
1956
2004
  var ReactiveGoogleMap = {
1957
2005
  name: 'ReactiveGoogleMap',
1958
2006
  props: {
@@ -1987,22 +2035,18 @@ var ReactiveGoogleMap = {
1987
2035
  calculateMarkers: VueTypes.func,
1988
2036
  highlightMarkerOnHover: VueTypes.bool.def(true)
1989
2037
  },
1990
- computed: {
1991
- listeners: function listeners() {
1992
- var onRE = /^on[^a-z]/;
1993
- var listeners = {};
1994
- var $attrs = this.$attrs;
1995
- for (var property in $attrs) {
1996
- if (onRE.test(property)) {
1997
- listeners[property] = $attrs[property];
1998
- }
1999
- }
2000
- return listeners;
2001
- }
2038
+ created: function created() {
2039
+ var _this = this;
2040
+ this.mapRefPromiseResolve = null;
2041
+ this.mapRefPromiseRejecter = null;
2042
+ this.mapRefPromise = new Promise(function (resolve, reject) {
2043
+ _this.mapRefPromiseResolver = resolve;
2044
+ _this.mapRefPromiseRejecter = reject;
2045
+ });
2002
2046
  },
2003
2047
  methods: {
2004
2048
  renderMap: function renderMap(_ref) {
2005
- var _this = this;
2049
+ var _this2 = this;
2006
2050
  var resultsToRender = _ref.resultsToRender,
2007
2051
  center = _ref.center,
2008
2052
  zoom = _ref.zoom,
@@ -2014,55 +2058,61 @@ var ReactiveGoogleMap = {
2014
2058
  getPosition = _ref.getPosition,
2015
2059
  autoClosePopover = _ref.autoClosePopover,
2016
2060
  defaultPin = _ref.defaultPin;
2061
+ var h = this.$createElement;
2017
2062
  var style = {
2018
2063
  width: '100%',
2019
2064
  height: '100%',
2020
2065
  position: 'relative'
2021
2066
  };
2022
- return createVNode("div", {
2067
+ return h("div", {
2023
2068
  "style": style
2024
- }, [createVNode(Map, mergeProps({
2069
+ }, [h(Map, {
2025
2070
  "ref": "mapRef",
2026
- "map-type-id": "terrain",
2071
+ "attrs": {
2072
+ "map-type-id": "terrain",
2073
+ "options": {
2074
+ zoomControl: true
2075
+ },
2076
+ "center": center,
2077
+ "zoom": zoom
2078
+ },
2027
2079
  "style": {
2028
2080
  height: '100%'
2029
2081
  },
2030
- "class": css(_templateObject$1 || (_templateObject$1 = _taggedTemplateLiteralLoose(["\n\t\t\t\t\t\t\theight: 100%;\n\t\t\t\t\t\t"]))),
2031
- "options": {
2032
- zoomControl: true
2033
- },
2034
- "center": center,
2035
- "zoom": zoom
2036
- }, this.mapProps, {
2037
- "onzoom_changed": handleZoomChange,
2038
- "ondragend": handleOnDragEnd,
2039
- "onidle": handleOnIdle
2040
- }), {
2041
- "default": function _default() {
2042
- return [_this.showMarkers ? createVNode(GoogleMapMarkers, mergeProps({
2043
- "resultsToRender": resultsToRender,
2044
- "getPosition": getPosition,
2045
- "markerProps": _this.markerProps,
2046
- "clusterProps": _this.clusterProps,
2047
- "handlePreserveCenter": handlePreserveCenter,
2048
- "highlightMarkerOnHover": _this.highlightMarkerOnHover,
2049
- "renderItem": _this.$slots.renderItem ? function () {
2050
- return {
2051
- custom: _this.$slots.renderItem
2052
- };
2053
- } : _this.renderItem,
2054
- "defaultPin": defaultPin,
2055
- "autoClosePopover": autoClosePopover,
2056
- "renderPopover": _this.$slots.renderPopover,
2057
- "renderClusterPopover": _this.$slots.renderClusterPopover,
2058
- "showMarkerClusters": _this.showMarkerClusters
2059
- }, _this.listeners), null) : null];
2082
+ "props": _extends({}, this.mapProps),
2083
+ "on": {
2084
+ "zoom_changed": handleZoomChange,
2085
+ "dragend": handleOnDragEnd,
2086
+ "idle": handleOnIdle
2060
2087
  }
2061
- }), renderSearchAsMove()]);
2088
+ }, [this.showMarkers ? h(GoogleMapMarkers, {
2089
+ "attrs": {
2090
+ "resultsToRender": resultsToRender,
2091
+ "getPosition": getPosition,
2092
+ "markerProps": this.markerProps,
2093
+ "clusterProps": this.clusterProps,
2094
+ "handlePreserveCenter": handlePreserveCenter,
2095
+ "highlightMarkerOnHover": this.highlightMarkerOnHover,
2096
+ "renderItem": this.$scopedSlots.renderItem ? function () {
2097
+ return {
2098
+ custom: _this2.$scopedSlots.renderItem
2099
+ };
2100
+ } : this.renderItem,
2101
+ "defaultPin": defaultPin,
2102
+ "autoClosePopover": autoClosePopover,
2103
+ "renderPopover": this.$scopedSlots.renderPopover,
2104
+ "renderClusterPopover": this.$scopedSlots.renderClusterPopover,
2105
+ "showMarkerClusters": this.showMarkerClusters
2106
+ },
2107
+ "on": _extends({}, this.$listeners)
2108
+ }) : null]), renderSearchAsMove()]);
2062
2109
  },
2063
2110
  getMapRef: function getMapRef() {
2064
2111
  return this.mapRef;
2065
2112
  },
2113
+ getMapRefPromise: function getMapRefPromise() {
2114
+ return this.mapRefPromise;
2115
+ },
2066
2116
  removeMarkers: function removeMarkers() {
2067
2117
  var clusterManagerInstance;
2068
2118
  var currentInstance = this;
@@ -2070,7 +2120,6 @@ var ReactiveGoogleMap = {
2070
2120
  if (currentInstance && currentInstance.$options && currentInstance.$options.name === 'connect-ClusterMarkers') {
2071
2121
  clusterManagerInstance = currentInstance;
2072
2122
  currentInstance = null;
2073
- // TODO: Check if $children works in vue 3
2074
2123
  } else if (currentInstance.$children) {
2075
2124
  var _currentInstance$$chi = currentInstance.$children;
2076
2125
  currentInstance = _currentInstance$$chi[0];
@@ -2084,46 +2133,51 @@ var ReactiveGoogleMap = {
2084
2133
  }
2085
2134
  },
2086
2135
  mounted: function mounted() {
2087
- var _this2 = this;
2136
+ var _this3 = this;
2088
2137
  if (this.$refs.mapRef) {
2089
2138
  this.$refs.mapRef.$mapPromise.then(function (map) {
2090
- _this2.mapRef = map;
2091
- });
2139
+ _this3.mapRef = map;
2140
+ _this3.mapRefPromiseResolver(_this3.mapRef);
2141
+ })["catch"](this.mapRefPromiseRejecter);
2092
2142
  }
2093
2143
  },
2094
2144
  render: function render() {
2095
- return createVNode(RMConnected, mergeProps({
2096
- "getMapRef": this.getMapRef,
2097
- "renderMap": this.renderMap,
2098
- "componentId": this.componentId,
2099
- "className": this.className,
2100
- "dataField": this.dataField,
2101
- "defaultZoom": this.defaultZoom,
2102
- "react": this.react,
2103
- "size": this.size,
2104
- "sortBy": this.sortBy,
2105
- "pagination": this.pagination,
2106
- "URLParams": this.URLParams,
2107
- "defaultSearchAsMove": this.searchAsMove,
2108
- "showSearchAsMove": this.showSearchAsMove,
2109
- "searchAsMoveLabel": this.searchAsMoveLabel,
2110
- "showMarkers": this.showMarkers,
2111
- "markerProps": this.markerProps,
2112
- "autoClosePopover": this.autoClosePopover,
2113
- "defaultPin": this.defaultPin,
2114
- "defaultQuery": this.defaultQuery,
2115
- "autoCenter": this.autoCenter,
2116
- "defaultCenter": this.defaultCenter,
2117
- "defaultRadius": this.defaultRadius,
2118
- "unit": this.unit,
2119
- "pages": this.pages,
2120
- "center": this.center,
2121
- "loader": this.loader,
2122
- "calculateMarkers": this.calculateMarkers
2145
+ var h = arguments[0];
2146
+ return h(RMConnected, _mergeJSXProps([{
2147
+ "attrs": {
2148
+ "getMapRef": this.getMapRef,
2149
+ "getMapPromise": this.getMapRefPromise,
2150
+ "renderMap": this.renderMap,
2151
+ "componentId": this.componentId,
2152
+ "className": this.className,
2153
+ "dataField": this.dataField,
2154
+ "defaultZoom": this.defaultZoom,
2155
+ "react": this.react,
2156
+ "size": this.size,
2157
+ "sortBy": this.sortBy,
2158
+ "pagination": this.pagination,
2159
+ "uRLParams": this.URLParams,
2160
+ "defaultSearchAsMove": this.searchAsMove,
2161
+ "showSearchAsMove": this.showSearchAsMove,
2162
+ "searchAsMoveLabel": this.searchAsMoveLabel,
2163
+ "showMarkers": this.showMarkers,
2164
+ "markerProps": this.markerProps,
2165
+ "autoClosePopover": this.autoClosePopover,
2166
+ "defaultPin": this.defaultPin,
2167
+ "defaultQuery": this.defaultQuery,
2168
+ "autoCenter": this.autoCenter,
2169
+ "defaultCenter": this.defaultCenter,
2170
+ "defaultRadius": this.defaultRadius,
2171
+ "unit": this.unit,
2172
+ "pages": this.pages,
2173
+ "center": this.center,
2174
+ "loader": this.loader,
2175
+ "calculateMarkers": this.calculateMarkers
2176
+ }
2123
2177
  }, {
2124
- scopedSlots: this.$slots,
2125
- on: this.$attrs
2126
- }), null);
2178
+ scopedSlots: this.$scopedSlots,
2179
+ on: this.$listeners
2180
+ }]));
2127
2181
  }
2128
2182
  };
2129
2183
  ReactiveGoogleMap.install = function (Vue, options) {
@@ -2131,7 +2185,7 @@ ReactiveGoogleMap.install = function (Vue, options) {
2131
2185
  if (!options || !options.key) {
2132
2186
  console.error('ReactiveSearch: map key is required to use ReactiveGoogleMap component');
2133
2187
  }
2134
- Vue.use(VueGoogleMaps, {
2188
+ Vue.use(GmapVue, {
2135
2189
  load: {
2136
2190
  key: options.key,
2137
2191
  libraries: 'places'