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