@appbaseio/reactivesearch-vue 1.32.3 → 1.33.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 (59) hide show
  1. package/dist/@appbaseio/reactivesearch-vue.umd.js +1752 -1568
  2. package/dist/@appbaseio/reactivesearch-vue.umd.js.map +1 -1
  3. package/dist/@appbaseio/reactivesearch-vue.umd.min.js +14 -9
  4. package/dist/@appbaseio/reactivesearch-vue.umd.min.js.map +1 -1
  5. package/dist/cjs/{ComponentWrapper-ad3dad02.js → ComponentWrapper-981ab977.js} +7 -6
  6. package/dist/cjs/{DataSearch-b51a5d0f.js → DataSearch-708b183d.js} +11 -8
  7. package/dist/cjs/DataSearch.js +6 -4
  8. package/dist/cjs/DropDown-c479bbb0.js +1 -1
  9. package/dist/cjs/DynamicRangeSlider.js +5 -3
  10. package/dist/cjs/MultiDropdownList.js +10 -6
  11. package/dist/cjs/MultiList.js +11 -6
  12. package/dist/cjs/MultiRange.js +7 -5
  13. package/dist/cjs/PreferencesConsumer-7be03476.js +80 -0
  14. package/dist/cjs/RangeInput.js +7 -5
  15. package/dist/cjs/RangeSlider.js +6 -5
  16. package/dist/cjs/ReactiveBase.js +6 -4
  17. package/dist/cjs/{install-3ebc879c.js → ReactiveComponent-5ff98cce.js} +407 -22
  18. package/dist/cjs/ReactiveComponent.js +48 -340
  19. package/dist/cjs/ReactiveGoogleMap.js +7 -6
  20. package/dist/cjs/ReactiveList.js +6 -5
  21. package/dist/cjs/SelectedFilters.js +2 -2
  22. package/dist/cjs/SingleDropdownList.js +10 -6
  23. package/dist/cjs/SingleList.js +12 -6
  24. package/dist/cjs/SingleRange.js +7 -5
  25. package/dist/cjs/StateProvider.js +3 -3
  26. package/dist/cjs/ToggleButton.js +8 -6
  27. package/dist/cjs/{index-6a167fe0.js → index-08f8dfa3.js} +1 -1
  28. package/dist/cjs/index.js +28 -21
  29. package/dist/cjs/initReactivesearch.js +1 -1
  30. package/dist/cjs/install.js +30 -24
  31. package/dist/cjs/version.js +1 -1
  32. package/dist/es/{ComponentWrapper-424e86fd.js → ComponentWrapper-d5e814a4.js} +7 -6
  33. package/dist/es/{DataSearch-c40e26c7.js → DataSearch-5376d39a.js} +11 -9
  34. package/dist/es/DataSearch.js +5 -4
  35. package/dist/es/DropDown-05a644a5.js +1 -1
  36. package/dist/es/DynamicRangeSlider.js +5 -3
  37. package/dist/es/MultiDropdownList.js +10 -6
  38. package/dist/es/MultiList.js +11 -6
  39. package/dist/es/MultiRange.js +7 -5
  40. package/dist/es/PreferencesConsumer-c30605fe.js +78 -0
  41. package/dist/es/RangeInput.js +7 -5
  42. package/dist/es/RangeSlider.js +6 -5
  43. package/dist/es/ReactiveBase.js +6 -4
  44. package/dist/es/{install-c438014c.js → ReactiveComponent-ee01562d.js} +418 -33
  45. package/dist/es/ReactiveComponent.js +44 -337
  46. package/dist/es/ReactiveGoogleMap.js +7 -6
  47. package/dist/es/ReactiveList.js +6 -5
  48. package/dist/es/SelectedFilters.js +2 -2
  49. package/dist/es/SingleDropdownList.js +10 -6
  50. package/dist/es/SingleList.js +12 -6
  51. package/dist/es/SingleRange.js +7 -5
  52. package/dist/es/StateProvider.js +3 -3
  53. package/dist/es/ToggleButton.js +8 -6
  54. package/dist/es/{index-7788a843.js → index-99c5f9c9.js} +1 -1
  55. package/dist/es/index.js +14 -13
  56. package/dist/es/initReactivesearch.js +1 -1
  57. package/dist/es/install.js +32 -22
  58. package/dist/es/version.js +1 -1
  59. package/package.json +3 -3
@@ -1310,7 +1310,7 @@
1310
1310
  geo: 'geo',
1311
1311
  suggestion: 'suggestion'
1312
1312
  };
1313
- var validProps = exports.validProps = ['type', 'componentType', 'aggregationField', 'aggregationSize', 'distinctField', 'distinctFieldConfig', 'index', 'aggregations', 'dataField', 'includeFields', 'excludeFields', 'size', 'from', 'sortBy', 'sortOptions', 'pagination', 'autoFocus', 'autosuggest', 'debounce', 'defaultValue', 'defaultSuggestions', 'fieldWeights', 'filterLabel', 'fuzziness', 'highlight', 'highlightConfig', 'highlightField', 'nestedField', 'placeholder', 'queryFormat', 'searchOperators', 'enableSynonyms', 'enableQuerySuggestions', 'enablePopularSuggestions', 'queryString', 'categoryField', 'strictSelection', 'selectAllLabel', 'showCheckbox', 'showFilter', 'showSearch', 'showCount', 'showLoadMore', 'loadMoreLabel', 'showMissing', 'missingLabel', 'data', 'showRadio', 'multiSelect', 'includeNullValues', 'interval', 'showHistogram', 'snap', 'stepValue', 'range', 'showSlider', 'parseDate', 'calendarInterval', 'unit', 'enablePopularSuggestions', 'enableRecentSuggestions', 'popularSuggestionsConfig', 'recentSuggestionsConfig', 'indexSuggestionsConfig', 'featuredSuggestionsConfig', 'enablePredictiveSuggestions', 'applyStopwords', 'customStopwords', 'enableIndexSuggestions', 'enableFeaturedSuggestions', 'searchboxId', 'endpoint'];
1313
+ var validProps = exports.validProps = ['type', 'componentType', 'aggregationField', 'aggregationSize', 'distinctField', 'distinctFieldConfig', 'index', 'aggregations', 'dataField', 'includeFields', 'excludeFields', 'size', 'from', 'sortBy', 'sortOptions', 'pagination', 'autoFocus', 'autosuggest', 'debounce', 'defaultValue', 'defaultSuggestions', 'fieldWeights', 'filterLabel', 'fuzziness', 'highlight', 'highlightConfig', 'highlightField', 'nestedField', 'placeholder', 'queryFormat', 'searchOperators', 'enableSynonyms', 'enableQuerySuggestions', 'queryString', 'categoryField', 'strictSelection', 'selectAllLabel', 'showCheckbox', 'showFilter', 'showSearch', 'showCount', 'showLoadMore', 'loadMoreLabel', 'showMissing', 'missingLabel', 'data', 'showRadio', 'multiSelect', 'includeNullValues', 'interval', 'showHistogram', 'snap', 'stepValue', 'range', 'showSlider', 'parseDate', 'calendarInterval', 'unit', 'enablePopularSuggestions', 'enableRecentSuggestions', 'popularSuggestionsConfig', 'recentSuggestionsConfig', 'indexSuggestionsConfig', 'featuredSuggestionsConfig', 'enablePredictiveSuggestions', 'applyStopwords', 'customStopwords', 'enableIndexSuggestions', 'enableFeaturedSuggestions', 'searchboxId', 'endpoint', 'enableEndpointSuggestions'];
1314
1314
  var CLEAR_ALL = exports.CLEAR_ALL = {
1315
1315
  NEVER: 'never',
1316
1316
  ALWAYS: 'always',
@@ -5728,15 +5728,33 @@
5728
5728
  showMissing = props.showMissing,
5729
5729
  missingLabel = props.missingLabel;
5730
5730
  clonedQuery.size = 0;
5731
- clonedQuery.aggs = _defineProperty({}, dataField, {
5732
- terms: _extends({
5733
- field: dataField,
5734
- size: size,
5735
- order: getAggsOrder(sortBy || 'count')
5736
- }, showMissing ? {
5737
- missing: missingLabel
5738
- } : {})
5739
- });
5731
+
5732
+ if (typeof dataField === 'string') {
5733
+ clonedQuery.aggs = _defineProperty({}, dataField, {
5734
+ terms: _extends({
5735
+ field: dataField,
5736
+ size: size,
5737
+ order: getAggsOrder(sortBy || 'count')
5738
+ }, showMissing ? {
5739
+ missing: missingLabel
5740
+ } : {})
5741
+ });
5742
+ } else {
5743
+ var aggs = void 0;
5744
+ [].concat(_toConsumableArray(dataField)).reverse().forEach(function (dataFieldItem) {
5745
+ aggs = _defineProperty({}, dataFieldItem, {
5746
+ terms: _extends({
5747
+ field: dataFieldItem,
5748
+ size: size,
5749
+ order: getAggsOrder(sortBy || 'count')
5750
+ }, showMissing ? {
5751
+ missing: missingLabel
5752
+ } : {}),
5753
+ aggs: aggs
5754
+ });
5755
+ });
5756
+ clonedQuery.aggs = aggs;
5757
+ }
5740
5758
 
5741
5759
  if (props.nestedField) {
5742
5760
  clonedQuery.aggs = {
@@ -7555,6 +7573,7 @@
7555
7573
  index: props.index
7556
7574
  }, queryType === constants$1.queryTypes.suggestion ? _extends({
7557
7575
  enablePopularSuggestions: props.enablePopularSuggestions,
7576
+ enableEndpointSuggestions: props.enableEndpointSuggestions,
7558
7577
  enableRecentSuggestions: props.enableRecentSuggestions,
7559
7578
  popularSuggestionsConfig: props.popularSuggestionsConfig,
7560
7579
  recentSuggestionsConfig: props.recentSuggestionsConfig,
@@ -9444,6 +9463,7 @@
9444
9463
  settings.enableSearchRelevancy = (0, utils.isPropertyDefined)(config.analyticsConfig.enableSearchRelevancy) ? config.analyticsConfig.enableSearchRelevancy : undefined;
9445
9464
  settings.suggestionAnalytics = (0, utils.isPropertyDefined)(config.analyticsConfig.suggestionAnalytics) ? config.analyticsConfig.suggestionAnalytics : undefined;
9446
9465
  settings.useCache = (0, utils.isPropertyDefined)(config.analyticsConfig.useCache) ? config.analyticsConfig.useCache : undefined;
9466
+ settings.queryParams = (0, utils.isPropertyDefined)(config.analyticsConfig.queryParams) ? config.analyticsConfig.queryParams : undefined;
9447
9467
  }
9448
9468
 
9449
9469
  orderOfQueries.forEach(function (component) {
@@ -9456,7 +9476,7 @@
9456
9476
  dispatch(loadPopularSuggestions(searchComponentID));
9457
9477
  }
9458
9478
 
9459
- appbaseRef.reactiveSearchv3(query, settings).then(function (res) {
9479
+ appbaseRef.reactiveSearch(query, settings, settings.queryParams).then(function (res) {
9460
9480
  (0, utils.handleResponse)({
9461
9481
  res: res,
9462
9482
  orderOfQueries: orderOfQueries,
@@ -9933,9 +9953,10 @@
9933
9953
  }
9934
9954
 
9935
9955
  function watchComponent(component, react) {
9956
+ var execute = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
9936
9957
  return function (dispatch) {
9937
9958
  dispatch(updateWatchman(component, react));
9938
- dispatch((0, query.executeQuery)(component));
9959
+ if (execute) dispatch((0, query.executeQuery)(component));
9939
9960
  };
9940
9961
  }
9941
9962
  });
@@ -14920,19 +14941,20 @@
14920
14941
  },
14921
14942
  methods: {
14922
14943
  setReact: function setReact(props) {
14923
- var react = props.react;
14944
+ var react = props.react,
14945
+ executeInitialQuery = props.executeInitialQuery;
14924
14946
 
14925
14947
  if (this.internalComponent) {
14926
14948
  if (react) {
14927
14949
  var newReact = pushToAndClause(react, this.internalComponent);
14928
- this.watchComponent(props.componentId, newReact);
14950
+ this.watchComponent(props.componentId, newReact, executeInitialQuery);
14929
14951
  } else {
14930
14952
  this.watchComponent(props.componentId, {
14931
14953
  and: this.internalComponent
14932
- });
14954
+ }, executeInitialQuery);
14933
14955
  }
14934
14956
  } else {
14935
- this.watchComponent(props.componentId, react);
14957
+ this.watchComponent(props.componentId, react, executeInitialQuery);
14936
14958
  }
14937
14959
  }
14938
14960
  },
@@ -14969,6 +14991,81 @@
14969
14991
  return connect(mapStateToProps, mapDispatchToProps)(ComponentWrapper(component, options));
14970
14992
  });
14971
14993
 
14994
+ var deepValue = function deepValue(o, p) {
14995
+ return p.split('.').reduce(function (a, v) {
14996
+ return a ? a[v] : null;
14997
+ }, o);
14998
+ };
14999
+ /**
15000
+ * PreferencesConsumer reads the preferences from SearchPreferencesContext
15001
+ * and set the props from preferences to the component
15002
+ *
15003
+ */
15004
+
15005
+
15006
+ var PreferencesConsumer = function PreferencesConsumer(component) {
15007
+ return {
15008
+ name: 'PreferencesConsumer',
15009
+ inject: {
15010
+ $searchPreferences: {
15011
+ "default": null
15012
+ }
15013
+ },
15014
+ render: function render(h) {
15015
+ var userProps = this.$attrs;
15016
+ var context = this.$searchPreferences;
15017
+
15018
+ if (!userProps || !userProps.componentId) {
15019
+ throw Error('ReactiveSearch: componentId is required');
15020
+ }
15021
+
15022
+ var componentId = userProps.componentId;
15023
+ var preferencesPath = userProps.preferencesPath;
15024
+ var preferences;
15025
+
15026
+ if (context) {
15027
+ if (preferencesPath) {
15028
+ // read preferences from path
15029
+ preferences = deepValue(context, preferencesPath);
15030
+ } else {
15031
+ preferences = deepValue(context, ['componentSettings', componentId].join('.')); // read preferences from componentSettings
15032
+ }
15033
+ } // Retrieve component specific preferences
15034
+
15035
+
15036
+ var componentProps = userProps;
15037
+
15038
+ if (preferences) {
15039
+ if (preferences.rsConfig) {
15040
+ componentProps = _extends({}, preferences.rsConfig, componentProps);
15041
+ } else {
15042
+ componentProps = _extends({}, preferences, componentProps);
15043
+ }
15044
+
15045
+ if (preferences.enabled !== undefined && !preferences.enabled) {
15046
+ return null;
15047
+ }
15048
+ } // Parse component props
15049
+
15050
+
15051
+ Object.keys(componentProps).forEach(function (p) {
15052
+ if (typeof componentProps[p] === 'string') {
15053
+ if (['defaultQuery', 'customQuery', 'setOption'].includes(p)) {
15054
+ // eslint-disable-next-line
15055
+ componentProps[p] = eval(componentProps[p]);
15056
+ }
15057
+ }
15058
+ });
15059
+ return h(component, {
15060
+ attrs: componentProps,
15061
+ on: this.$listeners,
15062
+ scopedSlots: this.$scopedSlots,
15063
+ slots: this.$slots
15064
+ });
15065
+ }
15066
+ };
15067
+ };
15068
+
14972
15069
  function _extends$2() {
14973
15070
  return _extends$2 = Object.assign ? Object.assign.bind() : function (a) {
14974
15071
  for (var b, c = 1; c < arguments.length; c++) {
@@ -16103,10 +16200,10 @@
16103
16200
  return true;
16104
16201
  };
16105
16202
 
16106
- var RLConnected = ComponentWrapper$1(connect(mapStateToProps$1, mapDispatchtoProps)(ReactiveList), {
16203
+ var RLConnected = PreferencesConsumer(ComponentWrapper$1(connect(mapStateToProps$1, mapDispatchtoProps)(ReactiveList), {
16107
16204
  componentType: constants_1$1.reactiveList,
16108
16205
  internalComponent: ReactiveList.hasInternalComponent()
16109
- });
16206
+ }));
16110
16207
 
16111
16208
  ReactiveList.install = function (Vue) {
16112
16209
  Vue.component(ReactiveList.name, RLConnected);
@@ -16556,7 +16653,7 @@
16556
16653
  */
16557
16654
 
16558
16655
  function AppBase(config) {
16559
- var _URL = urlParserLite((config.endpoint ? config.endpoint.url : '') || config.url),
16656
+ var _URL = urlParserLite((config.endpoint ? config.endpoint.url : config.url) || ''),
16560
16657
  _URL$auth = _URL.auth,
16561
16658
  auth = _URL$auth === undefined ? null : _URL$auth,
16562
16659
  _URL$host = _URL.host,
@@ -17066,7 +17163,7 @@
17066
17163
  */
17067
17164
 
17068
17165
 
17069
- function reactiveSearchApi(query, settings) {
17166
+ function reactiveSearchApi(query, settings, params) {
17070
17167
  var parsedSettings = removeUndefined(settings); // Validate query
17071
17168
 
17072
17169
  var valid = validateRSQuery(query);
@@ -17092,7 +17189,8 @@
17092
17189
  body: body,
17093
17190
  headers: getTelemetryHeaders(this.enableTelemetry, !this.mongodb),
17094
17191
  isRSAPI: true,
17095
- isMongoRequest: !!this.mongodb
17192
+ isMongoRequest: !!this.mongodb,
17193
+ params: params
17096
17194
  });
17097
17195
  }
17098
17196
  /**
@@ -17106,7 +17204,7 @@
17106
17204
  */
17107
17205
 
17108
17206
 
17109
- function reactiveSearchv3Api(query, settings) {
17207
+ function reactiveSearchv3Api(query, settings, params) {
17110
17208
  var parsedSettings = removeUndefined(settings); // Validate query
17111
17209
 
17112
17210
  var valid = validateRSQuery(query);
@@ -17132,7 +17230,8 @@
17132
17230
  body: body,
17133
17231
  headers: getTelemetryHeaders(this.enableTelemetry, !this.mongodb),
17134
17232
  isRSAPI: true,
17135
- isMongoRequest: !!this.mongodb
17233
+ isMongoRequest: !!this.mongodb,
17234
+ params: params
17136
17235
  });
17137
17236
  }
17138
17237
  /**
@@ -17950,12 +18049,14 @@
17950
18049
  getSearchParams: types.func,
17951
18050
  setSearchParams: types.func,
17952
18051
  mongodb: types.mongodb,
17953
- endpoint: types.endpointConfig
18052
+ endpoint: types.endpointConfig,
18053
+ preferences: VueTypes.object
17954
18054
  },
17955
18055
  provide: function provide() {
17956
18056
  return {
17957
18057
  theme_reactivesearch: composeThemeObject(getTheme(this.$props.themePreset), this.$props.theme),
17958
- store: this.store
18058
+ store: this.store,
18059
+ $searchPreferences: this.preferences
17959
18060
  };
17960
18061
  },
17961
18062
  watch: {
@@ -20799,6 +20900,7 @@
20799
20900
 
20800
20901
  updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.currentValue);
20801
20902
  updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.currentValue);
20903
+ this.updateDefaultQueryHandler(this.currentValue, this.$props, false);
20802
20904
  },
20803
20905
  computed: {
20804
20906
  suggestionsList: function suggestionsList() {
@@ -21233,7 +21335,7 @@
21233
21335
 
21234
21336
  checkValueChange(props.componentId, value, props.beforeValueChange, performUpdate);
21235
21337
  },
21236
- updateDefaultQueryHandler: function updateDefaultQueryHandler(value, props) {
21338
+ updateDefaultQueryHandler: function updateDefaultQueryHandler(value, props, execute) {
21237
21339
  if (!value && props.enableDefaultSuggestions === false) {
21238
21340
  // clear Component data from store
21239
21341
  this.resetStoreForComponent(props.componentId);
@@ -21256,13 +21358,13 @@
21256
21358
  updateDefaultQuery(props.componentId, this.setDefaultQuery, props, value);
21257
21359
  }
21258
21360
 
21259
- this.setQueryOptions(this.internalComponent, _extends({}, this.queryOptions, defaultQueryOptions), false);
21361
+ this.setQueryOptions(this.internalComponent, _extends({}, this.queryOptions, defaultQueryOptions), execute);
21260
21362
  this.updateQuery({
21261
21363
  componentId: this.internalComponent,
21262
21364
  query: query,
21263
21365
  value: value,
21264
21366
  componentType: constants_1$1.dataSearch
21265
- });
21367
+ }, execute);
21266
21368
  },
21267
21369
  updateQueryHandler: function updateQueryHandler(componentId, value, props) {
21268
21370
  var customQuery = props.customQuery,
@@ -22119,10 +22221,10 @@
22119
22221
  getRecentSearches: getRecentSearches,
22120
22222
  resetStoreForComponent: resetStoreForComponent
22121
22223
  };
22122
- var DSConnected = ComponentWrapper$1(connect(mapStateToProps$3, mapDispatchToProps$2)(DataSearch), {
22224
+ var DSConnected = PreferencesConsumer(ComponentWrapper$1(connect(mapStateToProps$3, mapDispatchToProps$2)(DataSearch), {
22123
22225
  componentType: constants_1$1.dataSearch,
22124
22226
  internalComponent: DataSearch.hasInternalComponent()
22125
- });
22227
+ }));
22126
22228
 
22127
22229
  DataSearch.install = function (Vue) {
22128
22230
  Vue.component(DataSearch.name, DSConnected);
@@ -23478,13 +23580,13 @@
23478
23580
  setDefaultQuery: setDefaultQuery$2,
23479
23581
  recordSuggestionClick: recordSuggestionClick$1
23480
23582
  };
23481
- var DSConnected$1 = ComponentWrapper$1(connect(mapStateToProps$4, mapDispatchToProps$3)(SearchBox), {
23583
+ var SBConnected = PreferencesConsumer(ComponentWrapper$1(connect(mapStateToProps$4, mapDispatchToProps$3)(SearchBox), {
23482
23584
  componentType: constants_1$1.searchBox,
23483
23585
  internalComponent: true
23484
- });
23586
+ }));
23485
23587
 
23486
23588
  SearchBox.install = function (Vue) {
23487
- Vue.component(SearchBox.name, DSConnected$1);
23589
+ Vue.component(SearchBox.name, SBConnected);
23488
23590
  }; // Add componentType for SSR
23489
23591
 
23490
23592
 
@@ -23754,6 +23856,7 @@
23754
23856
  "name": this.$props.componentId,
23755
23857
  "value": selectAllLabel,
23756
23858
  "readOnly": true,
23859
+ "type": "radio",
23757
23860
  "show": this.$props.showRadio
23758
23861
  },
23759
23862
  "on": {
@@ -23767,7 +23870,9 @@
23767
23870
  "attrs": {
23768
23871
  "for": this.$props.componentId + "-" + selectAllLabel
23769
23872
  }
23770
- }, [selectAllLabel])]) : null, !this.hasCustomRenderer && filteredItemsToRender.length === 0 && !this.isLoading ? this.renderNoResult() : filteredItemsToRender.map(function (item) {
23873
+ }, [h("span", [selectAllLabel, this.$props.showCount && h("span", {
23874
+ "class": getClassName$5(this.$props.innerClass, 'count') || null
23875
+ }, ["\xA0(", this.totalDocumentCount, ")"])])])]) : null, !this.hasCustomRenderer && filteredItemsToRender.length === 0 && !this.isLoading ? this.renderNoResult() : filteredItemsToRender.map(function (item) {
23771
23876
  return h("li", {
23772
23877
  "key": item.key,
23773
23878
  "class": "" + (_this.currentValue === String(item.key) ? 'active' : '')
@@ -24037,6 +24142,7 @@
24037
24142
  rawData: state.rawData[props.componentId],
24038
24143
  isLoading: state.isLoading[props.componentId],
24039
24144
  selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || '',
24145
+ totalDocumentCount: state.hits[props.componentId] && state.hits[props.componentId].total,
24040
24146
  themePreset: state.config.themePreset,
24041
24147
  error: state.error[props.componentId],
24042
24148
  componentProps: state.props[props.componentId],
@@ -24050,10 +24156,10 @@
24050
24156
  setCustomQuery: setCustomQuery$2,
24051
24157
  setDefaultQuery: setDefaultQuery$3
24052
24158
  };
24053
- var ListConnected = ComponentWrapper$1(connect(mapStateToProps$5, mapDispatchtoProps$2)(SingleList), {
24159
+ var ListConnected = PreferencesConsumer(ComponentWrapper$1(connect(mapStateToProps$5, mapDispatchtoProps$2)(SingleList), {
24054
24160
  componentType: constants_1$1.singleList,
24055
24161
  internalComponent: SingleList.hasInternalComponent()
24056
- });
24162
+ }));
24057
24163
 
24058
24164
  SingleList.install = function (Vue) {
24059
24165
  Vue.component(SingleList.name, ListConnected);
@@ -24270,7 +24376,9 @@
24270
24376
  "attrs": {
24271
24377
  "for": this.$props.componentId + "-" + selectAllLabel
24272
24378
  }
24273
- }, [selectAllLabel])]) : null, !this.hasCustomRenderer && filteredItemsToRender.length === 0 && !this.isLoading ? this.renderNoResult() : filteredItemsToRender.map(function (item) {
24379
+ }, [h("span", [selectAllLabel, this.$props.showCount && h("span", {
24380
+ "class": getClassName$6(this.$props.innerClass, 'count')
24381
+ }, ["\xA0(", this.totalDocumentCount, ")"])])])]) : null, !this.hasCustomRenderer && filteredItemsToRender.length === 0 && !this.isLoading ? this.renderNoResult() : filteredItemsToRender.map(function (item) {
24274
24382
  return h("li", {
24275
24383
  "key": item.key,
24276
24384
  "class": "" + (_this2.$data.currentValue[item.key] ? 'active' : '')
@@ -24627,6 +24735,7 @@
24627
24735
  isLoading: state.isLoading[props.componentId],
24628
24736
  selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || null,
24629
24737
  themePreset: state.config.themePreset,
24738
+ totalDocumentCount: state.hits[props.componentId] && state.hits[props.componentId].total,
24630
24739
  error: state.error[props.componentId],
24631
24740
  componentProps: state.props[props.componentId],
24632
24741
  enableAppbase: state.config.enableAppbase
@@ -24644,10 +24753,10 @@
24644
24753
  return true;
24645
24754
  };
24646
24755
 
24647
- var ListConnected$1 = ComponentWrapper$1(connect(mapStateToProps$6, mapDispatchtoProps$3)(MultiList), {
24756
+ var ListConnected$1 = PreferencesConsumer(ComponentWrapper$1(connect(mapStateToProps$6, mapDispatchtoProps$3)(MultiList), {
24648
24757
  componentType: constants_1$1.multiList,
24649
24758
  internalComponent: MultiList.hasInternalComponent()
24650
- });
24759
+ }));
24651
24760
 
24652
24761
  MultiList.install = function (Vue) {
24653
24762
  Vue.component(MultiList.name, ListConnected$1);
@@ -25151,7 +25260,8 @@
25151
25260
 
25152
25261
  if (this.$props.selectAllLabel) {
25153
25262
  selectAll = [{
25154
- key: this.$props.selectAllLabel
25263
+ key: this.$props.selectAllLabel,
25264
+ doc_count: this.totalDocumentCount
25155
25265
  }];
25156
25266
  }
25157
25267
 
@@ -25396,6 +25506,7 @@
25396
25506
  rawData: state.rawData[props.componentId],
25397
25507
  isLoading: state.isLoading[props.componentId],
25398
25508
  selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || '',
25509
+ totalDocumentCount: state.hits[props.componentId] && state.hits[props.componentId].total,
25399
25510
  themePreset: state.config.themePreset,
25400
25511
  error: state.error[props.componentId],
25401
25512
  componentProps: state.props[props.componentId],
@@ -25409,10 +25520,10 @@
25409
25520
  setCustomQuery: setCustomQuery$4,
25410
25521
  setDefaultQuery: setDefaultQuery$5
25411
25522
  };
25412
- var ListConnected$2 = ComponentWrapper$1(connect(mapStateToProps$7, mapDispatchtoProps$4)(SingleDropdownList), {
25523
+ var ListConnected$2 = PreferencesConsumer(ComponentWrapper$1(connect(mapStateToProps$7, mapDispatchtoProps$4)(SingleDropdownList), {
25413
25524
  componentType: constants_1$1.singleDropdownList,
25414
25525
  internalComponent: SingleDropdownList.hasInternalComponent()
25415
- });
25526
+ }));
25416
25527
 
25417
25528
  SingleDropdownList.install = function (Vue) {
25418
25529
  Vue.component(SingleDropdownList.name, ListConnected$2);
@@ -25622,7 +25733,8 @@
25622
25733
 
25623
25734
  if (this.$props.selectAllLabel) {
25624
25735
  selectAll = [{
25625
- key: this.$props.selectAllLabel
25736
+ key: this.$props.selectAllLabel,
25737
+ doc_count: this.totalDocumentCount
25626
25738
  }];
25627
25739
  }
25628
25740
 
@@ -25969,6 +26081,7 @@
25969
26081
  rawData: state.rawData[props.componentId],
25970
26082
  isLoading: state.isLoading[props.componentId],
25971
26083
  selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || null,
26084
+ totalDocumentCount: state.hits[props.componentId] && state.hits[props.componentId].total,
25972
26085
  themePreset: state.config.themePreset,
25973
26086
  error: state.error[props.componentId],
25974
26087
  componentProps: state.props[props.componentId],
@@ -25982,10 +26095,10 @@
25982
26095
  setCustomQuery: setCustomQuery$5,
25983
26096
  setDefaultQuery: setDefaultQuery$6
25984
26097
  };
25985
- var ListConnected$3 = ComponentWrapper$1(connect(mapStateToProps$8, mapDispatchtoProps$5)(MultiDropdownList), {
26098
+ var ListConnected$3 = PreferencesConsumer(ComponentWrapper$1(connect(mapStateToProps$8, mapDispatchtoProps$5)(MultiDropdownList), {
25986
26099
  componentType: constants_1$1.multiDropdownList,
25987
26100
  internalComponent: MultiDropdownList.hasInternalComponent()
25988
- });
26101
+ }));
25989
26102
 
25990
26103
  MultiDropdownList.install = function (Vue) {
25991
26104
  Vue.component(MultiDropdownList.name, ListConnected$3);
@@ -26315,534 +26428,562 @@
26315
26428
  setQueryOptions: setQueryOptions$6,
26316
26429
  setCustomQuery: setCustomQuery$6
26317
26430
  };
26318
- var RcConnected = ComponentWrapper$1(connect(mapStateToProps$9, mapDispatchtoProps$6)(ToggleButton), {
26431
+ var ListConnected$4 = PreferencesConsumer(ComponentWrapper$1(connect(mapStateToProps$9, mapDispatchtoProps$6)(ToggleButton), {
26319
26432
  componentType: constants_1$1.toggleButton
26320
- });
26433
+ }));
26321
26434
 
26322
26435
  ToggleButton.install = function (Vue) {
26323
- Vue.component(ToggleButton.name, RcConnected);
26436
+ Vue.component(ToggleButton.name, ListConnected$4);
26324
26437
  }; // Add componentType for SSR
26325
26438
 
26326
26439
 
26327
26440
  ToggleButton.componentType = constants_1$1.toggleButton;
26328
26441
 
26329
- var _excluded = ["options"];
26330
- var updateQuery$8 = lib_5.updateQuery,
26442
+ /*!
26443
+ * vue-no-ssr v1.1.1
26444
+ * (c) 2018-present egoist <0x142857@gmail.com>
26445
+ * Released under the MIT License.
26446
+ */
26447
+
26448
+ var index$2 = {
26449
+ name: 'NoSsr',
26450
+ functional: true,
26451
+ props: {
26452
+ placeholder: String,
26453
+ placeholderTag: {
26454
+ type: String,
26455
+ "default": 'div'
26456
+ }
26457
+ },
26458
+ render: function render(h, ref) {
26459
+ var parent = ref.parent;
26460
+ var slots = ref.slots;
26461
+ var props = ref.props;
26462
+ var ref$1 = slots();
26463
+ var defaultSlot = ref$1["default"];
26464
+ if (defaultSlot === void 0) defaultSlot = [];
26465
+ var placeholderSlot = ref$1.placeholder;
26466
+
26467
+ if (parent._isMounted) {
26468
+ return defaultSlot;
26469
+ }
26470
+
26471
+ parent.$once('hook:mounted', function () {
26472
+ parent.$forceUpdate();
26473
+ });
26474
+
26475
+ if (props.placeholderTag && (props.placeholder || placeholderSlot)) {
26476
+ return h(props.placeholderTag, {
26477
+ "class": ['no-ssr-placeholder']
26478
+ }, props.placeholder || placeholderSlot);
26479
+ } // Return a placeholder element for each child in the default slot
26480
+ // Or if no children return a single placeholder
26481
+
26482
+
26483
+ return defaultSlot.length > 0 ? defaultSlot.map(function () {
26484
+ return h(false);
26485
+ }) : h(false);
26486
+ }
26487
+ };
26488
+ var vueNoSsr_common = index$2;
26489
+
26490
+ var _templateObject$o;
26491
+ var Slider = index$1('div')(_templateObject$o || (_templateObject$o = _taggedTemplateLiteralLoose(["\n\tmargin-top: 30px;\n\tpadding: 10px;\n\n\t/* component style */\n\t.vue-slider-disabled {\n\t\topacity: 0.5;\n\t\tcursor: not-allowed;\n\t}\n\n\t/* rail style */\n\t.vue-slider-rail {\n\t\tbackground-color: #ccc;\n\t\tborder-radius: 15px;\n\t\theight: 4px;\n\t}\n\n\t/* process style */\n\t.vue-slider-process {\n\t\tbackground-color: #0b6aff;\n\t\tborder-radius: 15px;\n\t}\n\n\t/* mark style */\n\t.vue-slider-mark {\n\t\tz-index: 4;\n\t}\n\n\t.vue-slider-mark:first-child .vue-slider-mark-step,\n\t.vue-slider-mark:last-child .vue-slider-mark-step {\n\t\tdisplay: none;\n\t}\n\n\t.vue-slider-mark-step {\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\tborder-radius: 50%;\n\t\tbackground-color: rgba(0, 0, 0, 0.16);\n\t}\n\n\t.vue-slider-mark-label {\n\t\tfont-size: 14px;\n\t\twhite-space: nowrap;\n\t}\n\n\t/* dot style */\n\t.vue-slider-dot {\n\t\tz-index: 2;\n\t}\n\n\t.vue-slider-dot-handle {\n\t\tcursor: pointer;\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\tborder-radius: 50%;\n\t\tbackground-color: #fff;\n\t\tbox-sizing: border-box;\n\t\tborder: 1px solid #9a9a9a;\n\t\tz-index: 2;\n\t\tbox-shadow: 0.5px 0.5px 2px 1px rgb(0 0 0 / 32%);\n\t}\n\n\t.vue-slider-dot-handle-disabled {\n\t\tcursor: not-allowed;\n\t\tbackground-color: #ccc;\n\t}\n\n\t.vue-slider-dot-tooltip-inner {\n\t\tfont-size: 14px;\n\t\twhite-space: nowrap;\n\t\tpadding: 2px 5px;\n\t\tmin-width: 20px;\n\t\ttext-align: center;\n\t\tcolor: #fff;\n\t\tborder-radius: 5px;\n\t\tborder: 1px solid #3498db;\n\t\tbackground-color: #3498db;\n\t\tbox-sizing: content-box;\n\t}\n\n\t.vue-slider-dot-tooltip-inner::after {\n\t\tcontent: '';\n\t\tposition: absolute;\n\t}\n\n\t.vue-slider-dot-tooltip-inner-top::after {\n\t\ttop: 100%;\n\t\tleft: 50%;\n\t\ttransform: translate(-50%, 0);\n\t\theight: 0;\n\t\twidth: 0;\n\t\tborder-color: transparent;\n\t\tborder-style: solid;\n\t\tborder-width: 5px;\n\t\tborder-top-color: inherit;\n\t}\n\n\t.vue-slider-dot-tooltip-inner-bottom::after {\n\t\tbottom: 100%;\n\t\tleft: 50%;\n\t\ttransform: translate(-50%, 0);\n\t\theight: 0;\n\t\twidth: 0;\n\t\tborder-color: transparent;\n\t\tborder-style: solid;\n\t\tborder-width: 5px;\n\t\tborder-bottom-color: inherit;\n\t}\n\n\t.vue-slider-dot-tooltip-inner-left::after {\n\t\tleft: 100%;\n\t\ttop: 50%;\n\t\ttransform: translate(0, -50%);\n\t\theight: 0;\n\t\twidth: 0;\n\t\tborder-color: transparent;\n\t\tborder-style: solid;\n\t\tborder-width: 5px;\n\t\tborder-left-color: inherit;\n\t}\n\n\t.vue-slider-dot-tooltip-inner-right::after {\n\t\tright: 100%;\n\t\ttop: 50%;\n\t\ttransform: translate(0, -50%);\n\t\theight: 0;\n\t\twidth: 0;\n\t\tborder-color: transparent;\n\t\tborder-style: solid;\n\t\tborder-width: 5px;\n\t\tborder-right-color: inherit;\n\t}\n\n\t.vue-slider-dot-tooltip-wrapper {\n\t\topacity: 0;\n\t\ttransition: all 0.3s;\n\t}\n\t.vue-slider-dot-tooltip-wrapper-show {\n\t\topacity: 1;\n\t}\n\n\t.label-container {\n\t\tmargin: 10px 0;\n\t\twidth: 100%;\n\t}\n\n\t.range-label-right {\n\t\tfloat: right;\n\t}\n"])));
26492
+
26493
+ /**
26494
+ * Caution: Please do not change this file without having a discussion with the Team.
26495
+ * Any change may break the umd build, we're directly replacing the line no: 14
26496
+ * `
26497
+ var s = document.createElement("script");
26498
+ s.setAttribute("src","https://cdn.jsdelivr.net/npm/vue-slider-component@3.2.15/dist/vue-slider-component.umd.min.js");
26499
+ s.onload = function(){
26500
+ var VueSlider = global['vue-slider-component'];
26501
+ components['vue-slider-component'] = VueSlider;
26502
+ }
26503
+ document.head.appendChild(s);
26504
+ ` in rollup umd build process with some script.
26505
+ */
26506
+ // eslint-disable-next-line
26507
+
26508
+ var getComponents = function getComponents() {
26509
+ var components = {
26510
+ NoSSR: vueNoSsr_common
26511
+ };
26512
+
26513
+ {
26514
+ try {
26515
+ // in older versions of nuxt, it's process.BROWSER_BUILD
26516
+ // eslint-disable-next-line
26517
+
26518
+ var s = document.createElement("script");
26519
+ s.setAttribute("src","https://cdn.jsdelivr.net/npm/vue-slider-component@3.2.15/dist/vue-slider-component.umd.min.js");
26520
+ s.onload = function(){
26521
+ var VueSlider = global$1['vue-slider-component'];
26522
+ components['vue-slider-component'] = VueSlider;
26523
+ };
26524
+ document.head.appendChild(s);
26525
+
26526
+ } catch (e) {
26527
+ console.error('Unable to load vue-slider', e);
26528
+ }
26529
+ }
26530
+
26531
+ return components;
26532
+ };
26533
+
26534
+ var addComponent$1 = lib_5.addComponent,
26535
+ removeComponent$1 = lib_5.removeComponent,
26536
+ watchComponent$1 = lib_5.watchComponent,
26537
+ updateQuery$8 = lib_5.updateQuery,
26538
+ setQueryListener$1 = lib_5.setQueryListener,
26331
26539
  setQueryOptions$7 = lib_5.setQueryOptions,
26540
+ setComponentProps$1 = lib_5.setComponentProps,
26332
26541
  setCustomQuery$7 = lib_5.setCustomQuery,
26333
- setDefaultQuery$7 = lib_5.setDefaultQuery;
26334
- var parseHits$1 = lib_8.parseHits,
26542
+ updateComponentProps$2 = lib_5.updateComponentProps;
26543
+ var checkValueChange$7 = lib_8.checkValueChange,
26544
+ getClassName$b = lib_8.getClassName,
26335
26545
  isEqual$b = lib_8.isEqual,
26336
- getCompositeAggsQuery$5 = lib_8.getCompositeAggsQuery,
26337
- getResultStats$3 = lib_8.getResultStats,
26546
+ checkSomePropChange$1 = lib_8.checkSomePropChange,
26338
26547
  extractQueryFromCustomQuery$6 = lib_8.extractQueryFromCustomQuery,
26339
26548
  getOptionsForCustomQuery$6 = lib_8.getOptionsForCustomQuery;
26340
- var ReactiveComponent = {
26341
- name: 'ReactiveComponent',
26549
+ var DynamicRangeSlider = {
26550
+ name: 'DynamicRangeSlider',
26551
+ components: getComponents(),
26342
26552
  props: {
26553
+ beforeValueChange: types.func,
26554
+ className: VueTypes.string.def(''),
26555
+ rangeLabels: types.func,
26343
26556
  componentId: types.stringRequired,
26344
- aggregationField: types.string,
26345
- aggregationSize: VueTypes.number,
26346
- size: VueTypes.number,
26347
- defaultQuery: types.func,
26348
26557
  customQuery: types.func,
26558
+ data: types.data,
26559
+ dataField: types.stringRequired,
26560
+ defaultValue: types.func,
26349
26561
  filterLabel: types.string,
26562
+ innerClass: types.style,
26350
26563
  react: types.react,
26351
26564
  showFilter: VueTypes.bool.def(true),
26565
+ destroyOnUnmount: VueTypes.bool,
26566
+ showCheckbox: VueTypes.bool.def(true),
26567
+ title: types.title,
26352
26568
  URLParams: VueTypes.bool.def(false),
26353
- distinctField: types.string,
26354
- distinctFieldConfig: types.props,
26569
+ sliderOptions: VueTypes.object.def({}),
26570
+ nestedField: types.string,
26355
26571
  index: VueTypes.string,
26572
+ value: types.range,
26356
26573
  endpoint: types.endpointConfig
26357
26574
  },
26575
+ data: function data() {
26576
+ this.internalRangeComponent = this.$props.componentId + "__range__internal";
26577
+ return {
26578
+ currentValue: null,
26579
+ stats: []
26580
+ };
26581
+ },
26358
26582
  created: function created() {
26359
26583
  var _this = this;
26360
26584
 
26361
- var props = this.$props;
26362
- this.internalComponent = null;
26363
- this.$defaultQuery = null; // Set custom query in store
26585
+ var onQueryChange = function onQueryChange() {
26586
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
26587
+ args[_key] = arguments[_key];
26588
+ }
26364
26589
 
26365
- updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.selectedValue);
26366
- var customQuery = props.customQuery,
26367
- componentId = props.componentId,
26368
- filterLabel = props.filterLabel,
26369
- showFilter = props.showFilter,
26370
- URLParams = props.URLParams,
26371
- distinctField = props.distinctField,
26372
- distinctFieldConfig = props.distinctFieldConfig,
26373
- index = props.index;
26590
+ _this.$emit.apply(_this, ['queryChange'].concat(args));
26374
26591
 
26375
- if (this.enableAppbase && this.aggregationField && this.aggregationField !== '') {
26376
- console.warn('Warning(ReactiveSearch): The `aggregationField` prop has been marked as deprecated, please use the `distinctField` prop instead.');
26377
- }
26592
+ _this.$emit.apply(_this, ['query-change'].concat(args));
26593
+ };
26378
26594
 
26379
- if (!this.enableAppbase && (distinctField || distinctFieldConfig)) {
26380
- console.warn('Warning(ReactiveSearch): In order to use the `distinctField` and `distinctFieldConfig` props, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
26381
- }
26595
+ this.setQueryListener(this.$props.componentId, onQueryChange, null); // Update props in store
26382
26596
 
26383
- if (!this.enableAppbase && index) {
26597
+ this.setComponentProps(this.componentId, this.$props, constants_1$1.dynamicRangeSlider);
26598
+ this.setComponentProps(this.internalRangeComponent, this.$props, constants_1$1.dynamicRangeSlider);
26599
+
26600
+ if (!this.enableAppbase && this.$props.index) {
26384
26601
  console.warn('Warning(ReactiveSearch): In order to use the `index` prop, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
26602
+ } // Set custom query in store
26603
+
26604
+
26605
+ updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.currentValue);
26606
+ },
26607
+ mounted: function mounted() {
26608
+ this.setReact();
26609
+ },
26610
+ beforeMount: function beforeMount() {
26611
+ var components = [];
26612
+
26613
+ if (this.$$store) {
26614
+ var _this$$$store$getStat = this.$$store.getState();
26615
+
26616
+ components = _this$$$store$getStat.components;
26385
26617
  }
26386
26618
 
26387
- if (customQuery) {
26388
- var calcCustomQuery = customQuery(this.selectedValue, props);
26389
- var query = extractQueryFromCustomQuery$6(calcCustomQuery);
26390
- var customQueryOptions = calcCustomQuery ? getOptionsForCustomQuery$6(calcCustomQuery) : null;
26619
+ var value = this.$props.value;
26391
26620
 
26392
- if (customQueryOptions) {
26393
- this.setQueryOptions(componentId, _extends({}, customQueryOptions, this.getAggsQuery()), false);
26394
- } else this.setQueryOptions(componentId, this.getAggsQuery(), false);
26621
+ if (this.destroyOnUnmount || components.indexOf(this.componentId) === -1) {
26622
+ this.addComponent(this.componentId);
26623
+ this.addComponent(this.internalRangeComponent);
26395
26624
 
26396
- this.updateQuery({
26397
- componentId: componentId,
26398
- query: query,
26399
- value: this.selectedValue || null,
26400
- label: filterLabel,
26401
- showFilter: showFilter,
26402
- URLParams: URLParams
26403
- });
26625
+ if (Array.isArray(this.selectedValue)) {
26626
+ this.handleChange(this.selectedValue);
26627
+ } else if (this.selectedValue) {
26628
+ this.handleChange(DynamicRangeSlider.parseValue(this.selectedValue, this.$props));
26629
+ } else if (value) {
26630
+ this.handleChange(DynamicRangeSlider.parseValue(value, this.$props));
26631
+ } // get range before executing other queries
26632
+
26633
+
26634
+ this.updateRangeQueryOptions();
26635
+ }
26636
+ },
26637
+ beforeUpdate: function beforeUpdate() {
26638
+ if (!this.currentValue) {
26639
+ this.setDefaultValue(this.range);
26640
+ }
26641
+ },
26642
+ beforeDestroy: function beforeDestroy() {
26643
+ if (this.destroyOnUnmount) {
26644
+ this.removeComponent(this.$props.componentId);
26645
+ this.removeComponent(this.internalRangeComponent);
26404
26646
  }
26647
+ },
26648
+ methods: {
26649
+ isControlled: function isControlled() {
26650
+ if (this.$props.value && this.$listeners) {
26651
+ return true;
26652
+ }
26405
26653
 
26406
- this.setQuery = function (_ref) {
26407
- var options = _ref.options,
26408
- obj = _objectWithoutPropertiesLoose(_ref, _excluded);
26654
+ return false;
26655
+ },
26656
+ setDefaultValue: function setDefaultValue(_ref) {
26657
+ var start = _ref.start,
26658
+ end = _ref.end;
26409
26659
 
26410
- var queryToBeSet = obj.query; // when enableAppbase is true, Backend throws error because of repeated query in request body
26660
+ if (this.$props.defaultValue) {
26661
+ var _this$$props$defaultV = this.$props.defaultValue(start, end),
26662
+ defaultStart = _this$$props$defaultV.start,
26663
+ defaultEnd = _this$$props$defaultV.end;
26411
26664
 
26412
- if (queryToBeSet && queryToBeSet.query) {
26413
- queryToBeSet = queryToBeSet.query;
26665
+ this.handleChange([defaultStart, defaultEnd]);
26666
+ } else if (this.isControlled()) {
26667
+ this.handleChange(DynamicRangeSlider.parseValue(this.$props.value), 'change');
26668
+ } else {
26669
+ this.currentValue = [start, end];
26670
+ }
26671
+ },
26672
+ setReact: function setReact() {
26673
+ if (this.$props.react) {
26674
+ this.watchComponent(this.internalRangeComponent, this.$props.react);
26675
+ this.watchComponent(this.$props.componentId, this.$props.react);
26676
+ } else {
26677
+ this.watchComponent(this.internalRangeComponent, {});
26678
+ this.watchComponent(this.$props.componentId, {});
26679
+ }
26680
+ },
26681
+ rangeQuery: function rangeQuery() {
26682
+ return {
26683
+ min: {
26684
+ min: {
26685
+ field: this.$props.dataField
26686
+ }
26687
+ },
26688
+ max: {
26689
+ max: {
26690
+ field: this.$props.dataField
26691
+ }
26692
+ }
26693
+ };
26694
+ },
26695
+ updateRangeQueryOptions: function updateRangeQueryOptions() {
26696
+ var aggs = {};
26697
+
26698
+ if (this.$props.nestedField) {
26699
+ var _aggs;
26700
+
26701
+ aggs = (_aggs = {}, _aggs[this.$props.nestedField] = {
26702
+ nested: {
26703
+ path: this.$props.nestedField
26704
+ },
26705
+ aggs: this.rangeQuery()
26706
+ }, _aggs);
26707
+ } else {
26708
+ aggs = this.rangeQuery();
26414
26709
  }
26415
26710
 
26416
- var customQueryCalc = _extends({}, options, {
26417
- query: queryToBeSet
26711
+ this.setQueryOptions(this.internalRangeComponent, {
26712
+ aggs: aggs
26418
26713
  });
26714
+ },
26715
+ handleSlider: function handleSlider() {
26716
+ var sliderValues = this.$refs.slider.getValue();
26717
+ var value = this.$props.value;
26419
26718
 
26420
- var rsAPIQuery = customQueryCalc; // handle stored queries
26719
+ if (value === undefined) {
26720
+ this.handleChange(sliderValues);
26721
+ } else {
26722
+ this.$emit('change', {
26723
+ start: sliderValues[0],
26724
+ end: sliderValues[1]
26725
+ });
26726
+ }
26727
+ },
26728
+ handleChange: function handleChange(currentValue) {
26729
+ var _this2 = this;
26421
26730
 
26422
- if (queryToBeSet && queryToBeSet.id) {
26423
- rsAPIQuery = queryToBeSet;
26424
- } // Update customQuery field for RS API
26731
+ // Always keep the values within range
26732
+ var normalizedValue = [this.range ? Math.max(this.range.start, currentValue[0]) : currentValue[0], this.range ? Math.min(this.range.end, currentValue[1]) : currentValue[1]];
26425
26733
 
26734
+ var performUpdate = function performUpdate() {
26735
+ _this2.currentValue = normalizedValue;
26426
26736
 
26427
- _this.setCustomQuery(props.componentId, rsAPIQuery);
26737
+ _this2.updateQueryHandler(normalizedValue, _this2.$props);
26428
26738
 
26429
- if (options) {
26430
- _this.setQueryOptions(props.componentId, _extends({}, _this.getAggsQuery(), options), false);
26431
- }
26739
+ _this2.$emit('valueChange', {
26740
+ start: normalizedValue[0],
26741
+ end: normalizedValue[1]
26742
+ });
26432
26743
 
26433
- _this.updateQuery(_extends({}, obj, {
26434
- query: customQueryCalc.query,
26435
- componentId: props.componentId,
26436
- label: props.filterLabel,
26437
- showFilter: props.showFilter,
26438
- URLParams: props.URLParams
26439
- }));
26440
- };
26744
+ _this2.$emit('value-change', {
26745
+ start: normalizedValue[0],
26746
+ end: normalizedValue[1]
26747
+ });
26748
+ };
26441
26749
 
26442
- if (props.defaultQuery) {
26443
- this.internalComponent = props.componentId + "__internal";
26444
- }
26750
+ checkValueChange$7(this.$props.componentId, {
26751
+ start: normalizedValue[0],
26752
+ end: normalizedValue[1]
26753
+ }, this.$props.beforeValueChange, performUpdate);
26754
+ },
26755
+ updateQueryHandler: function updateQueryHandler(value) {
26756
+ var query = DynamicRangeSlider.defaultQuery(value, this.$props);
26445
26757
 
26446
- if (this.internalComponent && this.$props.defaultQuery) {
26447
- updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.selectedValue);
26448
- this.$defaultQuery = this.$props.defaultQuery(this.selectedValue, this.$props);
26758
+ if (this.$props.customQuery) {
26759
+ var customQueryTobeSet = this.$props.customQuery(value, this.$props);
26760
+ var queryTobeSet = extractQueryFromCustomQuery$6(customQueryTobeSet);
26761
+
26762
+ if (queryTobeSet) {
26763
+ query = queryTobeSet;
26764
+ }
26449
26765
 
26450
- var _query = extractQueryFromCustomQuery$6(this.$defaultQuery);
26766
+ var customQueryOptions = getOptionsForCustomQuery$6(customQueryTobeSet);
26767
+ updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, value);
26768
+ this.setQueryOptions(this.$props.componentId, customQueryOptions, false);
26769
+ }
26451
26770
 
26452
- var queryOptions = getOptionsForCustomQuery$6(this.$defaultQuery);
26771
+ var _ref2 = this.range || {
26772
+ start: value[0],
26773
+ end: value[1]
26774
+ },
26775
+ start = _ref2.start,
26776
+ end = _ref2.end;
26453
26777
 
26454
- if (queryOptions) {
26455
- this.setQueryOptions(this.internalComponent, _extends({}, queryOptions, this.getAggsQuery()), false);
26456
- } else this.setQueryOptions(this.internalComponent, this.getAggsQuery(), false);
26778
+ var currentStart = value[0],
26779
+ currentEnd = value[1]; // check if the slider is at its initial position
26457
26780
 
26781
+ var isInitialValue = currentStart === start && currentEnd === end;
26458
26782
  this.updateQuery({
26459
- componentId: this.internalComponent,
26460
- query: _query
26783
+ componentId: this.$props.componentId,
26784
+ query: query,
26785
+ value: value,
26786
+ label: this.$props.filterLabel,
26787
+ showFilter: this.$props.showFilter && !isInitialValue,
26788
+ URLParams: this.$props.URLParams,
26789
+ componentType: constants_1$1.dynamicRangeSlider
26461
26790
  });
26462
26791
  }
26463
26792
  },
26793
+ computed: {
26794
+ labels: function labels() {
26795
+ if (!this.rangeLabels) return null;
26796
+ return this.rangeLabels(this.range.start, this.range.end);
26797
+ }
26798
+ },
26464
26799
  watch: {
26465
- hits: function hits(newVal, oldVal) {
26466
- if (!isEqual$b(newVal, oldVal)) {
26467
- this.$emit('data', this.getData());
26468
- }
26469
- },
26470
- rawData: function rawData(newVal, oldVal) {
26471
- if (!isEqual$b(newVal, oldVal)) {
26472
- this.$emit('data', this.getData());
26800
+ $props: {
26801
+ deep: true,
26802
+ handler: function handler(newVal) {
26803
+ var _this3 = this;
26804
+
26805
+ var propsKeys = getValidPropsKeys(newVal);
26806
+ checkSomePropChange$1(newVal, this.componentProps, propsKeys, function () {
26807
+ _this3.updateComponentProps(_this3.componentId, newVal, constants_1$1.dynamicRangeSlider);
26808
+
26809
+ _this3.updateComponentProps(_this3.internalRangeComponent, newVal, constants_1$1.dynamicRangeSlider);
26810
+ });
26473
26811
  }
26474
26812
  },
26475
- aggregations: function aggregations(newVal, oldVal) {
26476
- if (!isEqual$b(newVal, oldVal)) {
26477
- this.$emit('data', this.getData());
26478
- }
26813
+ react: function react() {
26814
+ this.setReact();
26479
26815
  },
26480
- aggregationData: function aggregationData(newVal, oldVal) {
26481
- if (!isEqual$b(newVal, oldVal)) {
26482
- this.$emit('data', this.getData());
26483
- }
26816
+ selectedValue: function selectedValue(newValue) {
26817
+ if (isEqual$b(newValue, this.currentValue)) return;
26818
+ var value = newValue || {
26819
+ start: this.range.start,
26820
+ end: this.range.end
26821
+ };
26822
+ this.$emit('change', value);
26823
+ this.handleChange(DynamicRangeSlider.parseValue(value, this.$props));
26484
26824
  },
26485
- promotedResults: function promotedResults(newVal, oldVal) {
26486
- if (!isEqual$b(newVal, oldVal)) {
26487
- this.$emit('data', this.getData());
26488
- }
26825
+ range: function range(newValue, oldValue) {
26826
+ if (isEqual$b(newValue, oldValue) || !this.currentValue) return;
26827
+
26828
+ var _ref3 = this.currentValue || [],
26829
+ currentStart = _ref3[0],
26830
+ currentEnd = _ref3[1];
26831
+
26832
+ var _ref4 = oldValue || {},
26833
+ oldStart = _ref4.start,
26834
+ oldEnd = _ref4.end;
26835
+
26836
+ var newStart = currentStart === oldStart ? newValue.start : currentStart;
26837
+ var newEnd = currentEnd === oldEnd ? newValue.end : currentEnd;
26838
+ this.handleChange([newStart, newEnd]);
26489
26839
  },
26490
- hidden: function hidden(newVal, oldVal) {
26491
- if (!isEqual$b(newVal, oldVal)) {
26492
- this.$emit('data', this.getData());
26840
+ customQuery: function customQuery(newVal, oldVal) {
26841
+ if (!isQueryIdentical(newVal, oldVal, this.$data.currentValue, this.$props)) {
26842
+ this.updateQueryHandler(this.$data.currentValue);
26493
26843
  }
26494
26844
  },
26495
- total: function total(newVal, oldVal) {
26845
+ value: function value(newVal, oldVal) {
26496
26846
  if (!isEqual$b(newVal, oldVal)) {
26497
- this.$emit('data', this.getData());
26498
- }
26499
- },
26500
- time: function time(newVal, oldVal) {
26501
- if (!isEqual$b(newVal, oldVal)) {
26502
- this.$emit('data', this.getData());
26503
- }
26504
- },
26505
- defaultQuery: function defaultQuery(newVal, oldVal) {
26506
- if (newVal && !isQueryIdentical(newVal, oldVal, this.selectedValue, this.$props)) {
26507
- this.$defaultQuery = newVal(this.selectedValue, this.$props);
26508
- var query = extractQueryFromCustomQuery$6(this.$defaultQuery);
26509
- var queryOptions = getOptionsForCustomQuery$6(this.$defaultQuery);
26510
-
26511
- if (queryOptions) {
26512
- this.setQueryOptions(this.internalComponent, _extends({}, queryOptions, this.getAggsQuery()), false);
26513
- } else this.setQueryOptions(this.internalComponent, this.getAggsQuery(), false); // Update default query for RS API
26514
-
26515
-
26516
- updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.selectedValue);
26517
- this.updateQuery({
26518
- componentId: this.internalComponent,
26519
- query: query
26520
- });
26521
- }
26522
- },
26523
- customQuery: function customQuery(newVal, oldVal) {
26524
- if (newVal && !isQueryIdentical(newVal, oldVal, this.selectedValue, this.$props)) {
26525
- var componentId = this.$props.componentId;
26526
- this.$customQuery = newVal(this.selectedValue, this.$props);
26527
- var query = extractQueryFromCustomQuery$6(this.$customQuery);
26528
- var queryOptions = getOptionsForCustomQuery$6(this.$customQuery);
26529
-
26530
- if (queryOptions) {
26531
- this.setQueryOptions(componentId, _extends({}, queryOptions, this.getAggsQuery()), false);
26532
- } else this.setQueryOptions(componentId, this.getAggsQuery(), false); // Update custom query for RS API
26533
-
26534
-
26535
- updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.selectedValue);
26536
- this.updateQuery({
26537
- componentId: componentId,
26538
- query: query
26539
- });
26847
+ this.handleChange(DynamicRangeSlider.parseValue(newVal, this.$props));
26540
26848
  }
26541
26849
  }
26542
26850
  },
26543
26851
  render: function render() {
26544
26852
  var h = arguments[0];
26545
26853
 
26546
- try {
26547
- var dom = this.$scopedSlots["default"];
26548
- var error = this.error,
26549
- isLoading = this.isLoading,
26550
- selectedValue = this.selectedValue;
26551
-
26552
- var propsToBePassed = _extends({
26553
- error: error,
26554
- loading: isLoading
26555
- }, this.getData(), {
26556
- value: selectedValue,
26557
- setQuery: this.setQuery
26558
- });
26559
-
26560
- return h("div", [dom(propsToBePassed)]);
26561
- } catch (e) {
26854
+ if (!this.range || !this.currentValue) {
26562
26855
  return null;
26563
26856
  }
26564
- },
26565
- methods: {
26566
- getAggsQuery: function getAggsQuery() {
26567
- if (this.aggregationField) {
26568
- return {
26569
- aggs: getCompositeAggsQuery$5({
26570
- props: this.$props,
26571
- showTopHits: true,
26572
- value: this.selectedValue
26573
- }).aggs
26574
- };
26575
- }
26576
26857
 
26577
- return {};
26578
- },
26579
- getData: function getData() {
26580
- var hits = this.hits,
26581
- aggregations = this.aggregations,
26582
- aggregationData = this.aggregationData,
26583
- promotedResults = this.promotedResults,
26584
- rawData = this.rawData;
26585
- var filteredResults = parseHits$1(hits);
26858
+ var _this$range = this.range,
26859
+ start = _this$range.start,
26860
+ end = _this$range.end;
26861
+ return h(Container, {
26862
+ "class": this.$props.className
26863
+ }, [this.$props.title && h(Title, {
26864
+ "class": getClassName$b(this.$props.innerClass, 'title')
26865
+ }, [this.$props.title]), h(vueNoSsr_common, [h(Slider, {
26866
+ "class": getClassName$b(this.$props.innerClass, 'slider')
26867
+ }, [h("vue-slider-component", {
26868
+ "ref": "slider",
26869
+ "attrs": {
26870
+ "value": [Math.floor(Math.max(start, this.currentValue[0])), Math.ceil(Math.min(end, this.currentValue[1]))],
26871
+ "min": Math.floor(Math.min(start, this.currentValue[0])),
26872
+ "max": Math.ceil(Math.max(end, this.currentValue[1])),
26873
+ "dotSize": 20,
26874
+ "height": 4,
26875
+ "enable-cross": false,
26876
+ "tooltip": "always"
26877
+ },
26878
+ "on": {
26879
+ "drag-end": this.handleSlider
26880
+ },
26881
+ "props": _extends({}, this.$props.sliderOptions)
26882
+ }), this.labels ? h("div", {
26883
+ "class": "label-container"
26884
+ }, [h("label", {
26885
+ "class": getClassName$b(this.$props.innerClass, 'label') || 'range-label-left'
26886
+ }, [this.labels.start]), h("label", {
26887
+ "class": getClassName$b(this.$props.innerClass, 'label') || 'range-label-right'
26888
+ }, [this.labels.end])]) : null])])]);
26889
+ }
26890
+ };
26586
26891
 
26587
- if (promotedResults.length) {
26588
- var ids = promotedResults.map(function (item) {
26589
- return item._id;
26590
- }).filter(Boolean);
26892
+ DynamicRangeSlider.defaultQuery = function (values, props) {
26893
+ var query = null;
26591
26894
 
26592
- if (ids) {
26593
- filteredResults = filteredResults.filter(function (item) {
26594
- return !ids.includes(item._id);
26595
- });
26596
- }
26895
+ if (Array.isArray(values) && values.length) {
26896
+ var _range;
26597
26897
 
26598
- filteredResults = [].concat(promotedResults, filteredResults);
26898
+ query = {
26899
+ range: (_range = {}, _range[props.dataField] = {
26900
+ gte: values[0],
26901
+ lte: values[1],
26902
+ boost: 2.0
26903
+ }, _range)
26904
+ };
26905
+ }
26906
+
26907
+ if (query && props.nestedField) {
26908
+ return {
26909
+ query: {
26910
+ nested: {
26911
+ path: props.nestedField,
26912
+ query: query
26913
+ }
26599
26914
  }
26915
+ };
26916
+ }
26600
26917
 
26601
- return {
26602
- data: filteredResults,
26603
- aggregationData: aggregationData,
26604
- rawData: rawData,
26605
- aggregations: aggregations,
26606
- promotedData: promotedResults,
26607
- resultStats: this.stats
26608
- };
26609
- }
26610
- },
26611
- computed: {
26612
- stats: function stats() {
26613
- return getResultStats$3(this);
26614
- }
26918
+ return query;
26919
+ };
26920
+
26921
+ DynamicRangeSlider.parseValue = function (value) {
26922
+ if (value) {
26923
+ return Array.isArray(value) ? value : [value.start, value.end];
26615
26924
  }
26925
+
26926
+ return [];
26616
26927
  };
26617
26928
 
26618
- ReactiveComponent.hasInternalComponent = function (props) {
26619
- return !!props.defaultQuery;
26929
+ DynamicRangeSlider.hasInternalComponent = function () {
26930
+ return true;
26620
26931
  };
26621
26932
 
26622
26933
  var mapStateToProps$a = function mapStateToProps(state, props) {
26934
+ var componentId = state.aggregations[props.componentId];
26935
+ var internalRange = state.aggregations[props.componentId + "__range__internal"];
26936
+ var options = componentId && componentId[props.dataField];
26937
+ var range = state.aggregations[props.componentId + "__range__internal"];
26938
+
26939
+ if (props.nestedField) {
26940
+ options = options && componentId[props.dataField][props.nestedField] && componentId[props.dataField][props.nestedField].buckets ? componentId[props.dataField][props.nestedField].buckets : [];
26941
+ range = range && internalRange[props.nestedField].min ? {
26942
+ start: internalRange[props.nestedField].min.value,
26943
+ end: internalRange[props.nestedField].max.value
26944
+ } : null;
26945
+ } else {
26946
+ options = options && componentId[props.dataField].buckets ? componentId[props.dataField].buckets : [];
26947
+ range = range && internalRange.min ? {
26948
+ start: internalRange.min.value,
26949
+ end: internalRange.max.value
26950
+ } : null;
26951
+ }
26952
+
26623
26953
  return {
26624
- aggregations: state.aggregations[props.componentId] && state.aggregations[props.componentId] || null,
26625
- aggregationData: state.compositeAggregations[props.componentId] || [],
26626
- hits: state.hits[props.componentId] && state.hits[props.componentId].hits || [],
26627
- rawData: state.rawData[props.componentId],
26628
- error: state.error[props.componentId],
26629
- isLoading: state.isLoading[props.componentId],
26630
- selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || null,
26631
- promotedResults: state.promotedResults[props.componentId] || [],
26632
- time: state.hits[props.componentId] && state.hits[props.componentId].time || 0,
26633
- total: state.hits[props.componentId] && state.hits[props.componentId].total,
26634
- hidden: state.hits[props.componentId] && state.hits[props.componentId].hidden,
26954
+ options: options,
26955
+ range: range,
26956
+ selectedValue: state.selectedValues[props.componentId] ? state.selectedValues[props.componentId].value : null,
26635
26957
  componentProps: state.props[props.componentId],
26636
26958
  enableAppbase: state.config.enableAppbase
26637
26959
  };
26638
26960
  };
26639
26961
 
26640
26962
  var mapDispatchtoProps$7 = {
26641
- setQueryOptions: setQueryOptions$7,
26963
+ addComponent: addComponent$1,
26964
+ removeComponent: removeComponent$1,
26642
26965
  updateQuery: updateQuery$8,
26966
+ watchComponent: watchComponent$1,
26967
+ setQueryListener: setQueryListener$1,
26968
+ setQueryOptions: setQueryOptions$7,
26969
+ setComponentProps: setComponentProps$1,
26643
26970
  setCustomQuery: setCustomQuery$7,
26644
- setDefaultQuery: setDefaultQuery$7
26971
+ updateComponentProps: updateComponentProps$2
26645
26972
  };
26646
- var RcConnected$1 = ComponentWrapper$1(connect(mapStateToProps$a, mapDispatchtoProps$7)(ReactiveComponent), {
26647
- componentType: constants_1$1.reactiveComponent
26648
- });
26973
+ var RangeConnected = PreferencesConsumer(connect(mapStateToProps$a, mapDispatchtoProps$7)(DynamicRangeSlider));
26649
26974
 
26650
- ReactiveComponent.install = function (Vue) {
26651
- Vue.component(ReactiveComponent.name, RcConnected$1);
26975
+ DynamicRangeSlider.install = function (Vue) {
26976
+ Vue.component(DynamicRangeSlider.name, RangeConnected);
26652
26977
  }; // Add componentType for SSR
26653
26978
 
26654
26979
 
26655
- ReactiveComponent.componentType = constants_1$1.reactiveComponent;
26656
-
26657
- var setValue$2 = lib_5.setValue,
26658
- clearValues = lib_5.clearValues,
26659
- resetValuesToDefault = lib_5.resetValuesToDefault;
26660
- var getClassName$b = lib_8.getClassName,
26661
- handleA11yAction$2 = lib_8.handleA11yAction;
26662
- var SelectedFilters = {
26663
- name: 'SelectedFilters',
26664
- props: {
26665
- className: VueTypes.string.def(''),
26666
- clearAllLabel: VueTypes.string.def('Clear All'),
26667
- innerClass: types.style,
26668
- showClearAll: VueTypes.bool.def(true),
26669
- title: types.title,
26670
- resetToDefault: VueTypes.bool.def(false),
26671
- clearAllBlacklistComponents: VueTypes.array,
26672
- resetToValues: VueTypes.object
26673
- },
26674
- inject: {
26675
- theme: {
26676
- from: 'theme_reactivesearch'
26677
- }
26678
- },
26679
- render: function render() {
26680
- var _this = this;
26681
-
26682
- var h = arguments[0];
26683
-
26684
- if (this.$scopedSlots["default"]) {
26685
- return this.$scopedSlots["default"]({
26686
- components: this.components,
26687
- selectedValues: this.selectedValues,
26688
- clearValues: this.clearValues,
26689
- clearValue: this.clearValue,
26690
- setValue: this.setValue,
26691
- resetValuesToDefault: this.resetValuesToDefault
26692
- });
26693
- }
26694
-
26695
- var filtersToRender = this.renderFilters();
26696
- var hasValues = !!filtersToRender.length;
26697
- return h(Container, {
26698
- "class": filters(this.theme) + " " + (this.$props.className || '')
26699
- }, [this.$props.title && hasValues && h(Title, {
26700
- "class": getClassName$b(this.$props.innerClass, 'title') || ''
26701
- }, [this.$props.title]), filtersToRender, this.$props.showClearAll && hasValues && filtersToRender.length > 1 ? h(Button, {
26702
- "class": getClassName$b(this.$props.innerClass, 'button') || '',
26703
- "on": _extends({}, {
26704
- click: this.clearValues,
26705
- keypress: function keypress(event) {
26706
- return handleA11yAction$2(event, function () {
26707
- return _this.clearValues();
26708
- });
26709
- }
26710
- }),
26711
- "attrs": {
26712
- "tabIndex": "0"
26713
- }
26714
- }, [this.$props.clearAllLabel]) : null]);
26715
- },
26716
- methods: {
26717
- remove: function remove(component, value) {
26718
- if (value === void 0) {
26719
- value = null;
26720
- }
26721
-
26722
- this.setValue(component, null);
26723
- this.$emit('clear', component, value);
26724
- },
26725
- clearValues: function clearValues() {
26726
- var resetToDefault = this.resetToDefault,
26727
- resetToValues = this.resetToValues,
26728
- clearAllBlacklistComponents = this.clearAllBlacklistComponents;
26729
-
26730
- if (resetToDefault) {
26731
- this.resetValuesToDefault(clearAllBlacklistComponents);
26732
- } else {
26733
- this.clearValuesAction(resetToValues, clearAllBlacklistComponents);
26734
- }
26735
-
26736
- this.$emit('clear', resetToValues);
26737
- },
26738
- clearValue: function clearValue(componentId) {
26739
- var resetToDefault = this.resetToDefault,
26740
- resetToValues = this.resetToValues;
26741
-
26742
- if (resetToDefault) {
26743
- this.resetValuesToDefault(this.components.filter(function (component) {
26744
- return component !== componentId;
26745
- }));
26746
- } else {
26747
- this.setValue(componentId, (resetToValues == null ? void 0 : resetToValues[componentId]) || null);
26748
- }
26749
-
26750
- this.$emit('clear', resetToValues == null ? void 0 : resetToValues[componentId]);
26751
- },
26752
- renderValue: function renderValue(value, isArray) {
26753
- var _this2 = this;
26754
-
26755
- if (isArray && value.length) {
26756
- var arrayToRender = value.map(function (item) {
26757
- return _this2.renderValue(item);
26758
- });
26759
- return arrayToRender.join(', ');
26760
- }
26761
-
26762
- if (value && typeof value === 'object') {
26763
- // TODO: support for NestedList
26764
- var label = (typeof value.label === 'string' ? value.label : value.value) || value.key || value.distance || null;
26765
-
26766
- if (value.location) {
26767
- label = value.location + " - " + label;
26768
- }
26769
-
26770
- return label;
26771
- }
26772
-
26773
- return value;
26774
- },
26775
- renderFilterButton: function renderFilterButton(component, keyProp, handleRemove, label) {
26776
- var h = this.$createElement;
26777
- return h(Button, {
26778
- "class": getClassName$b(this.$props.innerClass, 'button') || '',
26779
- "key": keyProp,
26780
- "on": _extends({}, {
26781
- click: handleRemove,
26782
- keypress: function keypress(event) {
26783
- return handleA11yAction$2(event, handleRemove);
26784
- }
26785
- }),
26786
- "attrs": {
26787
- "tabIndex": "0"
26788
- }
26789
- }, [h("span", [label]), h("span", ["\u2715"])]);
26790
- },
26791
- renderFilters: function renderFilters() {
26792
- var _this3 = this;
26793
-
26794
- var selectedValues = this.selectedValues;
26795
- var filterComponents = Object.keys(selectedValues).filter(function (id) {
26796
- return _this3.components.includes(id) && selectedValues[id].showFilter;
26797
- });
26798
- return filterComponents.map(function (component, index) {
26799
- var _selectedValues$compo = selectedValues[component],
26800
- label = _selectedValues$compo.label,
26801
- value = _selectedValues$compo.value;
26802
- var isArray = Array.isArray(value); // default behaviour
26803
-
26804
- if (label && (isArray && value.length || !isArray && value)) {
26805
- var valueToRender = _this3.renderValue(value, isArray);
26806
-
26807
- return _this3.renderFilterButton(component, component + "-" + (index + 1), function () {
26808
- return _this3.remove(component, value);
26809
- }, selectedValues[component].label + ": " + decodeHtml(valueToRender));
26810
- }
26811
-
26812
- return null;
26813
- }).filter(Boolean);
26814
- }
26815
- },
26816
- watch: {
26817
- selectedValues: function selectedValues(newVal) {
26818
- this.$emit('change', newVal);
26819
- }
26820
- }
26821
- };
26822
-
26823
- var mapStateToProps$b = function mapStateToProps(state) {
26824
- return {
26825
- components: state.components,
26826
- selectedValues: state.selectedValues
26827
- };
26828
- };
26829
-
26830
- var mapDispatchtoProps$8 = {
26831
- clearValuesAction: clearValues,
26832
- setValue: setValue$2,
26833
- resetValuesToDefault: resetValuesToDefault
26834
- };
26835
- var RcConnected$2 = connect(mapStateToProps$b, mapDispatchtoProps$8)(SelectedFilters);
26836
-
26837
- SelectedFilters.install = function (Vue) {
26838
- Vue.component(SelectedFilters.name, RcConnected$2);
26839
- };
26980
+ DynamicRangeSlider.componentType = constants_1$1.dynamicRangeSlider;
26840
26981
 
26841
26982
  var updateQuery$9 = lib_5.updateQuery,
26842
26983
  setQueryOptions$8 = lib_5.setQueryOptions,
26843
26984
  setCustomQuery$8 = lib_5.setCustomQuery;
26844
26985
  var isEqual$c = lib_8.isEqual,
26845
- checkValueChange$7 = lib_8.checkValueChange,
26986
+ checkValueChange$8 = lib_8.checkValueChange,
26846
26987
  getClassName$c = lib_8.getClassName,
26847
26988
  getOptionsFromQuery$1 = lib_8.getOptionsFromQuery;
26848
26989
  var SingleRange = {
@@ -26970,7 +27111,7 @@
26970
27111
  _this2.$emit('value-change', currentValue);
26971
27112
  };
26972
27113
 
26973
- checkValueChange$7(props.componentId, currentValue, props.beforeValueChange, performUpdate);
27114
+ checkValueChange$8(props.componentId, currentValue, props.beforeValueChange, performUpdate);
26974
27115
  },
26975
27116
  updateQueryHandler: function updateQueryHandler(value, props) {
26976
27117
  var customQuery = props.customQuery;
@@ -27042,7 +27183,7 @@
27042
27183
  return query;
27043
27184
  };
27044
27185
 
27045
- var mapStateToProps$c = function mapStateToProps(state, props) {
27186
+ var mapStateToProps$b = function mapStateToProps(state, props) {
27046
27187
  return {
27047
27188
  selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || null,
27048
27189
  componentProps: state.props[props.componentId],
@@ -27050,17 +27191,17 @@
27050
27191
  };
27051
27192
  };
27052
27193
 
27053
- var mapDispatchtoProps$9 = {
27194
+ var mapDispatchtoProps$8 = {
27054
27195
  updateQuery: updateQuery$9,
27055
27196
  setQueryOptions: setQueryOptions$8,
27056
27197
  setCustomQuery: setCustomQuery$8
27057
27198
  };
27058
- var RangeConnected = ComponentWrapper$1(connect(mapStateToProps$c, mapDispatchtoProps$9)(SingleRange), {
27199
+ var RangeConnected$1 = PreferencesConsumer(ComponentWrapper$1(connect(mapStateToProps$b, mapDispatchtoProps$8)(SingleRange), {
27059
27200
  componentType: constants_1$1.singleRange
27060
- });
27201
+ }));
27061
27202
 
27062
27203
  SingleRange.install = function (Vue) {
27063
- Vue.component(SingleRange.name, RangeConnected);
27204
+ Vue.component(SingleRange.name, RangeConnected$1);
27064
27205
  }; // Add componentType for SSR
27065
27206
 
27066
27207
 
@@ -27070,7 +27211,7 @@
27070
27211
  setQueryOptions$9 = lib_5.setQueryOptions,
27071
27212
  setCustomQuery$9 = lib_5.setCustomQuery;
27072
27213
  var isEqual$d = lib_8.isEqual,
27073
- checkValueChange$8 = lib_8.checkValueChange,
27214
+ checkValueChange$9 = lib_8.checkValueChange,
27074
27215
  getClassName$d = lib_8.getClassName,
27075
27216
  getOptionsFromQuery$2 = lib_8.getOptionsFromQuery;
27076
27217
  var MultiRange = {
@@ -27179,7 +27320,7 @@
27179
27320
  _this.$emit('value-change', Object.keys(selectedValues));
27180
27321
  };
27181
27322
 
27182
- checkValueChange$8(props.componentId, currentValue, props.beforeValueChange, performUpdate);
27323
+ checkValueChange$9(props.componentId, currentValue, props.beforeValueChange, performUpdate);
27183
27324
  },
27184
27325
  updateQueryHandler: function updateQueryHandler(value, props) {
27185
27326
  var customQuery = props.customQuery;
@@ -27336,7 +27477,7 @@
27336
27477
  return query;
27337
27478
  };
27338
27479
 
27339
- var mapStateToProps$d = function mapStateToProps(state, props) {
27480
+ var mapStateToProps$c = function mapStateToProps(state, props) {
27340
27481
  return {
27341
27482
  selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || null,
27342
27483
  componentProps: state.props[props.componentId],
@@ -27344,417 +27485,98 @@
27344
27485
  };
27345
27486
  };
27346
27487
 
27347
- var mapDispatchtoProps$a = {
27488
+ var mapDispatchtoProps$9 = {
27348
27489
  updateQuery: updateQuery$a,
27349
27490
  setQueryOptions: setQueryOptions$9,
27350
27491
  setCustomQuery: setCustomQuery$9
27351
27492
  };
27352
- var RangeConnected$1 = ComponentWrapper$1(connect(mapStateToProps$d, mapDispatchtoProps$a)(MultiRange), {
27493
+ var RangeConnected$2 = PreferencesConsumer(ComponentWrapper$1(connect(mapStateToProps$c, mapDispatchtoProps$9)(MultiRange), {
27353
27494
  componentType: constants_1$1.multiRange
27354
- });
27495
+ }));
27355
27496
 
27356
27497
  MultiRange.install = function (Vue) {
27357
- Vue.component(MultiRange.name, RangeConnected$1);
27498
+ Vue.component(MultiRange.name, RangeConnected$2);
27358
27499
  }; // Add componentType for SSR
27359
27500
 
27360
27501
 
27361
27502
  MultiRange.componentType = constants_1$1.multiRange;
27362
27503
 
27363
- var ResultCardTitle = {
27364
- name: 'ResultCardTitle',
27365
- render: function render() {
27366
- var h = arguments[0];
27367
- var children = this.$slots["default"];
27368
- return h(Title, helper$1([{}, this.$props]), [children]);
27369
- }
27370
- };
27371
-
27372
- ResultCardTitle.install = function (Vue) {
27373
- Vue.component(ResultCardTitle.name, ResultCardTitle);
27374
- };
27375
-
27376
- var _excluded$1 = ["src"];
27377
- var ResultCardImage = {
27378
- name: 'ResultCardImage',
27504
+ var updateQuery$b = lib_5.updateQuery,
27505
+ setQueryOptions$a = lib_5.setQueryOptions,
27506
+ setCustomQuery$a = lib_5.setCustomQuery;
27507
+ var checkValueChange$a = lib_8.checkValueChange,
27508
+ getClassName$e = lib_8.getClassName,
27509
+ getOptionsFromQuery$3 = lib_8.getOptionsFromQuery,
27510
+ isEqual$e = lib_8.isEqual;
27511
+ var RangeSlider = {
27512
+ name: 'RangeSlider',
27513
+ components: getComponents(),
27514
+ inject: {
27515
+ theme: {
27516
+ from: 'theme_reactivesearch'
27517
+ }
27518
+ },
27519
+ data: function data() {
27520
+ var state = {
27521
+ currentValue: this.$props.range ? [this.$props.range.start, this.$props.range.end] : [],
27522
+ stats: []
27523
+ };
27524
+ return state;
27525
+ },
27379
27526
  props: {
27380
- src: VueTypes.string.isRequired
27527
+ beforeValueChange: types.func,
27528
+ className: VueTypes.string.def(''),
27529
+ range: VueTypes.shape({
27530
+ start: VueTypes.integer.def(0),
27531
+ end: VueTypes.integer.def(10)
27532
+ }),
27533
+ rangeLabels: types.rangeLabels,
27534
+ componentId: types.stringRequired,
27535
+ customQuery: types.func,
27536
+ data: types.data,
27537
+ dataField: types.stringRequired,
27538
+ defaultValue: types.range,
27539
+ value: types.range,
27540
+ filterLabel: types.string,
27541
+ innerClass: types.style,
27542
+ react: types.react,
27543
+ showFilter: VueTypes.bool.def(true),
27544
+ showCheckbox: VueTypes.bool.def(true),
27545
+ title: types.title,
27546
+ URLParams: VueTypes.bool.def(false),
27547
+ sliderOptions: VueTypes.object.def({}),
27548
+ nestedField: types.string,
27549
+ index: VueTypes.string,
27550
+ endpoint: types.endpointConfig
27381
27551
  },
27382
- render: function render() {
27383
- var h = arguments[0];
27384
-
27385
- var _this$$props = this.$props,
27386
- src = _this$$props.src,
27387
- props = _objectWithoutPropertiesLoose(_this$$props, _excluded$1);
27552
+ methods: {
27553
+ handleSliderChange: function handleSliderChange(values) {
27554
+ var value = this.$props.value;
27388
27555
 
27389
- return h(Image$1, helper$1([{
27390
- "style": {
27391
- backgroundImage: "url(" + src + ")"
27556
+ if (value === undefined) {
27557
+ this.handleChange(values);
27558
+ } else {
27559
+ this.$emit('change', {
27560
+ start: values[0],
27561
+ end: values[1]
27562
+ });
27392
27563
  }
27393
- }, props]));
27394
- }
27395
- };
27564
+ },
27565
+ handleSlider: function handleSlider() {
27566
+ var sliderValues = this.$refs.slider.getValue();
27567
+ this.handleSliderChange(sliderValues);
27568
+ },
27569
+ handleChange: function handleChange(currentValue, props) {
27570
+ var _this = this;
27396
27571
 
27397
- ResultCardImage.install = function (Vue) {
27398
- Vue.component(ResultCardImage.name, ResultCardImage);
27399
- };
27572
+ if (props === void 0) {
27573
+ props = this.$props;
27574
+ }
27400
27575
 
27401
- var ResultCardDescription = {
27402
- name: 'ResultCardDescription',
27403
- functional: true,
27404
- render: function render(_, _ref) {
27405
- var props = _ref.props,
27406
- children = _ref.children;
27407
- var h = arguments[0];
27408
- return h("article", helper$1([{}, props]), [children]);
27409
- }
27410
- };
27576
+ var performUpdate = function performUpdate() {
27577
+ _this.currentValue = currentValue;
27411
27578
 
27412
- ResultCardDescription.install = function (Vue) {
27413
- Vue.component(ResultCardDescription.name, ResultCardDescription);
27414
- };
27415
-
27416
- var _excluded$2 = ["href", "target"];
27417
- var ResultCard = {
27418
- name: 'ResultCard',
27419
- components: {
27420
- ResultCardTitle: ResultCardTitle,
27421
- ResultCardImage: ResultCardImage,
27422
- ResultCardDescription: ResultCardDescription
27423
- },
27424
- props: {
27425
- target: VueTypes.string.def('_blank'),
27426
- href: types.string
27427
- },
27428
- render: function render() {
27429
- var h = arguments[0];
27430
- var children = this.$slots["default"];
27431
-
27432
- var _this$$props = this.$props,
27433
- href = _this$$props.href,
27434
- target = _this$$props.target,
27435
- rest = _objectWithoutPropertiesLoose(_this$$props, _excluded$2);
27436
-
27437
- return h(Card, helper$1([{
27438
- "attrs": {
27439
- "href": href,
27440
- "target": target,
27441
- "rel": target === '_blank' ? 'noopener noreferrer' : null
27442
- }
27443
- }, rest]), [children]);
27444
- }
27445
- };
27446
-
27447
- ResultCard.install = function (Vue) {
27448
- Vue.component(ResultCard.name, ResultCard);
27449
- Vue.component(ResultCardTitle.name, ResultCardTitle);
27450
- Vue.component(ResultCardImage.name, ResultCardImage);
27451
- Vue.component(ResultCardDescription.name, ResultCardDescription);
27452
- };
27453
-
27454
- var ResultListContent = {
27455
- name: 'ResultListContent',
27456
- functional: true,
27457
- render: function render(_, _ref) {
27458
- var props = _ref.props,
27459
- children = _ref.children;
27460
- var h = arguments[0];
27461
- return h("article", helper$1([{}, props]), [children]);
27462
- }
27463
- };
27464
-
27465
- ResultListContent.install = function (Vue) {
27466
- Vue.component(ResultListContent.name, ResultListContent);
27467
- };
27468
-
27469
- var ResultListDescription = {
27470
- name: 'ResultListDescription',
27471
- functional: true,
27472
- render: function render(_, _ref) {
27473
- var props = _ref.props,
27474
- children = _ref.children;
27475
- var h = arguments[0];
27476
- return h("div", helper$1([{}, props]), [children]);
27477
- }
27478
- };
27479
-
27480
- ResultListDescription.install = function (Vue) {
27481
- Vue.component(ResultListDescription.name, ResultListDescription);
27482
- };
27483
-
27484
- var _excluded$3 = ["src", "small"];
27485
- var ResultListImage = {
27486
- name: 'ResultListImage',
27487
- props: {
27488
- src: VueTypes.string.isRequired,
27489
- small: VueTypes.bool.def(false)
27490
- },
27491
- render: function render() {
27492
- var h = arguments[0];
27493
-
27494
- var _this$$props = this.$props,
27495
- src = _this$$props.src,
27496
- small = _this$$props.small,
27497
- props = _objectWithoutPropertiesLoose(_this$$props, _excluded$3);
27498
-
27499
- return h(Image, helper$1([{
27500
- "attrs": {
27501
- "src": src,
27502
- "small": small
27503
- }
27504
- }, props]));
27505
- }
27506
- };
27507
-
27508
- ResultListImage.install = function (Vue) {
27509
- Vue.component(ResultListImage.name, ResultListImage);
27510
- };
27511
-
27512
- var ResultListTitle = {
27513
- name: 'ResultListTitle',
27514
- render: function render() {
27515
- var h = arguments[0];
27516
- var children = this.$slots["default"];
27517
- return h(Title, helper$1([{}, this.$props]), [children]);
27518
- }
27519
- };
27520
-
27521
- ResultListTitle.install = function (Vue) {
27522
- Vue.component(ResultListTitle.name, ResultListTitle);
27523
- };
27524
-
27525
- var _excluded$4 = ["href", "target"];
27526
- var ResultList = {
27527
- name: 'ResultList',
27528
- props: {
27529
- href: types.string,
27530
- target: VueTypes.string.def('_blank')
27531
- },
27532
- components: {
27533
- ResultListContent: ResultListContent,
27534
- ResultListDescription: ResultListDescription,
27535
- ResultListImage: ResultListImage,
27536
- ResultListTitle: ResultListTitle
27537
- },
27538
- data: function data() {
27539
- this.__state = {
27540
- hasImage: false,
27541
- isSmall: false
27542
- };
27543
- return this.__state;
27544
- },
27545
- mounted: function mounted() {
27546
- var children = this.$slots["default"];
27547
- var ImageChild = children.find(function (o) {
27548
- return o.componentOptions && o.componentOptions.tag === ResultListImage.name;
27549
- });
27550
-
27551
- if (ImageChild && ImageChild.componentOptions && ImageChild.componentOptions.propsData) {
27552
- this.hasImage = true;
27553
-
27554
- if (ImageChild.componentOptions.propsData.small) {
27555
- this.isSmall = true;
27556
- }
27557
- }
27558
- },
27559
- render: function render() {
27560
- var h = arguments[0];
27561
-
27562
- var _this$$props = this.$props,
27563
- href = _this$$props.href,
27564
- target = _this$$props.target,
27565
- props = _objectWithoutPropertiesLoose(_this$$props, _excluded$4);
27566
-
27567
- var hasImage = this.hasImage,
27568
- isSmall = this.isSmall;
27569
- var children = this.$slots["default"];
27570
- return h(ListItem, helper$1([{
27571
- "attrs": {
27572
- "href": href,
27573
- "image": hasImage,
27574
- "small": isSmall,
27575
- "target": target,
27576
- "rel": target === '_blank' ? 'noopener noreferrer' : null
27577
- }
27578
- }, props]), [children]);
27579
- }
27580
- };
27581
-
27582
- ResultList.install = function (Vue) {
27583
- Vue.component(ResultList.name, ResultList);
27584
- Vue.component(ResultListContent.name, ResultListContent);
27585
- Vue.component(ResultListDescription.name, ResultListDescription);
27586
- Vue.component(ResultListImage.name, ResultListImage);
27587
- Vue.component(ResultListTitle.name, ResultListTitle);
27588
- };
27589
-
27590
- /*!
27591
- * vue-no-ssr v1.1.1
27592
- * (c) 2018-present egoist <0x142857@gmail.com>
27593
- * Released under the MIT License.
27594
- */
27595
-
27596
- var index$2 = {
27597
- name: 'NoSsr',
27598
- functional: true,
27599
- props: {
27600
- placeholder: String,
27601
- placeholderTag: {
27602
- type: String,
27603
- "default": 'div'
27604
- }
27605
- },
27606
- render: function render(h, ref) {
27607
- var parent = ref.parent;
27608
- var slots = ref.slots;
27609
- var props = ref.props;
27610
- var ref$1 = slots();
27611
- var defaultSlot = ref$1["default"];
27612
- if (defaultSlot === void 0) defaultSlot = [];
27613
- var placeholderSlot = ref$1.placeholder;
27614
-
27615
- if (parent._isMounted) {
27616
- return defaultSlot;
27617
- }
27618
-
27619
- parent.$once('hook:mounted', function () {
27620
- parent.$forceUpdate();
27621
- });
27622
-
27623
- if (props.placeholderTag && (props.placeholder || placeholderSlot)) {
27624
- return h(props.placeholderTag, {
27625
- "class": ['no-ssr-placeholder']
27626
- }, props.placeholder || placeholderSlot);
27627
- } // Return a placeholder element for each child in the default slot
27628
- // Or if no children return a single placeholder
27629
-
27630
-
27631
- return defaultSlot.length > 0 ? defaultSlot.map(function () {
27632
- return h(false);
27633
- }) : h(false);
27634
- }
27635
- };
27636
- var vueNoSsr_common = index$2;
27637
-
27638
- var _templateObject$o;
27639
- var Slider = index$1('div')(_templateObject$o || (_templateObject$o = _taggedTemplateLiteralLoose(["\n\tmargin-top: 30px;\n\tpadding: 10px;\n\n\t/* component style */\n\t.vue-slider-disabled {\n\t\topacity: 0.5;\n\t\tcursor: not-allowed;\n\t}\n\n\t/* rail style */\n\t.vue-slider-rail {\n\t\tbackground-color: #ccc;\n\t\tborder-radius: 15px;\n\t\theight: 4px;\n\t}\n\n\t/* process style */\n\t.vue-slider-process {\n\t\tbackground-color: #0b6aff;\n\t\tborder-radius: 15px;\n\t}\n\n\t/* mark style */\n\t.vue-slider-mark {\n\t\tz-index: 4;\n\t}\n\n\t.vue-slider-mark:first-child .vue-slider-mark-step,\n\t.vue-slider-mark:last-child .vue-slider-mark-step {\n\t\tdisplay: none;\n\t}\n\n\t.vue-slider-mark-step {\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\tborder-radius: 50%;\n\t\tbackground-color: rgba(0, 0, 0, 0.16);\n\t}\n\n\t.vue-slider-mark-label {\n\t\tfont-size: 14px;\n\t\twhite-space: nowrap;\n\t}\n\n\t/* dot style */\n\t.vue-slider-dot {\n\t\tz-index: 2;\n\t}\n\n\t.vue-slider-dot-handle {\n\t\tcursor: pointer;\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\tborder-radius: 50%;\n\t\tbackground-color: #fff;\n\t\tbox-sizing: border-box;\n\t\tborder: 1px solid #9a9a9a;\n\t\tz-index: 2;\n\t\tbox-shadow: 0.5px 0.5px 2px 1px rgb(0 0 0 / 32%);\n\t}\n\n\t.vue-slider-dot-handle-disabled {\n\t\tcursor: not-allowed;\n\t\tbackground-color: #ccc;\n\t}\n\n\t.vue-slider-dot-tooltip-inner {\n\t\tfont-size: 14px;\n\t\twhite-space: nowrap;\n\t\tpadding: 2px 5px;\n\t\tmin-width: 20px;\n\t\ttext-align: center;\n\t\tcolor: #fff;\n\t\tborder-radius: 5px;\n\t\tborder: 1px solid #3498db;\n\t\tbackground-color: #3498db;\n\t\tbox-sizing: content-box;\n\t}\n\n\t.vue-slider-dot-tooltip-inner::after {\n\t\tcontent: '';\n\t\tposition: absolute;\n\t}\n\n\t.vue-slider-dot-tooltip-inner-top::after {\n\t\ttop: 100%;\n\t\tleft: 50%;\n\t\ttransform: translate(-50%, 0);\n\t\theight: 0;\n\t\twidth: 0;\n\t\tborder-color: transparent;\n\t\tborder-style: solid;\n\t\tborder-width: 5px;\n\t\tborder-top-color: inherit;\n\t}\n\n\t.vue-slider-dot-tooltip-inner-bottom::after {\n\t\tbottom: 100%;\n\t\tleft: 50%;\n\t\ttransform: translate(-50%, 0);\n\t\theight: 0;\n\t\twidth: 0;\n\t\tborder-color: transparent;\n\t\tborder-style: solid;\n\t\tborder-width: 5px;\n\t\tborder-bottom-color: inherit;\n\t}\n\n\t.vue-slider-dot-tooltip-inner-left::after {\n\t\tleft: 100%;\n\t\ttop: 50%;\n\t\ttransform: translate(0, -50%);\n\t\theight: 0;\n\t\twidth: 0;\n\t\tborder-color: transparent;\n\t\tborder-style: solid;\n\t\tborder-width: 5px;\n\t\tborder-left-color: inherit;\n\t}\n\n\t.vue-slider-dot-tooltip-inner-right::after {\n\t\tright: 100%;\n\t\ttop: 50%;\n\t\ttransform: translate(0, -50%);\n\t\theight: 0;\n\t\twidth: 0;\n\t\tborder-color: transparent;\n\t\tborder-style: solid;\n\t\tborder-width: 5px;\n\t\tborder-right-color: inherit;\n\t}\n\n\t.vue-slider-dot-tooltip-wrapper {\n\t\topacity: 0;\n\t\ttransition: all 0.3s;\n\t}\n\t.vue-slider-dot-tooltip-wrapper-show {\n\t\topacity: 1;\n\t}\n\n\t.label-container {\n\t\tmargin: 10px 0;\n\t\twidth: 100%;\n\t}\n\n\t.range-label-right {\n\t\tfloat: right;\n\t}\n"])));
27640
-
27641
- /**
27642
- * Caution: Please do not change this file without having a discussion with the Team.
27643
- * Any change may break the umd build, we're directly replacing the line no: 14
27644
- * `
27645
- var s = document.createElement("script");
27646
- s.setAttribute("src","https://cdn.jsdelivr.net/npm/vue-slider-component@3.2.15/dist/vue-slider-component.umd.min.js");
27647
- s.onload = function(){
27648
- var VueSlider = global['vue-slider-component'];
27649
- components['vue-slider-component'] = VueSlider;
27650
- }
27651
- document.head.appendChild(s);
27652
- ` in rollup umd build process with some script.
27653
- */
27654
- // eslint-disable-next-line
27655
-
27656
- var getComponents = function getComponents() {
27657
- var components = {
27658
- NoSSR: vueNoSsr_common
27659
- };
27660
-
27661
- {
27662
- try {
27663
- // in older versions of nuxt, it's process.BROWSER_BUILD
27664
- // eslint-disable-next-line
27665
-
27666
- var s = document.createElement("script");
27667
- s.setAttribute("src","https://cdn.jsdelivr.net/npm/vue-slider-component@3.2.15/dist/vue-slider-component.umd.min.js");
27668
- s.onload = function(){
27669
- var VueSlider = global$1['vue-slider-component'];
27670
- components['vue-slider-component'] = VueSlider;
27671
- };
27672
- document.head.appendChild(s);
27673
-
27674
- } catch (e) {
27675
- console.error('Unable to load vue-slider', e);
27676
- }
27677
- }
27678
-
27679
- return components;
27680
- };
27681
-
27682
- var updateQuery$b = lib_5.updateQuery,
27683
- setQueryOptions$a = lib_5.setQueryOptions,
27684
- setCustomQuery$a = lib_5.setCustomQuery;
27685
- var checkValueChange$9 = lib_8.checkValueChange,
27686
- getClassName$e = lib_8.getClassName,
27687
- getOptionsFromQuery$3 = lib_8.getOptionsFromQuery,
27688
- isEqual$e = lib_8.isEqual;
27689
- var RangeSlider = {
27690
- name: 'RangeSlider',
27691
- components: getComponents(),
27692
- inject: {
27693
- theme: {
27694
- from: 'theme_reactivesearch'
27695
- }
27696
- },
27697
- data: function data() {
27698
- var state = {
27699
- currentValue: this.$props.range ? [this.$props.range.start, this.$props.range.end] : [],
27700
- stats: []
27701
- };
27702
- return state;
27703
- },
27704
- props: {
27705
- beforeValueChange: types.func,
27706
- className: VueTypes.string.def(''),
27707
- range: VueTypes.shape({
27708
- start: VueTypes.integer.def(0),
27709
- end: VueTypes.integer.def(10)
27710
- }),
27711
- rangeLabels: types.rangeLabels,
27712
- componentId: types.stringRequired,
27713
- customQuery: types.func,
27714
- data: types.data,
27715
- dataField: types.stringRequired,
27716
- defaultValue: types.range,
27717
- value: types.range,
27718
- filterLabel: types.string,
27719
- innerClass: types.style,
27720
- react: types.react,
27721
- showFilter: VueTypes.bool.def(true),
27722
- showCheckbox: VueTypes.bool.def(true),
27723
- title: types.title,
27724
- URLParams: VueTypes.bool.def(false),
27725
- sliderOptions: VueTypes.object.def({}),
27726
- nestedField: types.string,
27727
- index: VueTypes.string,
27728
- endpoint: types.endpointConfig
27729
- },
27730
- methods: {
27731
- handleSliderChange: function handleSliderChange(values) {
27732
- var value = this.$props.value;
27733
-
27734
- if (value === undefined) {
27735
- this.handleChange(values);
27736
- } else {
27737
- this.$emit('change', {
27738
- start: values[0],
27739
- end: values[1]
27740
- });
27741
- }
27742
- },
27743
- handleSlider: function handleSlider() {
27744
- var sliderValues = this.$refs.slider.getValue();
27745
- this.handleSliderChange(sliderValues);
27746
- },
27747
- handleChange: function handleChange(currentValue, props) {
27748
- var _this = this;
27749
-
27750
- if (props === void 0) {
27751
- props = this.$props;
27752
- }
27753
-
27754
- var performUpdate = function performUpdate() {
27755
- _this.currentValue = currentValue;
27756
-
27757
- _this.updateQueryHandler([currentValue[0], currentValue[1]], props);
27579
+ _this.updateQueryHandler([currentValue[0], currentValue[1]], props);
27758
27580
 
27759
27581
  _this.$emit('valueChange', {
27760
27582
  start: currentValue[0],
@@ -27767,7 +27589,7 @@
27767
27589
  });
27768
27590
  };
27769
27591
 
27770
- checkValueChange$9(props.componentId, {
27592
+ checkValueChange$a(props.componentId, {
27771
27593
  start: currentValue[0],
27772
27594
  end: currentValue[1]
27773
27595
  }, props.beforeValueChange, performUpdate);
@@ -27929,7 +27751,7 @@
27929
27751
  return [];
27930
27752
  };
27931
27753
 
27932
- var mapStateToProps$e = function mapStateToProps(state, props) {
27754
+ var mapStateToProps$d = function mapStateToProps(state, props) {
27933
27755
  return {
27934
27756
  options: state.aggregations[props.componentId] ? state.aggregations[props.componentId][props.dataField] && state.aggregations[props.componentId][props.dataField].buckets // eslint-disable-line
27935
27757
  : [],
@@ -27939,137 +27761,107 @@
27939
27761
  };
27940
27762
  };
27941
27763
 
27942
- var mapDispatchtoProps$b = {
27764
+ var mapDispatchtoProps$a = {
27943
27765
  updateQuery: updateQuery$b,
27944
27766
  setQueryOptions: setQueryOptions$a,
27945
27767
  setCustomQuery: setCustomQuery$a
27946
27768
  };
27947
- var RangeConnected$2 = ComponentWrapper$1(connect(mapStateToProps$e, mapDispatchtoProps$b)(RangeSlider), {
27769
+ var RangeConnected$3 = PreferencesConsumer(ComponentWrapper$1(connect(mapStateToProps$d, mapDispatchtoProps$a)(RangeSlider), {
27948
27770
  componentType: constants_1$1.rangeSlider
27949
- });
27771
+ }));
27950
27772
 
27951
27773
  RangeSlider.install = function (Vue) {
27952
- Vue.component(RangeSlider.name, RangeConnected$2);
27774
+ Vue.component(RangeSlider.name, RangeConnected$3);
27953
27775
  }; // Add componentType for SSR
27954
27776
 
27955
27777
 
27956
27778
  RangeSlider.componentType = constants_1$1.rangeSlider;
27957
27779
 
27958
- var addComponent$1 = lib_5.addComponent,
27959
- removeComponent$1 = lib_5.removeComponent,
27960
- watchComponent$1 = lib_5.watchComponent,
27961
- updateQuery$c = lib_5.updateQuery,
27962
- setQueryListener$1 = lib_5.setQueryListener,
27963
- setQueryOptions$b = lib_5.setQueryOptions,
27964
- setComponentProps$1 = lib_5.setComponentProps,
27965
- setCustomQuery$b = lib_5.setCustomQuery,
27966
- updateComponentProps$2 = lib_5.updateComponentProps;
27967
- var checkValueChange$a = lib_8.checkValueChange,
27968
- getClassName$f = lib_8.getClassName,
27969
- isEqual$f = lib_8.isEqual,
27970
- checkSomePropChange$1 = lib_8.checkSomePropChange,
27971
- extractQueryFromCustomQuery$7 = lib_8.extractQueryFromCustomQuery,
27972
- getOptionsForCustomQuery$7 = lib_8.getOptionsForCustomQuery;
27973
- var DynamicRangeSlider = {
27974
- name: 'DynamicRangeSlider',
27975
- components: getComponents(),
27780
+ var _templateObject$p, _templateObject2$b;
27781
+
27782
+ var alert = function alert(_ref) {
27783
+ var theme = _ref.theme;
27784
+ return css(_templateObject$p || (_templateObject$p = _taggedTemplateLiteralLoose(["\n\tcolor: ", ";\n"])), theme.colors.alertColor);
27785
+ };
27786
+
27787
+ var Content = index$1('div')(_templateObject2$b || (_templateObject2$b = _taggedTemplateLiteralLoose(["\n\t", ";\n\tfont-size: 13px;\n\tmargin: 8px;\n"])), function (props) {
27788
+ return props.alert && alert;
27789
+ });
27790
+
27791
+ var getClassName$f = lib_8.getClassName,
27792
+ isEqual$f = lib_8.isEqual;
27793
+ var RangeInput = {
27794
+ name: 'RangeInput',
27795
+ components: {
27796
+ RangeSlider: RangeConnected$3
27797
+ },
27798
+ inject: {
27799
+ theme: {
27800
+ from: 'theme_reactivesearch'
27801
+ }
27802
+ },
27803
+ data: function data() {
27804
+ var state = {
27805
+ currentValue: {
27806
+ start: this.$props.range ? this.$props.range.start : 0,
27807
+ end: this.$props.range ? this.$props.range.end : 10
27808
+ },
27809
+ isStartValid: true,
27810
+ isEndValid: true
27811
+ };
27812
+ return state;
27813
+ },
27976
27814
  props: {
27977
- beforeValueChange: types.func,
27978
- className: VueTypes.string.def(''),
27979
- rangeLabels: types.func,
27815
+ className: {
27816
+ types: types.string,
27817
+ "default": ''
27818
+ },
27819
+ defaultValue: types.range,
27820
+ validateRange: types.func,
27821
+ value: types.range,
27822
+ dataField: types.stringRequired,
27823
+ innerClass: types.style,
27824
+ range: {
27825
+ types: types.range,
27826
+ "default": function _default() {
27827
+ return {
27828
+ start: 0,
27829
+ end: 10
27830
+ };
27831
+ }
27832
+ },
27833
+ rangeLabels: types.rangeLabels,
27834
+ stepValue: types.number,
27835
+ componentStyle: types.style,
27980
27836
  componentId: types.stringRequired,
27837
+ includeNullValues: VueTypes.bool,
27838
+ beforeValueChange: types.func,
27981
27839
  customQuery: types.func,
27982
27840
  data: types.data,
27983
- dataField: types.stringRequired,
27984
- defaultValue: types.func,
27985
27841
  filterLabel: types.string,
27986
- innerClass: types.style,
27987
27842
  react: types.react,
27988
27843
  showFilter: VueTypes.bool.def(true),
27989
- destroyOnUnmount: VueTypes.bool,
27990
27844
  showCheckbox: VueTypes.bool.def(true),
27991
27845
  title: types.title,
27992
27846
  URLParams: VueTypes.bool.def(false),
27993
27847
  sliderOptions: VueTypes.object.def({}),
27994
27848
  nestedField: types.string,
27995
- index: VueTypes.string,
27996
- value: types.range,
27997
27849
  endpoint: types.endpointConfig
27998
27850
  },
27999
- data: function data() {
28000
- this.internalRangeComponent = this.$props.componentId + "__range__internal";
28001
- return {
28002
- currentValue: null,
28003
- stats: []
28004
- };
28005
- },
28006
- created: function created() {
28007
- var _this = this;
27851
+ methods: {
27852
+ shouldUpdate: function shouldUpdate(value) {
27853
+ var validateRange = this.$props.validateRange;
28008
27854
 
28009
- var onQueryChange = function onQueryChange() {
28010
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
28011
- args[_key] = arguments[_key];
27855
+ if (validateRange && value) {
27856
+ return validateRange([value.start, value.end]);
28012
27857
  }
28013
27858
 
28014
- _this.$emit.apply(_this, ['queryChange'].concat(args));
28015
-
28016
- _this.$emit.apply(_this, ['query-change'].concat(args));
28017
- };
28018
-
28019
- this.setQueryListener(this.$props.componentId, onQueryChange, null); // Update props in store
28020
-
28021
- this.setComponentProps(this.componentId, this.$props, constants_1$1.dynamicRangeSlider);
28022
- this.setComponentProps(this.internalRangeComponent, this.$props, constants_1$1.dynamicRangeSlider);
28023
-
28024
- if (!this.enableAppbase && this.$props.index) {
28025
- console.warn('Warning(ReactiveSearch): In order to use the `index` prop, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
28026
- } // Set custom query in store
28027
-
28028
-
28029
- updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.currentValue);
28030
- },
28031
- mounted: function mounted() {
28032
- this.setReact();
28033
- },
28034
- beforeMount: function beforeMount() {
28035
- var components = [];
28036
-
28037
- if (this.$$store) {
28038
- var _this$$$store$getStat = this.$$store.getState();
28039
-
28040
- components = _this$$$store$getStat.components;
28041
- }
28042
-
28043
- var value = this.$props.value;
28044
-
28045
- if (this.destroyOnUnmount || components.indexOf(this.componentId) === -1) {
28046
- this.addComponent(this.componentId);
28047
- this.addComponent(this.internalRangeComponent);
28048
-
28049
- if (Array.isArray(this.selectedValue)) {
28050
- this.handleChange(this.selectedValue);
28051
- } else if (this.selectedValue) {
28052
- this.handleChange(DynamicRangeSlider.parseValue(this.selectedValue, this.$props));
28053
- } else if (value) {
28054
- this.handleChange(DynamicRangeSlider.parseValue(value, this.$props));
28055
- } // get range before executing other queries
28056
-
27859
+ if (value) {
27860
+ return value.start <= value.end;
27861
+ }
28057
27862
 
28058
- this.updateRangeQueryOptions();
28059
- }
28060
- },
28061
- beforeUpdate: function beforeUpdate() {
28062
- if (!this.currentValue) {
28063
- this.setDefaultValue(this.range);
28064
- }
28065
- },
28066
- beforeDestroy: function beforeDestroy() {
28067
- if (this.destroyOnUnmount) {
28068
- this.removeComponent(this.$props.componentId);
28069
- this.removeComponent(this.internalRangeComponent);
28070
- }
28071
- },
28072
- methods: {
27863
+ return false;
27864
+ },
28073
27865
  isControlled: function isControlled() {
28074
27866
  if (this.$props.value && this.$listeners) {
28075
27867
  return true;
@@ -28077,331 +27869,1040 @@
28077
27869
 
28078
27870
  return false;
28079
27871
  },
28080
- setDefaultValue: function setDefaultValue(_ref) {
28081
- var start = _ref.start,
28082
- end = _ref.end;
28083
-
28084
- if (this.$props.defaultValue) {
28085
- var _this$$props$defaultV = this.$props.defaultValue(start, end),
28086
- defaultStart = _this$$props$defaultV.start,
28087
- defaultEnd = _this$$props$defaultV.end;
27872
+ handleChange: function handleChange(value, event) {
27873
+ var currentValue = value;
28088
27874
 
28089
- this.handleChange([defaultStart, defaultEnd]);
28090
- } else if (this.isControlled()) {
28091
- this.handleChange(DynamicRangeSlider.parseValue(this.$props.value), 'change');
28092
- } else {
28093
- this.currentValue = [start, end];
27875
+ if (this.shouldUpdate(value) && !isEqual$f(value, this.currentValue)) {
27876
+ switch (event) {
27877
+ case 'change':
27878
+ if (!value) {
27879
+ currentValue = {
27880
+ start: this.$props.range ? this.$props.range.start : 0,
27881
+ end: this.$props.range ? this.$props.range.end : 10
27882
+ };
27883
+ }
27884
+
27885
+ this.$data.currentValue = _extends({}, currentValue);
27886
+ this.$emit('change', this.$data.currentValue);
27887
+ break;
27888
+
27889
+ case 'value-change':
27890
+ this.$emit('valueChange', this.$data.currentValue);
27891
+ this.$emit('value-change', this.$data.currentValue);
27892
+ break;
27893
+
27894
+ default:
27895
+ this.$data.currentValue = _extends({}, currentValue);
27896
+ break;
27897
+ }
28094
27898
  }
28095
27899
  },
28096
- setReact: function setReact() {
28097
- if (this.$props.react) {
28098
- this.watchComponent(this.internalRangeComponent, this.$props.react);
28099
- this.watchComponent(this.$props.componentId, this.$props.react);
28100
- } else {
28101
- this.watchComponent(this.internalRangeComponent, {});
28102
- this.watchComponent(this.$props.componentId, {});
27900
+ handleOnChange: function handleOnChange(value) {
27901
+ this.handleChange(value || this.$props.range, 'change');
27902
+ },
27903
+ handleValueChange: function handleValueChange(value) {
27904
+ this.handleChange(value, 'value-change');
27905
+ },
27906
+ handleInputChange: function handleInputChange(e) {
27907
+ var _e$target = e.target,
27908
+ name = _e$target.name,
27909
+ value = _e$target.value;
27910
+
27911
+ if (Number.isNaN(value)) {
27912
+ if (name === 'start') {
27913
+ this.$data.isStartValid = false;
27914
+ } else {
27915
+ this.$data.isEndValid = false;
27916
+ }
27917
+ } else if (name === 'start' && !this.$data.isStartValid) {
27918
+ this.$data.isStartValid = true;
27919
+ } else if (name === 'end' && !this.$data.isEndValid) {
27920
+ this.$data.isEndValid = true;
27921
+ }
27922
+
27923
+ if (this.$data.isStartValid && this.$data.isEndValid) {
27924
+ if (name === 'start') {
27925
+ this.handleChange({
27926
+ start: Number(value),
27927
+ end: this.$data.currentValue.end
27928
+ }, 'change');
27929
+ } else {
27930
+ this.handleChange({
27931
+ start: this.$data.currentValue.start,
27932
+ end: Number(value)
27933
+ }, 'change');
27934
+ }
27935
+ }
27936
+ }
27937
+ },
27938
+ watch: {
27939
+ defaultValue: function defaultValue(newVal, oldVal) {
27940
+ if (oldVal.start !== newVal.start || oldVal.end !== newVal.end) {
27941
+ this.handleChange(newVal);
28103
27942
  }
28104
27943
  },
28105
- rangeQuery: function rangeQuery() {
28106
- return {
28107
- min: {
28108
- min: {
28109
- field: this.$props.dataField
28110
- }
27944
+ value: function value(newVal, oldVal) {
27945
+ if (!isEqual$f(newVal, oldVal)) {
27946
+ if (this.isControlled()) {
27947
+ this.handleChange(newVal, 'change');
27948
+ }
27949
+ }
27950
+ }
27951
+ },
27952
+ created: function created() {
27953
+ if (this.$props.defaultValue && this.$props.defaultValue.start && this.$props.defaultValue.end) {
27954
+ this.handleChange(this.$props.defaultValue);
27955
+ }
27956
+
27957
+ if (this.isControlled()) {
27958
+ this.handleChange(this.$props.value, 'change');
27959
+ }
27960
+ },
27961
+ render: function render() {
27962
+ var h = arguments[0];
27963
+ var _this$$props = this.$props,
27964
+ className = _this$$props.className,
27965
+ dataField = _this$$props.dataField,
27966
+ range = _this$$props.range,
27967
+ rangeLabels = _this$$props.rangeLabels,
27968
+ componentId = _this$$props.componentId,
27969
+ innerClass = _this$$props.innerClass,
27970
+ stepValue = _this$$props.stepValue,
27971
+ componentStyle = _this$$props.componentStyle,
27972
+ themePreset = _this$$props.themePreset,
27973
+ includeNullValues = _this$$props.includeNullValues,
27974
+ beforeValueChange = _this$$props.beforeValueChange,
27975
+ customQuery = _this$$props.customQuery,
27976
+ data = _this$$props.data,
27977
+ filterLabel = _this$$props.filterLabel,
27978
+ react = _this$$props.react,
27979
+ showFilter = _this$$props.showFilter,
27980
+ showCheckbox = _this$$props.showCheckbox,
27981
+ title = _this$$props.title,
27982
+ URLParams = _this$$props.URLParams,
27983
+ sliderOptions = _this$$props.sliderOptions,
27984
+ nestedField = _this$$props.nestedField;
27985
+ return h(Container, {
27986
+ "style": componentStyle,
27987
+ "class": className
27988
+ }, [h(RangeConnected$3, {
27989
+ "attrs": {
27990
+ "componentId": componentId,
27991
+ "value": {
27992
+ start: this.currentValue.start,
27993
+ end: this.currentValue.end
28111
27994
  },
28112
- max: {
28113
- max: {
28114
- field: this.$props.dataField
28115
- }
27995
+ "range": range,
27996
+ "dataField": dataField,
27997
+ "rangeLabels": rangeLabels,
27998
+ "includeNullValues": includeNullValues,
27999
+ "beforeValueChange": beforeValueChange,
28000
+ "customQuery": customQuery,
28001
+ "data": data,
28002
+ "filterLabel": filterLabel,
28003
+ "react": react,
28004
+ "showFilter": showFilter,
28005
+ "showCheckbox": showCheckbox,
28006
+ "title": title,
28007
+ "uRLParams": URLParams,
28008
+ "sliderOptions": sliderOptions,
28009
+ "nestedField": nestedField
28010
+ },
28011
+ "on": {
28012
+ "change": this.handleOnChange,
28013
+ "value-change": this.handleValueChange
28014
+ }
28015
+ }), h(Flex, {
28016
+ "class": getClassName$f(innerClass, 'input-container') || ''
28017
+ }, [h(Flex, {
28018
+ "attrs": {
28019
+ "direction": "column",
28020
+ "flex": 2
28021
+ }
28022
+ }, [h(Input, {
28023
+ "key": componentId + "-start-value",
28024
+ "attrs": {
28025
+ "name": "start",
28026
+ "type": "number",
28027
+ "step": stepValue,
28028
+ "themePreset": themePreset,
28029
+ "aria-label": componentId + "-start-input",
28030
+ "min": this.$props.range ? this.$props.range.start : 0,
28031
+ "alert": !this.isStartValid
28032
+ },
28033
+ "on": {
28034
+ "change": this.handleInputChange
28035
+ },
28036
+ "class": getClassName$f(innerClass, 'input') || '',
28037
+ "domProps": _extends({}, {
28038
+ value: this.currentValue.start
28039
+ })
28040
+ }), !this.isStartValid && h(Content, {
28041
+ "attrs": {
28042
+ "alert": true
28043
+ }
28044
+ }, ["Input range is invalid"])]), h(Flex, {
28045
+ "attrs": {
28046
+ "justifyContent": "center",
28047
+ "alignItems": "center",
28048
+ "flex": 1
28049
+ }
28050
+ }, ["-"]), h(Flex, {
28051
+ "attrs": {
28052
+ "direction": "column",
28053
+ "flex": 2
28054
+ }
28055
+ }, [h(Input, {
28056
+ "key": componentId + "-end-value",
28057
+ "attrs": {
28058
+ "name": "end",
28059
+ "type": "number",
28060
+ "step": stepValue,
28061
+ "themePreset": themePreset,
28062
+ "aria-label": componentId + "-end-input",
28063
+ "max": this.$props.range ? this.$props.range.end : 10,
28064
+ "alert": !this.isEndValid
28065
+ },
28066
+ "on": {
28067
+ "change": this.handleInputChange
28068
+ },
28069
+ "class": getClassName$f(innerClass, 'input') || '',
28070
+ "domProps": _extends({}, {
28071
+ value: this.currentValue.end
28072
+ })
28073
+ }), !this.isEndValid && h(Content, {
28074
+ "attrs": {
28075
+ "alert": true
28076
+ }
28077
+ }, ["Input range is invalid"])])])]);
28078
+ }
28079
+ };
28080
+
28081
+ var mapStateToProps$e = function mapStateToProps(state) {
28082
+ return {
28083
+ themePreset: state.config.themePreset
28084
+ };
28085
+ };
28086
+
28087
+ var RangeConnected$4 = PreferencesConsumer(ComponentWrapper$1(connect(mapStateToProps$e, {})(RangeInput), {
28088
+ componentType: constants_1$1.rangeInput
28089
+ }));
28090
+
28091
+ RangeInput.install = function (Vue) {
28092
+ Vue.component(RangeInput.name, RangeConnected$4);
28093
+ }; // Add componentType for SSR
28094
+
28095
+
28096
+ RangeInput.componentType = constants_1$1.rangeInput;
28097
+
28098
+ var _excluded = ["options"];
28099
+ var updateQuery$c = lib_5.updateQuery,
28100
+ setQueryOptions$b = lib_5.setQueryOptions,
28101
+ setCustomQuery$b = lib_5.setCustomQuery,
28102
+ setDefaultQuery$7 = lib_5.setDefaultQuery;
28103
+ var parseHits$1 = lib_8.parseHits,
28104
+ isEqual$g = lib_8.isEqual,
28105
+ getCompositeAggsQuery$5 = lib_8.getCompositeAggsQuery,
28106
+ getResultStats$3 = lib_8.getResultStats,
28107
+ extractQueryFromCustomQuery$7 = lib_8.extractQueryFromCustomQuery,
28108
+ getOptionsForCustomQuery$7 = lib_8.getOptionsForCustomQuery;
28109
+ var ReactiveComponent = {
28110
+ name: 'ReactiveComponent',
28111
+ props: {
28112
+ componentId: types.stringRequired,
28113
+ aggregationField: types.string,
28114
+ aggregationSize: VueTypes.number,
28115
+ size: VueTypes.number,
28116
+ defaultQuery: types.func,
28117
+ customQuery: types.func,
28118
+ filterLabel: types.string,
28119
+ react: types.react,
28120
+ showFilter: VueTypes.bool.def(true),
28121
+ URLParams: VueTypes.bool.def(false),
28122
+ distinctField: types.string,
28123
+ distinctFieldConfig: types.props,
28124
+ index: VueTypes.string,
28125
+ endpoint: types.endpointConfig
28126
+ },
28127
+ created: function created() {
28128
+ var _this = this;
28129
+
28130
+ var props = this.$props;
28131
+ this.internalComponent = null;
28132
+ this.$defaultQuery = null; // Set custom query in store
28133
+
28134
+ updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.selectedValue);
28135
+ var customQuery = props.customQuery,
28136
+ componentId = props.componentId,
28137
+ filterLabel = props.filterLabel,
28138
+ showFilter = props.showFilter,
28139
+ URLParams = props.URLParams,
28140
+ distinctField = props.distinctField,
28141
+ distinctFieldConfig = props.distinctFieldConfig,
28142
+ index = props.index;
28143
+
28144
+ if (this.enableAppbase && this.aggregationField && this.aggregationField !== '') {
28145
+ console.warn('Warning(ReactiveSearch): The `aggregationField` prop has been marked as deprecated, please use the `distinctField` prop instead.');
28146
+ }
28147
+
28148
+ if (!this.enableAppbase && (distinctField || distinctFieldConfig)) {
28149
+ console.warn('Warning(ReactiveSearch): In order to use the `distinctField` and `distinctFieldConfig` props, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
28150
+ }
28151
+
28152
+ if (!this.enableAppbase && index) {
28153
+ console.warn('Warning(ReactiveSearch): In order to use the `index` prop, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
28154
+ }
28155
+
28156
+ if (customQuery) {
28157
+ var calcCustomQuery = customQuery(this.selectedValue, props);
28158
+ var query = extractQueryFromCustomQuery$7(calcCustomQuery);
28159
+ var customQueryOptions = calcCustomQuery ? getOptionsForCustomQuery$7(calcCustomQuery) : null;
28160
+
28161
+ if (customQueryOptions) {
28162
+ this.setQueryOptions(componentId, _extends({}, customQueryOptions, this.getAggsQuery()), false);
28163
+ } else this.setQueryOptions(componentId, this.getAggsQuery(), false);
28164
+
28165
+ this.updateQuery({
28166
+ componentId: componentId,
28167
+ query: query,
28168
+ value: this.selectedValue || null,
28169
+ label: filterLabel,
28170
+ showFilter: showFilter,
28171
+ URLParams: URLParams
28172
+ });
28173
+ }
28174
+
28175
+ this.setQuery = function (_ref) {
28176
+ var options = _ref.options,
28177
+ obj = _objectWithoutPropertiesLoose(_ref, _excluded);
28178
+
28179
+ var queryToBeSet = obj.query; // when enableAppbase is true, Backend throws error because of repeated query in request body
28180
+
28181
+ if (queryToBeSet && queryToBeSet.query) {
28182
+ queryToBeSet = queryToBeSet.query;
28183
+ }
28184
+
28185
+ var customQueryCalc = _extends({}, options, {
28186
+ query: queryToBeSet
28187
+ });
28188
+
28189
+ var rsAPIQuery = customQueryCalc; // handle stored queries
28190
+
28191
+ if (queryToBeSet && queryToBeSet.id) {
28192
+ rsAPIQuery = queryToBeSet;
28193
+ } // Update customQuery field for RS API
28194
+
28195
+
28196
+ _this.setCustomQuery(props.componentId, rsAPIQuery);
28197
+
28198
+ if (options) {
28199
+ _this.setQueryOptions(props.componentId, _extends({}, _this.getAggsQuery(), options), false);
28200
+ }
28201
+
28202
+ _this.updateQuery(_extends({}, obj, {
28203
+ query: customQueryCalc.query,
28204
+ componentId: props.componentId,
28205
+ label: props.filterLabel,
28206
+ showFilter: props.showFilter,
28207
+ URLParams: props.URLParams
28208
+ }));
28209
+ };
28210
+
28211
+ if (props.defaultQuery) {
28212
+ this.internalComponent = props.componentId + "__internal";
28213
+ }
28214
+
28215
+ if (this.internalComponent && this.$props.defaultQuery) {
28216
+ updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.selectedValue);
28217
+ this.$defaultQuery = this.$props.defaultQuery(this.selectedValue, this.$props);
28218
+
28219
+ var _query = extractQueryFromCustomQuery$7(this.$defaultQuery);
28220
+
28221
+ var queryOptions = getOptionsForCustomQuery$7(this.$defaultQuery);
28222
+
28223
+ if (queryOptions) {
28224
+ this.setQueryOptions(this.internalComponent, _extends({}, queryOptions, this.getAggsQuery()), false);
28225
+ } else this.setQueryOptions(this.internalComponent, this.getAggsQuery(), false);
28226
+
28227
+ this.updateQuery({
28228
+ componentId: this.internalComponent,
28229
+ query: _query
28230
+ });
28231
+ }
28232
+ },
28233
+ watch: {
28234
+ hits: function hits(newVal, oldVal) {
28235
+ if (!isEqual$g(newVal, oldVal)) {
28236
+ this.$emit('data', this.getData());
28237
+ }
28238
+ },
28239
+ rawData: function rawData(newVal, oldVal) {
28240
+ if (!isEqual$g(newVal, oldVal)) {
28241
+ this.$emit('data', this.getData());
28242
+ }
28243
+ },
28244
+ aggregations: function aggregations(newVal, oldVal) {
28245
+ if (!isEqual$g(newVal, oldVal)) {
28246
+ this.$emit('data', this.getData());
28247
+ }
28248
+ },
28249
+ aggregationData: function aggregationData(newVal, oldVal) {
28250
+ if (!isEqual$g(newVal, oldVal)) {
28251
+ this.$emit('data', this.getData());
28252
+ }
28253
+ },
28254
+ promotedResults: function promotedResults(newVal, oldVal) {
28255
+ if (!isEqual$g(newVal, oldVal)) {
28256
+ this.$emit('data', this.getData());
28257
+ }
28258
+ },
28259
+ hidden: function hidden(newVal, oldVal) {
28260
+ if (!isEqual$g(newVal, oldVal)) {
28261
+ this.$emit('data', this.getData());
28262
+ }
28263
+ },
28264
+ total: function total(newVal, oldVal) {
28265
+ if (!isEqual$g(newVal, oldVal)) {
28266
+ this.$emit('data', this.getData());
28267
+ }
28268
+ },
28269
+ time: function time(newVal, oldVal) {
28270
+ if (!isEqual$g(newVal, oldVal)) {
28271
+ this.$emit('data', this.getData());
28272
+ }
28273
+ },
28274
+ defaultQuery: function defaultQuery(newVal, oldVal) {
28275
+ if (newVal && !isQueryIdentical(newVal, oldVal, this.selectedValue, this.$props)) {
28276
+ this.$defaultQuery = newVal(this.selectedValue, this.$props);
28277
+ var query = extractQueryFromCustomQuery$7(this.$defaultQuery);
28278
+ var queryOptions = getOptionsForCustomQuery$7(this.$defaultQuery);
28279
+
28280
+ if (queryOptions) {
28281
+ this.setQueryOptions(this.internalComponent, _extends({}, queryOptions, this.getAggsQuery()), false);
28282
+ } else this.setQueryOptions(this.internalComponent, this.getAggsQuery(), false); // Update default query for RS API
28283
+
28284
+
28285
+ updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.selectedValue);
28286
+ this.updateQuery({
28287
+ componentId: this.internalComponent,
28288
+ query: query
28289
+ });
28290
+ }
28291
+ },
28292
+ customQuery: function customQuery(newVal, oldVal) {
28293
+ if (newVal && !isQueryIdentical(newVal, oldVal, this.selectedValue, this.$props)) {
28294
+ var componentId = this.$props.componentId;
28295
+ this.$customQuery = newVal(this.selectedValue, this.$props);
28296
+ var query = extractQueryFromCustomQuery$7(this.$customQuery);
28297
+ var queryOptions = getOptionsForCustomQuery$7(this.$customQuery);
28298
+
28299
+ if (queryOptions) {
28300
+ this.setQueryOptions(componentId, _extends({}, queryOptions, this.getAggsQuery()), false);
28301
+ } else this.setQueryOptions(componentId, this.getAggsQuery(), false); // Update custom query for RS API
28302
+
28303
+
28304
+ updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.selectedValue);
28305
+ this.updateQuery({
28306
+ componentId: componentId,
28307
+ query: query
28308
+ });
28309
+ }
28310
+ }
28311
+ },
28312
+ render: function render() {
28313
+ var h = arguments[0];
28314
+
28315
+ try {
28316
+ var dom = this.$scopedSlots["default"];
28317
+ var error = this.error,
28318
+ isLoading = this.isLoading,
28319
+ selectedValue = this.selectedValue;
28320
+
28321
+ var propsToBePassed = _extends({
28322
+ error: error,
28323
+ loading: isLoading
28324
+ }, this.getData(), {
28325
+ value: selectedValue,
28326
+ setQuery: this.setQuery
28327
+ });
28328
+
28329
+ return h("div", [dom(propsToBePassed)]);
28330
+ } catch (e) {
28331
+ return null;
28332
+ }
28333
+ },
28334
+ methods: {
28335
+ getAggsQuery: function getAggsQuery() {
28336
+ if (this.aggregationField) {
28337
+ return {
28338
+ aggs: getCompositeAggsQuery$5({
28339
+ props: this.$props,
28340
+ showTopHits: true,
28341
+ value: this.selectedValue
28342
+ }).aggs
28343
+ };
28344
+ }
28345
+
28346
+ return {};
28347
+ },
28348
+ getData: function getData() {
28349
+ var hits = this.hits,
28350
+ aggregations = this.aggregations,
28351
+ aggregationData = this.aggregationData,
28352
+ promotedResults = this.promotedResults,
28353
+ rawData = this.rawData;
28354
+ var filteredResults = parseHits$1(hits);
28355
+
28356
+ if (promotedResults.length) {
28357
+ var ids = promotedResults.map(function (item) {
28358
+ return item._id;
28359
+ }).filter(Boolean);
28360
+
28361
+ if (ids) {
28362
+ filteredResults = filteredResults.filter(function (item) {
28363
+ return !ids.includes(item._id);
28364
+ });
28116
28365
  }
28366
+
28367
+ filteredResults = [].concat(promotedResults, filteredResults);
28368
+ }
28369
+
28370
+ return {
28371
+ data: filteredResults,
28372
+ aggregationData: aggregationData,
28373
+ rawData: rawData,
28374
+ aggregations: aggregations,
28375
+ promotedData: promotedResults,
28376
+ resultStats: this.stats
28117
28377
  };
28118
- },
28119
- updateRangeQueryOptions: function updateRangeQueryOptions() {
28120
- var aggs = {};
28378
+ }
28379
+ },
28380
+ computed: {
28381
+ stats: function stats() {
28382
+ return getResultStats$3(this);
28383
+ }
28384
+ }
28385
+ };
28386
+
28387
+ ReactiveComponent.hasInternalComponent = function (props) {
28388
+ return !!props.defaultQuery;
28389
+ };
28390
+
28391
+ var mapStateToProps$f = function mapStateToProps(state, props) {
28392
+ return {
28393
+ aggregations: state.aggregations[props.componentId] && state.aggregations[props.componentId] || null,
28394
+ aggregationData: state.compositeAggregations[props.componentId] || [],
28395
+ hits: state.hits[props.componentId] && state.hits[props.componentId].hits || [],
28396
+ rawData: state.rawData[props.componentId],
28397
+ error: state.error[props.componentId],
28398
+ isLoading: state.isLoading[props.componentId],
28399
+ selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || null,
28400
+ promotedResults: state.promotedResults[props.componentId] || [],
28401
+ time: state.hits[props.componentId] && state.hits[props.componentId].time || 0,
28402
+ total: state.hits[props.componentId] && state.hits[props.componentId].total,
28403
+ hidden: state.hits[props.componentId] && state.hits[props.componentId].hidden,
28404
+ componentProps: state.props[props.componentId],
28405
+ enableAppbase: state.config.enableAppbase
28406
+ };
28407
+ };
28408
+
28409
+ var mapDispatchtoProps$b = {
28410
+ setQueryOptions: setQueryOptions$b,
28411
+ updateQuery: updateQuery$c,
28412
+ setCustomQuery: setCustomQuery$b,
28413
+ setDefaultQuery: setDefaultQuery$7
28414
+ };
28415
+ var ConnectedComponent = ComponentWrapper$1(connect(mapStateToProps$f, mapDispatchtoProps$b)(ReactiveComponent), {
28416
+ componentType: constants_1$1.reactiveComponent
28417
+ });
28418
+ var RcConnected = PreferencesConsumer({
28419
+ name: 'RcConnected',
28420
+ render: function render(h) {
28421
+ var component = ConnectedComponent;
28422
+
28423
+ switch (this.$attrs.componentType) {
28424
+ case constants_1$1.reactiveList:
28425
+ component = RLConnected;
28426
+ break;
28427
+
28428
+ case constants_1$1.dataSearch:
28429
+ component = DSConnected;
28430
+ break;
28431
+
28432
+ case constants_1$1.searchBox:
28433
+ component = SBConnected;
28434
+ break;
28435
+ // list components
28436
+
28437
+ case constants_1$1.singleList:
28438
+ component = ListConnected;
28439
+ break;
28440
+
28441
+ case constants_1$1.multiList:
28442
+ component = ListConnected$1;
28443
+ break;
28444
+
28445
+ case constants_1$1.singleDropdownList:
28446
+ component = ListConnected$2;
28447
+ break;
28448
+
28449
+ case constants_1$1.multiDropdownList:
28450
+ component = ListConnected$3;
28451
+ break;
28452
+ // basic components
28453
+
28454
+ case constants_1$1.toggleButton:
28455
+ component = ListConnected$4;
28456
+ break;
28457
+ // range components
28458
+
28459
+ case constants_1$1.dynamicRangeSlider:
28460
+ component = RangeConnected;
28461
+ break;
28462
+
28463
+ case constants_1$1.singleRange:
28464
+ component = RangeConnected$1;
28465
+ break;
28466
+
28467
+ case constants_1$1.multiRange:
28468
+ component = RangeConnected$2;
28469
+ break;
28470
+
28471
+ case constants_1$1.rangeSlider:
28472
+ component = RangeConnected$3;
28473
+ break;
28474
+
28475
+ case constants_1$1.rangeInput:
28476
+ component = RangeConnected$4;
28477
+ break;
28478
+ }
28479
+
28480
+ return h(component, {
28481
+ attrs: this.$attrs,
28482
+ on: this.$listeners,
28483
+ scopedSlots: this.$scopedSlots,
28484
+ slots: this.$slots
28485
+ });
28486
+ }
28487
+ });
28488
+
28489
+ ReactiveComponent.install = function (Vue) {
28490
+ Vue.component(ReactiveComponent.name, RcConnected);
28491
+ }; // Add componentType for SSR
28492
+
28493
+
28494
+ ReactiveComponent.componentType = constants_1$1.reactiveComponent;
28495
+
28496
+ var setValue$2 = lib_5.setValue,
28497
+ clearValues = lib_5.clearValues,
28498
+ resetValuesToDefault = lib_5.resetValuesToDefault;
28499
+ var getClassName$g = lib_8.getClassName,
28500
+ handleA11yAction$2 = lib_8.handleA11yAction;
28501
+ var SelectedFilters = {
28502
+ name: 'SelectedFilters',
28503
+ props: {
28504
+ className: VueTypes.string.def(''),
28505
+ clearAllLabel: VueTypes.string.def('Clear All'),
28506
+ innerClass: types.style,
28507
+ showClearAll: VueTypes.bool.def(true),
28508
+ title: types.title,
28509
+ resetToDefault: VueTypes.bool.def(false),
28510
+ clearAllBlacklistComponents: VueTypes.array,
28511
+ resetToValues: VueTypes.object
28512
+ },
28513
+ inject: {
28514
+ theme: {
28515
+ from: 'theme_reactivesearch'
28516
+ }
28517
+ },
28518
+ render: function render() {
28519
+ var _this = this;
28520
+
28521
+ var h = arguments[0];
28522
+
28523
+ if (this.$scopedSlots["default"]) {
28524
+ return this.$scopedSlots["default"]({
28525
+ components: this.components,
28526
+ selectedValues: this.selectedValues,
28527
+ clearValues: this.clearValues,
28528
+ clearValue: this.clearValue,
28529
+ setValue: this.setValue,
28530
+ resetValuesToDefault: this.resetValuesToDefault
28531
+ });
28532
+ }
28533
+
28534
+ var filtersToRender = this.renderFilters();
28535
+ var hasValues = !!filtersToRender.length;
28536
+ return h(Container, {
28537
+ "class": filters(this.theme) + " " + (this.$props.className || '')
28538
+ }, [this.$props.title && hasValues && h(Title, {
28539
+ "class": getClassName$g(this.$props.innerClass, 'title') || ''
28540
+ }, [this.$props.title]), filtersToRender, this.$props.showClearAll && hasValues && filtersToRender.length > 1 ? h(Button, {
28541
+ "class": getClassName$g(this.$props.innerClass, 'button') || '',
28542
+ "on": _extends({}, {
28543
+ click: this.clearValues,
28544
+ keypress: function keypress(event) {
28545
+ return handleA11yAction$2(event, function () {
28546
+ return _this.clearValues();
28547
+ });
28548
+ }
28549
+ }),
28550
+ "attrs": {
28551
+ "tabIndex": "0"
28552
+ }
28553
+ }, [this.$props.clearAllLabel]) : null]);
28554
+ },
28555
+ methods: {
28556
+ remove: function remove(component, value) {
28557
+ if (value === void 0) {
28558
+ value = null;
28559
+ }
28121
28560
 
28122
- if (this.$props.nestedField) {
28123
- var _aggs;
28561
+ this.setValue(component, null);
28562
+ this.$emit('clear', component, value);
28563
+ },
28564
+ clearValues: function clearValues() {
28565
+ var resetToDefault = this.resetToDefault,
28566
+ resetToValues = this.resetToValues,
28567
+ clearAllBlacklistComponents = this.clearAllBlacklistComponents;
28124
28568
 
28125
- aggs = (_aggs = {}, _aggs[this.$props.nestedField] = {
28126
- nested: {
28127
- path: this.$props.nestedField
28128
- },
28129
- aggs: this.rangeQuery()
28130
- }, _aggs);
28569
+ if (resetToDefault) {
28570
+ this.resetValuesToDefault(clearAllBlacklistComponents);
28131
28571
  } else {
28132
- aggs = this.rangeQuery();
28572
+ this.clearValuesAction(resetToValues, clearAllBlacklistComponents);
28133
28573
  }
28134
28574
 
28135
- this.setQueryOptions(this.internalRangeComponent, {
28136
- aggs: aggs
28137
- });
28575
+ this.$emit('clear', resetToValues);
28138
28576
  },
28139
- handleSlider: function handleSlider() {
28140
- var sliderValues = this.$refs.slider.getValue();
28141
- var value = this.$props.value;
28577
+ clearValue: function clearValue(componentId) {
28578
+ var resetToDefault = this.resetToDefault,
28579
+ resetToValues = this.resetToValues;
28142
28580
 
28143
- if (value === undefined) {
28144
- this.handleChange(sliderValues);
28581
+ if (resetToDefault) {
28582
+ this.resetValuesToDefault(this.components.filter(function (component) {
28583
+ return component !== componentId;
28584
+ }));
28145
28585
  } else {
28146
- this.$emit('change', {
28147
- start: sliderValues[0],
28148
- end: sliderValues[1]
28149
- });
28586
+ this.setValue(componentId, (resetToValues == null ? void 0 : resetToValues[componentId]) || null);
28150
28587
  }
28588
+
28589
+ this.$emit('clear', resetToValues == null ? void 0 : resetToValues[componentId]);
28151
28590
  },
28152
- handleChange: function handleChange(currentValue) {
28591
+ renderValue: function renderValue(value, isArray) {
28153
28592
  var _this2 = this;
28154
28593
 
28155
- // Always keep the values within range
28156
- var normalizedValue = [this.range ? Math.max(this.range.start, currentValue[0]) : currentValue[0], this.range ? Math.min(this.range.end, currentValue[1]) : currentValue[1]];
28157
-
28158
- var performUpdate = function performUpdate() {
28159
- _this2.currentValue = normalizedValue;
28160
-
28161
- _this2.updateQueryHandler(normalizedValue, _this2.$props);
28162
-
28163
- _this2.$emit('valueChange', {
28164
- start: normalizedValue[0],
28165
- end: normalizedValue[1]
28594
+ if (isArray && value.length) {
28595
+ var arrayToRender = value.map(function (item) {
28596
+ return _this2.renderValue(item);
28166
28597
  });
28598
+ return arrayToRender.join(', ');
28599
+ }
28167
28600
 
28168
- _this2.$emit('value-change', {
28169
- start: normalizedValue[0],
28170
- end: normalizedValue[1]
28171
- });
28172
- };
28601
+ if (value && typeof value === 'object') {
28602
+ // TODO: support for NestedList
28603
+ var label = (typeof value.label === 'string' ? value.label : value.value) || value.key || value.distance || null;
28173
28604
 
28174
- checkValueChange$a(this.$props.componentId, {
28175
- start: normalizedValue[0],
28176
- end: normalizedValue[1]
28177
- }, this.$props.beforeValueChange, performUpdate);
28178
- },
28179
- updateQueryHandler: function updateQueryHandler(value) {
28180
- var query = DynamicRangeSlider.defaultQuery(value, this.$props);
28605
+ if (value.location) {
28606
+ label = value.location + " - " + label;
28607
+ }
28181
28608
 
28182
- if (this.$props.customQuery) {
28183
- var customQueryTobeSet = this.$props.customQuery(value, this.$props);
28184
- var queryTobeSet = extractQueryFromCustomQuery$7(customQueryTobeSet);
28609
+ return label;
28610
+ }
28185
28611
 
28186
- if (queryTobeSet) {
28187
- query = queryTobeSet;
28612
+ return value;
28613
+ },
28614
+ renderFilterButton: function renderFilterButton(component, keyProp, handleRemove, label) {
28615
+ var h = this.$createElement;
28616
+ return h(Button, {
28617
+ "class": getClassName$g(this.$props.innerClass, 'button') || '',
28618
+ "key": keyProp,
28619
+ "on": _extends({}, {
28620
+ click: handleRemove,
28621
+ keypress: function keypress(event) {
28622
+ return handleA11yAction$2(event, handleRemove);
28623
+ }
28624
+ }),
28625
+ "attrs": {
28626
+ "tabIndex": "0"
28188
28627
  }
28628
+ }, [h("span", [label]), h("span", ["\u2715"])]);
28629
+ },
28630
+ renderFilters: function renderFilters() {
28631
+ var _this3 = this;
28189
28632
 
28190
- var customQueryOptions = getOptionsForCustomQuery$7(customQueryTobeSet);
28191
- updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, value);
28192
- this.setQueryOptions(this.$props.componentId, customQueryOptions, false);
28193
- }
28633
+ var selectedValues = this.selectedValues;
28634
+ var filterComponents = Object.keys(selectedValues).filter(function (id) {
28635
+ return _this3.components.includes(id) && selectedValues[id].showFilter;
28636
+ });
28637
+ return filterComponents.map(function (component, index) {
28638
+ var _selectedValues$compo = selectedValues[component],
28639
+ label = _selectedValues$compo.label,
28640
+ value = _selectedValues$compo.value;
28641
+ var isArray = Array.isArray(value); // default behaviour
28194
28642
 
28195
- var _ref2 = this.range || {
28196
- start: value[0],
28197
- end: value[1]
28198
- },
28199
- start = _ref2.start,
28200
- end = _ref2.end;
28643
+ if (label && (isArray && value.length || !isArray && value)) {
28644
+ var valueToRender = _this3.renderValue(value, isArray);
28201
28645
 
28202
- var currentStart = value[0],
28203
- currentEnd = value[1]; // check if the slider is at its initial position
28646
+ return _this3.renderFilterButton(component, component + "-" + (index + 1), function () {
28647
+ return _this3.remove(component, value);
28648
+ }, selectedValues[component].label + ": " + decodeHtml(valueToRender));
28649
+ }
28204
28650
 
28205
- var isInitialValue = currentStart === start && currentEnd === end;
28206
- this.updateQuery({
28207
- componentId: this.$props.componentId,
28208
- query: query,
28209
- value: value,
28210
- label: this.$props.filterLabel,
28211
- showFilter: this.$props.showFilter && !isInitialValue,
28212
- URLParams: this.$props.URLParams,
28213
- componentType: constants_1$1.dynamicRangeSlider
28214
- });
28215
- }
28216
- },
28217
- computed: {
28218
- labels: function labels() {
28219
- if (!this.rangeLabels) return null;
28220
- return this.rangeLabels(this.range.start, this.range.end);
28651
+ return null;
28652
+ }).filter(Boolean);
28221
28653
  }
28222
28654
  },
28223
28655
  watch: {
28224
- $props: {
28225
- deep: true,
28226
- handler: function handler(newVal) {
28227
- var _this3 = this;
28656
+ selectedValues: function selectedValues(newVal) {
28657
+ this.$emit('change', newVal);
28658
+ }
28659
+ }
28660
+ };
28228
28661
 
28229
- var propsKeys = getValidPropsKeys(newVal);
28230
- checkSomePropChange$1(newVal, this.componentProps, propsKeys, function () {
28231
- _this3.updateComponentProps(_this3.componentId, newVal, constants_1$1.dynamicRangeSlider);
28662
+ var mapStateToProps$g = function mapStateToProps(state) {
28663
+ return {
28664
+ components: state.components,
28665
+ selectedValues: state.selectedValues
28666
+ };
28667
+ };
28232
28668
 
28233
- _this3.updateComponentProps(_this3.internalRangeComponent, newVal, constants_1$1.dynamicRangeSlider);
28234
- });
28235
- }
28236
- },
28237
- react: function react() {
28238
- this.setReact();
28239
- },
28240
- selectedValue: function selectedValue(newValue) {
28241
- if (isEqual$f(newValue, this.currentValue)) return;
28242
- var value = newValue || {
28243
- start: this.range.start,
28244
- end: this.range.end
28245
- };
28246
- this.$emit('change', value);
28247
- this.handleChange(DynamicRangeSlider.parseValue(value, this.$props));
28248
- },
28249
- range: function range(newValue, oldValue) {
28250
- if (isEqual$f(newValue, oldValue) || !this.currentValue) return;
28669
+ var mapDispatchtoProps$c = {
28670
+ clearValuesAction: clearValues,
28671
+ setValue: setValue$2,
28672
+ resetValuesToDefault: resetValuesToDefault
28673
+ };
28674
+ var RcConnected$1 = connect(mapStateToProps$g, mapDispatchtoProps$c)(SelectedFilters);
28251
28675
 
28252
- var _ref3 = this.currentValue || [],
28253
- currentStart = _ref3[0],
28254
- currentEnd = _ref3[1];
28676
+ SelectedFilters.install = function (Vue) {
28677
+ Vue.component(SelectedFilters.name, RcConnected$1);
28678
+ };
28255
28679
 
28256
- var _ref4 = oldValue || {},
28257
- oldStart = _ref4.start,
28258
- oldEnd = _ref4.end;
28680
+ var ResultCardTitle = {
28681
+ name: 'ResultCardTitle',
28682
+ render: function render() {
28683
+ var h = arguments[0];
28684
+ var children = this.$slots["default"];
28685
+ return h(Title, helper$1([{}, this.$props]), [children]);
28686
+ }
28687
+ };
28259
28688
 
28260
- var newStart = currentStart === oldStart ? newValue.start : currentStart;
28261
- var newEnd = currentEnd === oldEnd ? newValue.end : currentEnd;
28262
- this.handleChange([newStart, newEnd]);
28263
- },
28264
- customQuery: function customQuery(newVal, oldVal) {
28265
- if (!isQueryIdentical(newVal, oldVal, this.$data.currentValue, this.$props)) {
28266
- this.updateQueryHandler(this.$data.currentValue);
28267
- }
28268
- },
28269
- value: function value(newVal, oldVal) {
28270
- if (!isEqual$f(newVal, oldVal)) {
28271
- this.handleChange(DynamicRangeSlider.parseValue(newVal, this.$props));
28272
- }
28273
- }
28689
+ ResultCardTitle.install = function (Vue) {
28690
+ Vue.component(ResultCardTitle.name, ResultCardTitle);
28691
+ };
28692
+
28693
+ var _excluded$1 = ["src"];
28694
+ var ResultCardImage = {
28695
+ name: 'ResultCardImage',
28696
+ props: {
28697
+ src: VueTypes.string.isRequired
28274
28698
  },
28275
28699
  render: function render() {
28276
28700
  var h = arguments[0];
28277
28701
 
28278
- if (!this.range || !this.currentValue) {
28279
- return null;
28280
- }
28702
+ var _this$$props = this.$props,
28703
+ src = _this$$props.src,
28704
+ props = _objectWithoutPropertiesLoose(_this$$props, _excluded$1);
28281
28705
 
28282
- var _this$range = this.range,
28283
- start = _this$range.start,
28284
- end = _this$range.end;
28285
- return h(Container, {
28286
- "class": this.$props.className
28287
- }, [this.$props.title && h(Title, {
28288
- "class": getClassName$f(this.$props.innerClass, 'title')
28289
- }, [this.$props.title]), h(vueNoSsr_common, [h(Slider, {
28290
- "class": getClassName$f(this.$props.innerClass, 'slider')
28291
- }, [h("vue-slider-component", {
28292
- "ref": "slider",
28293
- "attrs": {
28294
- "value": [Math.floor(Math.max(start, this.currentValue[0])), Math.ceil(Math.min(end, this.currentValue[1]))],
28295
- "min": Math.floor(Math.min(start, this.currentValue[0])),
28296
- "max": Math.ceil(Math.max(end, this.currentValue[1])),
28297
- "dotSize": 20,
28298
- "height": 4,
28299
- "enable-cross": false,
28300
- "tooltip": "always"
28301
- },
28302
- "on": {
28303
- "drag-end": this.handleSlider
28304
- },
28305
- "props": _extends({}, this.$props.sliderOptions)
28306
- }), this.labels ? h("div", {
28307
- "class": "label-container"
28308
- }, [h("label", {
28309
- "class": getClassName$f(this.$props.innerClass, 'label') || 'range-label-left'
28310
- }, [this.labels.start]), h("label", {
28311
- "class": getClassName$f(this.$props.innerClass, 'label') || 'range-label-right'
28312
- }, [this.labels.end])]) : null])])]);
28706
+ return h(Image$1, helper$1([{
28707
+ "style": {
28708
+ backgroundImage: "url(" + src + ")"
28709
+ }
28710
+ }, props]));
28313
28711
  }
28314
28712
  };
28315
28713
 
28316
- DynamicRangeSlider.defaultQuery = function (values, props) {
28317
- var query = null;
28318
-
28319
- if (Array.isArray(values) && values.length) {
28320
- var _range;
28714
+ ResultCardImage.install = function (Vue) {
28715
+ Vue.component(ResultCardImage.name, ResultCardImage);
28716
+ };
28321
28717
 
28322
- query = {
28323
- range: (_range = {}, _range[props.dataField] = {
28324
- gte: values[0],
28325
- lte: values[1],
28326
- boost: 2.0
28327
- }, _range)
28328
- };
28718
+ var ResultCardDescription = {
28719
+ name: 'ResultCardDescription',
28720
+ functional: true,
28721
+ render: function render(_, _ref) {
28722
+ var props = _ref.props,
28723
+ children = _ref.children;
28724
+ var h = arguments[0];
28725
+ return h("article", helper$1([{}, props]), [children]);
28329
28726
  }
28727
+ };
28330
28728
 
28331
- if (query && props.nestedField) {
28332
- return {
28333
- query: {
28334
- nested: {
28335
- path: props.nestedField,
28336
- query: query
28337
- }
28729
+ ResultCardDescription.install = function (Vue) {
28730
+ Vue.component(ResultCardDescription.name, ResultCardDescription);
28731
+ };
28732
+
28733
+ var _excluded$2 = ["href", "target"];
28734
+ var ResultCard = {
28735
+ name: 'ResultCard',
28736
+ components: {
28737
+ ResultCardTitle: ResultCardTitle,
28738
+ ResultCardImage: ResultCardImage,
28739
+ ResultCardDescription: ResultCardDescription
28740
+ },
28741
+ props: {
28742
+ target: VueTypes.string.def('_blank'),
28743
+ href: types.string
28744
+ },
28745
+ render: function render() {
28746
+ var h = arguments[0];
28747
+ var children = this.$slots["default"];
28748
+
28749
+ var _this$$props = this.$props,
28750
+ href = _this$$props.href,
28751
+ target = _this$$props.target,
28752
+ rest = _objectWithoutPropertiesLoose(_this$$props, _excluded$2);
28753
+
28754
+ return h(Card, helper$1([{
28755
+ "attrs": {
28756
+ "href": href,
28757
+ "target": target,
28758
+ "rel": target === '_blank' ? 'noopener noreferrer' : null
28338
28759
  }
28339
- };
28760
+ }, rest]), [children]);
28340
28761
  }
28762
+ };
28341
28763
 
28342
- return query;
28764
+ ResultCard.install = function (Vue) {
28765
+ Vue.component(ResultCard.name, ResultCard);
28766
+ Vue.component(ResultCardTitle.name, ResultCardTitle);
28767
+ Vue.component(ResultCardImage.name, ResultCardImage);
28768
+ Vue.component(ResultCardDescription.name, ResultCardDescription);
28343
28769
  };
28344
28770
 
28345
- DynamicRangeSlider.parseValue = function (value) {
28346
- if (value) {
28347
- return Array.isArray(value) ? value : [value.start, value.end];
28771
+ var ResultListContent = {
28772
+ name: 'ResultListContent',
28773
+ functional: true,
28774
+ render: function render(_, _ref) {
28775
+ var props = _ref.props,
28776
+ children = _ref.children;
28777
+ var h = arguments[0];
28778
+ return h("article", helper$1([{}, props]), [children]);
28348
28779
  }
28780
+ };
28349
28781
 
28350
- return [];
28782
+ ResultListContent.install = function (Vue) {
28783
+ Vue.component(ResultListContent.name, ResultListContent);
28351
28784
  };
28352
28785
 
28353
- DynamicRangeSlider.hasInternalComponent = function () {
28354
- return true;
28786
+ var ResultListDescription = {
28787
+ name: 'ResultListDescription',
28788
+ functional: true,
28789
+ render: function render(_, _ref) {
28790
+ var props = _ref.props,
28791
+ children = _ref.children;
28792
+ var h = arguments[0];
28793
+ return h("div", helper$1([{}, props]), [children]);
28794
+ }
28355
28795
  };
28356
28796
 
28357
- var mapStateToProps$f = function mapStateToProps(state, props) {
28358
- var componentId = state.aggregations[props.componentId];
28359
- var internalRange = state.aggregations[props.componentId + "__range__internal"];
28360
- var options = componentId && componentId[props.dataField];
28361
- var range = state.aggregations[props.componentId + "__range__internal"];
28797
+ ResultListDescription.install = function (Vue) {
28798
+ Vue.component(ResultListDescription.name, ResultListDescription);
28799
+ };
28362
28800
 
28363
- if (props.nestedField) {
28364
- options = options && componentId[props.dataField][props.nestedField] && componentId[props.dataField][props.nestedField].buckets ? componentId[props.dataField][props.nestedField].buckets : [];
28365
- range = range && internalRange[props.nestedField].min ? {
28366
- start: internalRange[props.nestedField].min.value,
28367
- end: internalRange[props.nestedField].max.value
28368
- } : null;
28369
- } else {
28370
- options = options && componentId[props.dataField].buckets ? componentId[props.dataField].buckets : [];
28371
- range = range && internalRange.min ? {
28372
- start: internalRange.min.value,
28373
- end: internalRange.max.value
28374
- } : null;
28801
+ var _excluded$3 = ["src", "small"];
28802
+ var ResultListImage = {
28803
+ name: 'ResultListImage',
28804
+ props: {
28805
+ src: VueTypes.string.isRequired,
28806
+ small: VueTypes.bool.def(false)
28807
+ },
28808
+ render: function render() {
28809
+ var h = arguments[0];
28810
+
28811
+ var _this$$props = this.$props,
28812
+ src = _this$$props.src,
28813
+ small = _this$$props.small,
28814
+ props = _objectWithoutPropertiesLoose(_this$$props, _excluded$3);
28815
+
28816
+ return h(Image, helper$1([{
28817
+ "attrs": {
28818
+ "src": src,
28819
+ "small": small
28820
+ }
28821
+ }, props]));
28375
28822
  }
28823
+ };
28376
28824
 
28377
- return {
28378
- options: options,
28379
- range: range,
28380
- selectedValue: state.selectedValues[props.componentId] ? state.selectedValues[props.componentId].value : null,
28381
- componentProps: state.props[props.componentId],
28382
- enableAppbase: state.config.enableAppbase
28383
- };
28825
+ ResultListImage.install = function (Vue) {
28826
+ Vue.component(ResultListImage.name, ResultListImage);
28384
28827
  };
28385
28828
 
28386
- var mapDispatchtoProps$c = {
28387
- addComponent: addComponent$1,
28388
- removeComponent: removeComponent$1,
28389
- updateQuery: updateQuery$c,
28390
- watchComponent: watchComponent$1,
28391
- setQueryListener: setQueryListener$1,
28392
- setQueryOptions: setQueryOptions$b,
28393
- setComponentProps: setComponentProps$1,
28394
- setCustomQuery: setCustomQuery$b,
28395
- updateComponentProps: updateComponentProps$2
28829
+ var ResultListTitle = {
28830
+ name: 'ResultListTitle',
28831
+ render: function render() {
28832
+ var h = arguments[0];
28833
+ var children = this.$slots["default"];
28834
+ return h(Title, helper$1([{}, this.$props]), [children]);
28835
+ }
28396
28836
  };
28397
- var RangeConnected$3 = connect(mapStateToProps$f, mapDispatchtoProps$c)(DynamicRangeSlider);
28398
28837
 
28399
- DynamicRangeSlider.install = function (Vue) {
28400
- Vue.component(DynamicRangeSlider.name, RangeConnected$3);
28401
- }; // Add componentType for SSR
28838
+ ResultListTitle.install = function (Vue) {
28839
+ Vue.component(ResultListTitle.name, ResultListTitle);
28840
+ };
28841
+
28842
+ var _excluded$4 = ["href", "target"];
28843
+ var ResultList = {
28844
+ name: 'ResultList',
28845
+ props: {
28846
+ href: types.string,
28847
+ target: VueTypes.string.def('_blank')
28848
+ },
28849
+ components: {
28850
+ ResultListContent: ResultListContent,
28851
+ ResultListDescription: ResultListDescription,
28852
+ ResultListImage: ResultListImage,
28853
+ ResultListTitle: ResultListTitle
28854
+ },
28855
+ data: function data() {
28856
+ this.__state = {
28857
+ hasImage: false,
28858
+ isSmall: false
28859
+ };
28860
+ return this.__state;
28861
+ },
28862
+ mounted: function mounted() {
28863
+ var children = this.$slots["default"];
28864
+ var ImageChild = children.find(function (o) {
28865
+ return o.componentOptions && o.componentOptions.tag === ResultListImage.name;
28866
+ });
28402
28867
 
28868
+ if (ImageChild && ImageChild.componentOptions && ImageChild.componentOptions.propsData) {
28869
+ this.hasImage = true;
28403
28870
 
28404
- DynamicRangeSlider.componentType = constants_1$1.dynamicRangeSlider;
28871
+ if (ImageChild.componentOptions.propsData.small) {
28872
+ this.isSmall = true;
28873
+ }
28874
+ }
28875
+ },
28876
+ render: function render() {
28877
+ var h = arguments[0];
28878
+
28879
+ var _this$$props = this.$props,
28880
+ href = _this$$props.href,
28881
+ target = _this$$props.target,
28882
+ props = _objectWithoutPropertiesLoose(_this$$props, _excluded$4);
28883
+
28884
+ var hasImage = this.hasImage,
28885
+ isSmall = this.isSmall;
28886
+ var children = this.$slots["default"];
28887
+ return h(ListItem, helper$1([{
28888
+ "attrs": {
28889
+ "href": href,
28890
+ "image": hasImage,
28891
+ "small": isSmall,
28892
+ "target": target,
28893
+ "rel": target === '_blank' ? 'noopener noreferrer' : null
28894
+ }
28895
+ }, props]), [children]);
28896
+ }
28897
+ };
28898
+
28899
+ ResultList.install = function (Vue) {
28900
+ Vue.component(ResultList.name, ResultList);
28901
+ Vue.component(ResultListContent.name, ResultListContent);
28902
+ Vue.component(ResultListDescription.name, ResultListDescription);
28903
+ Vue.component(ResultListImage.name, ResultListImage);
28904
+ Vue.component(ResultListTitle.name, ResultListTitle);
28905
+ };
28405
28906
 
28406
28907
  var getSearchState = lib_8.getSearchState;
28407
28908
  var defaultKeys = ['hits', 'value', 'aggregations', 'error'];
@@ -28618,7 +29119,7 @@
28618
29119
  }
28619
29120
  };
28620
29121
 
28621
- var mapStateToProps$g = function mapStateToProps(state, props) {
29122
+ var mapStateToProps$h = function mapStateToProps(state, props) {
28622
29123
  return {
28623
29124
  selectedValues: filterByComponentIds(state.selectedValues, props),
28624
29125
  queryLog: filterByComponentIds(state.queryLog, props),
@@ -28632,14 +29133,14 @@
28632
29133
  customData: filterByComponentIds(state.customData, props),
28633
29134
  settings: filterByComponentIds(state.settings, props),
28634
29135
  rawData: filterByComponentIds(state.rawData, props),
28635
- components: filterByComponentIds(state.components, props)
29136
+ components: state.components
28636
29137
  };
28637
29138
  };
28638
29139
 
28639
29140
  var mapDispatchtoProps$d = {
28640
29141
  setValues: value_6
28641
29142
  };
28642
- var StateProviderConnected = connect(mapStateToProps$g, mapDispatchtoProps$d)(StateProvider);
29143
+ var StateProviderConnected = connect(mapStateToProps$h, mapDispatchtoProps$d)(StateProvider);
28643
29144
 
28644
29145
  StateProvider.install = function (Vue) {
28645
29146
  Vue.component(StateProvider.name, StateProviderConnected);
@@ -35231,9 +35732,9 @@
35231
35732
  setDefaultQuery$8 = lib_5.setDefaultQuery,
35232
35733
  recordResultClick$1 = lib_5.recordResultClick,
35233
35734
  setMapData = lib_5.setMapData;
35234
- var isEqual$g = lib_8.isEqual,
35735
+ var isEqual$h = lib_8.isEqual,
35235
35736
  getQueryOptions$5 = lib_8.getQueryOptions,
35236
- getClassName$g = lib_8.getClassName,
35737
+ getClassName$h = lib_8.getClassName,
35237
35738
  parseHits$2 = lib_8.parseHits,
35238
35739
  getOptionsFromQuery$4 = lib_8.getOptionsFromQuery,
35239
35740
  getResultStats$4 = lib_8.getResultStats; // default map center
@@ -35427,17 +35928,17 @@
35427
35928
  }
35428
35929
  },
35429
35930
  promotedResults: function promotedResults(newVal, oldVal) {
35430
- if (!isEqual$g(newVal, oldVal)) {
35931
+ if (!isEqual$h(newVal, oldVal)) {
35431
35932
  this.$emit('data', this.getData());
35432
35933
  }
35433
35934
  },
35434
35935
  hidden: function hidden(newVal, oldVal) {
35435
- if (!isEqual$g(newVal, oldVal)) {
35936
+ if (!isEqual$h(newVal, oldVal)) {
35436
35937
  this.$emit('data', this.getData());
35437
35938
  }
35438
35939
  },
35439
35940
  time: function time(newVal, oldVal) {
35440
- if (!isEqual$g(newVal, oldVal)) {
35941
+ if (!isEqual$h(newVal, oldVal)) {
35441
35942
  this.$emit('data', this.getData());
35442
35943
  }
35443
35944
  },
@@ -35454,7 +35955,7 @@
35454
35955
  rawData: function rawData(newVal, oldVal) {
35455
35956
  var _this = this;
35456
35957
 
35457
- if (!isEqual$g(newVal, oldVal)) {
35958
+ if (!isEqual$h(newVal, oldVal)) {
35458
35959
  var promotedResults = this.promotedResults,
35459
35960
  hits = this.hits;
35460
35961
  var results = parseHits$2(hits) || [];
@@ -35495,7 +35996,7 @@
35495
35996
  }
35496
35997
  },
35497
35998
  center: function center(newVal, oldVal) {
35498
- if (!isEqual$g(newVal, oldVal)) {
35999
+ if (!isEqual$h(newVal, oldVal)) {
35499
36000
  var persistMapQuery = !!this.center; // we need to forceExecute the query because the center has changed
35500
36001
 
35501
36002
  var forceExecute = true;
@@ -35929,7 +36430,7 @@
35929
36430
  zIndex: 10000
35930
36431
  },
35931
36432
  "attrs": {
35932
- "className": getClassName$g(this.innerClass, 'checkboxContainer') || null
36433
+ "className": getClassName$h(this.innerClass, 'checkboxContainer') || null
35933
36434
  }
35934
36435
  }, [h(Checkbox, {
35935
36436
  "attrs": {
@@ -35938,13 +36439,13 @@
35938
36439
  "checked": this.searchAsMove,
35939
36440
  "show": true
35940
36441
  },
35941
- "class": getClassName$g(this.$props.innerClass, 'checkbox'),
36442
+ "class": getClassName$h(this.$props.innerClass, 'checkbox'),
35942
36443
  "on": {
35943
36444
  "click": this.toggleSearchAsMove
35944
36445
  }
35945
36446
  }), h("label", {
35946
36447
  "attrs": {
35947
- "className": getClassName$g(this.innerClass, 'label') || null,
36448
+ "className": getClassName$h(this.innerClass, 'label') || null,
35948
36449
  "for": this.$props.componentId + "-searchasmove"
35949
36450
  }
35950
36451
  }, [this.searchAsMoveLabel])]);
@@ -36058,7 +36559,7 @@
36058
36559
  }
36059
36560
  };
36060
36561
 
36061
- var mapStateToProps$h = function mapStateToProps(state, props) {
36562
+ var mapStateToProps$i = function mapStateToProps(state, props) {
36062
36563
  return {
36063
36564
  defaultPage: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value - 1 || -1,
36064
36565
  error: state.error[props.componentId],
@@ -36084,10 +36585,10 @@
36084
36585
  recordResultClick: recordResultClick$1,
36085
36586
  setMapData: setMapData
36086
36587
  };
36087
- var RMConnected = ComponentWrapper$1(connect(mapStateToProps$h, mapDispatchToProps$4)(ReactiveMap), {
36588
+ var RMConnected = PreferencesConsumer(ComponentWrapper$1(connect(mapStateToProps$i, mapDispatchToProps$4)(ReactiveMap), {
36088
36589
  componentType: constants_1$1.reactiveMap,
36089
36590
  internalComponent: true
36090
- });
36591
+ }));
36091
36592
 
36092
36593
  ReactiveMap.install = function (Vue) {
36093
36594
  Vue.component(ReactiveMap.name, RMConnected);
@@ -36451,7 +36952,7 @@
36451
36952
  };
36452
36953
 
36453
36954
  var _excluded$j = ["options"];
36454
- var isEqual$h = lib_8.isEqual;
36955
+ var isEqual$i = lib_8.isEqual;
36455
36956
  var recordResultClick$2 = lib_5.recordResultClick;
36456
36957
  var ClusterMarkers = {
36457
36958
  name: 'ClusterMarkers',
@@ -36486,7 +36987,7 @@
36486
36987
  },
36487
36988
  watch: {
36488
36989
  markers: function markers(newVal, oldVal) {
36489
- if (!isEqual$h(oldVal, newVal)) {
36990
+ if (!isEqual$i(oldVal, newVal)) {
36490
36991
  this.buildMarkers(newVal);
36491
36992
  }
36492
36993
  }
@@ -36990,9 +37491,9 @@
36990
37491
  }
36991
37492
  };
36992
37493
 
36993
- var _templateObject$p, _templateObject2$b, _templateObject3$8;
36994
- var MapPin = index$1('div')(_templateObject$p || (_templateObject$p = _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"])));
36995
- var MapPinArrow = index$1('div')(_templateObject2$b || (_templateObject2$b = _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"])));
37494
+ var _templateObject$q, _templateObject2$c, _templateObject3$8;
37495
+ var MapPin = index$1('div')(_templateObject$q || (_templateObject$q = _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"])));
37496
+ var MapPinArrow = index$1('div')(_templateObject2$c || (_templateObject2$c = _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"])));
36996
37497
  var mapPinWrapper = css(_templateObject3$8 || (_templateObject3$8 = _taggedTemplateLiteralLoose(["\n\t&:hover,\n\t&:focus {\n\t\tz-index: 200;\n\t}\n"])));
36997
37498
 
36998
37499
  var Marker = components.Marker;
@@ -37473,7 +37974,7 @@
37473
37974
  var currentInstance = this;
37474
37975
 
37475
37976
  while (currentInstance) {
37476
- if (currentInstance && currentInstance._name === '<ConnectClusterMarkers>') {
37977
+ if (currentInstance && currentInstance.$options && currentInstance.$options.name === 'connect-ClusterMarkers') {
37477
37978
  clusterManagerInstance = currentInstance;
37478
37979
  currentInstance = null;
37479
37980
  } else if (currentInstance.$children) {
@@ -38093,325 +38594,7 @@
38093
38594
  });
38094
38595
  }
38095
38596
 
38096
- var version = "1.32.3";
38097
-
38098
- var _templateObject$q, _templateObject2$c;
38099
-
38100
- var alert = function alert(_ref) {
38101
- var theme = _ref.theme;
38102
- return css(_templateObject$q || (_templateObject$q = _taggedTemplateLiteralLoose(["\n\tcolor: ", ";\n"])), theme.colors.alertColor);
38103
- };
38104
-
38105
- var Content = index$1('div')(_templateObject2$c || (_templateObject2$c = _taggedTemplateLiteralLoose(["\n\t", ";\n\tfont-size: 13px;\n\tmargin: 8px;\n"])), function (props) {
38106
- return props.alert && alert;
38107
- });
38108
-
38109
- var getClassName$h = lib_8.getClassName,
38110
- isEqual$i = lib_8.isEqual;
38111
- var RangeInput = {
38112
- name: 'RangeInput',
38113
- components: {
38114
- RangeSlider: RangeConnected$2
38115
- },
38116
- inject: {
38117
- theme: {
38118
- from: 'theme_reactivesearch'
38119
- }
38120
- },
38121
- data: function data() {
38122
- var state = {
38123
- currentValue: {
38124
- start: this.$props.range ? this.$props.range.start : 0,
38125
- end: this.$props.range ? this.$props.range.end : 10
38126
- },
38127
- isStartValid: true,
38128
- isEndValid: true
38129
- };
38130
- return state;
38131
- },
38132
- props: {
38133
- className: {
38134
- types: types.string,
38135
- "default": ''
38136
- },
38137
- defaultValue: types.range,
38138
- validateRange: types.func,
38139
- value: types.range,
38140
- dataField: types.stringRequired,
38141
- innerClass: types.style,
38142
- range: {
38143
- types: types.range,
38144
- "default": function _default() {
38145
- return {
38146
- start: 0,
38147
- end: 10
38148
- };
38149
- }
38150
- },
38151
- rangeLabels: types.rangeLabels,
38152
- stepValue: types.number,
38153
- componentStyle: types.style,
38154
- componentId: types.stringRequired,
38155
- includeNullValues: VueTypes.bool,
38156
- beforeValueChange: types.func,
38157
- customQuery: types.func,
38158
- data: types.data,
38159
- filterLabel: types.string,
38160
- react: types.react,
38161
- showFilter: VueTypes.bool.def(true),
38162
- showCheckbox: VueTypes.bool.def(true),
38163
- title: types.title,
38164
- URLParams: VueTypes.bool.def(false),
38165
- sliderOptions: VueTypes.object.def({}),
38166
- nestedField: types.string,
38167
- endpoint: types.endpointConfig
38168
- },
38169
- methods: {
38170
- shouldUpdate: function shouldUpdate(value) {
38171
- var validateRange = this.$props.validateRange;
38172
-
38173
- if (validateRange && value) {
38174
- return validateRange([value.start, value.end]);
38175
- }
38176
-
38177
- if (value) {
38178
- return value.start <= value.end;
38179
- }
38180
-
38181
- return false;
38182
- },
38183
- isControlled: function isControlled() {
38184
- if (this.$props.value && this.$listeners) {
38185
- return true;
38186
- }
38187
-
38188
- return false;
38189
- },
38190
- handleChange: function handleChange(value, event) {
38191
- var currentValue = value;
38192
-
38193
- if (this.shouldUpdate(value) && !isEqual$i(value, this.currentValue)) {
38194
- switch (event) {
38195
- case 'change':
38196
- if (!value) {
38197
- currentValue = {
38198
- start: this.$props.range ? this.$props.range.start : 0,
38199
- end: this.$props.range ? this.$props.range.end : 10
38200
- };
38201
- }
38202
-
38203
- this.$data.currentValue = _extends({}, currentValue);
38204
- this.$emit('change', this.$data.currentValue);
38205
- break;
38206
-
38207
- case 'value-change':
38208
- this.$emit('valueChange', this.$data.currentValue);
38209
- this.$emit('value-change', this.$data.currentValue);
38210
- break;
38211
-
38212
- default:
38213
- this.$data.currentValue = _extends({}, currentValue);
38214
- break;
38215
- }
38216
- }
38217
- },
38218
- handleOnChange: function handleOnChange(value) {
38219
- this.handleChange(value || this.$props.range, 'change');
38220
- },
38221
- handleValueChange: function handleValueChange(value) {
38222
- this.handleChange(value, 'value-change');
38223
- },
38224
- handleInputChange: function handleInputChange(e) {
38225
- var _e$target = e.target,
38226
- name = _e$target.name,
38227
- value = _e$target.value;
38228
-
38229
- if (Number.isNaN(value)) {
38230
- if (name === 'start') {
38231
- this.$data.isStartValid = false;
38232
- } else {
38233
- this.$data.isEndValid = false;
38234
- }
38235
- } else if (name === 'start' && !this.$data.isStartValid) {
38236
- this.$data.isStartValid = true;
38237
- } else if (name === 'end' && !this.$data.isEndValid) {
38238
- this.$data.isEndValid = true;
38239
- }
38240
-
38241
- if (this.$data.isStartValid && this.$data.isEndValid) {
38242
- if (name === 'start') {
38243
- this.handleChange({
38244
- start: Number(value),
38245
- end: this.$data.currentValue.end
38246
- }, 'change');
38247
- } else {
38248
- this.handleChange({
38249
- start: this.$data.currentValue.start,
38250
- end: Number(value)
38251
- }, 'change');
38252
- }
38253
- }
38254
- }
38255
- },
38256
- watch: {
38257
- defaultValue: function defaultValue(newVal, oldVal) {
38258
- if (oldVal.start !== newVal.start || oldVal.end !== newVal.end) {
38259
- this.handleChange(newVal);
38260
- }
38261
- },
38262
- value: function value(newVal, oldVal) {
38263
- if (!isEqual$i(newVal, oldVal)) {
38264
- if (this.isControlled()) {
38265
- this.handleChange(newVal, 'change');
38266
- }
38267
- }
38268
- }
38269
- },
38270
- created: function created() {
38271
- if (this.$props.defaultValue && this.$props.defaultValue.start && this.$props.defaultValue.end) {
38272
- this.handleChange(this.$props.defaultValue);
38273
- }
38274
-
38275
- if (this.isControlled()) {
38276
- this.handleChange(this.$props.value, 'change');
38277
- }
38278
- },
38279
- render: function render() {
38280
- var h = arguments[0];
38281
- var _this$$props = this.$props,
38282
- className = _this$$props.className,
38283
- dataField = _this$$props.dataField,
38284
- range = _this$$props.range,
38285
- rangeLabels = _this$$props.rangeLabels,
38286
- componentId = _this$$props.componentId,
38287
- innerClass = _this$$props.innerClass,
38288
- stepValue = _this$$props.stepValue,
38289
- componentStyle = _this$$props.componentStyle,
38290
- themePreset = _this$$props.themePreset,
38291
- includeNullValues = _this$$props.includeNullValues,
38292
- beforeValueChange = _this$$props.beforeValueChange,
38293
- customQuery = _this$$props.customQuery,
38294
- data = _this$$props.data,
38295
- filterLabel = _this$$props.filterLabel,
38296
- react = _this$$props.react,
38297
- showFilter = _this$$props.showFilter,
38298
- showCheckbox = _this$$props.showCheckbox,
38299
- title = _this$$props.title,
38300
- URLParams = _this$$props.URLParams,
38301
- sliderOptions = _this$$props.sliderOptions,
38302
- nestedField = _this$$props.nestedField;
38303
- return h(Container, {
38304
- "style": componentStyle,
38305
- "class": className
38306
- }, [h(RangeConnected$2, {
38307
- "attrs": {
38308
- "componentId": componentId,
38309
- "value": {
38310
- start: this.currentValue.start,
38311
- end: this.currentValue.end
38312
- },
38313
- "range": range,
38314
- "dataField": dataField,
38315
- "rangeLabels": rangeLabels,
38316
- "includeNullValues": includeNullValues,
38317
- "beforeValueChange": beforeValueChange,
38318
- "customQuery": customQuery,
38319
- "data": data,
38320
- "filterLabel": filterLabel,
38321
- "react": react,
38322
- "showFilter": showFilter,
38323
- "showCheckbox": showCheckbox,
38324
- "title": title,
38325
- "uRLParams": URLParams,
38326
- "sliderOptions": sliderOptions,
38327
- "nestedField": nestedField
38328
- },
38329
- "on": {
38330
- "change": this.handleOnChange,
38331
- "value-change": this.handleValueChange
38332
- }
38333
- }), h(Flex, {
38334
- "class": getClassName$h(innerClass, 'input-container') || ''
38335
- }, [h(Flex, {
38336
- "attrs": {
38337
- "direction": "column",
38338
- "flex": 2
38339
- }
38340
- }, [h(Input, {
38341
- "key": componentId + "-start-value",
38342
- "attrs": {
38343
- "name": "start",
38344
- "type": "number",
38345
- "step": stepValue,
38346
- "themePreset": themePreset,
38347
- "aria-label": componentId + "-start-input",
38348
- "min": this.$props.range ? this.$props.range.start : 0,
38349
- "alert": !this.isStartValid
38350
- },
38351
- "on": {
38352
- "change": this.handleInputChange
38353
- },
38354
- "class": getClassName$h(innerClass, 'input') || '',
38355
- "domProps": _extends({}, {
38356
- value: this.currentValue.start
38357
- })
38358
- }), !this.isStartValid && h(Content, {
38359
- "attrs": {
38360
- "alert": true
38361
- }
38362
- }, ["Input range is invalid"])]), h(Flex, {
38363
- "attrs": {
38364
- "justifyContent": "center",
38365
- "alignItems": "center",
38366
- "flex": 1
38367
- }
38368
- }, ["-"]), h(Flex, {
38369
- "attrs": {
38370
- "direction": "column",
38371
- "flex": 2
38372
- }
38373
- }, [h(Input, {
38374
- "key": componentId + "-end-value",
38375
- "attrs": {
38376
- "name": "end",
38377
- "type": "number",
38378
- "step": stepValue,
38379
- "themePreset": themePreset,
38380
- "aria-label": componentId + "-end-input",
38381
- "max": this.$props.range ? this.$props.range.end : 10,
38382
- "alert": !this.isEndValid
38383
- },
38384
- "on": {
38385
- "change": this.handleInputChange
38386
- },
38387
- "class": getClassName$h(innerClass, 'input') || '',
38388
- "domProps": _extends({}, {
38389
- value: this.currentValue.end
38390
- })
38391
- }), !this.isEndValid && h(Content, {
38392
- "attrs": {
38393
- "alert": true
38394
- }
38395
- }, ["Input range is invalid"])])])]);
38396
- }
38397
- };
38398
-
38399
- var mapStateToProps$i = function mapStateToProps(state) {
38400
- return {
38401
- themePreset: state.config.themePreset
38402
- };
38403
- };
38404
-
38405
- var RangeConnected$4 = ComponentWrapper$1(connect(mapStateToProps$i, {})(RangeInput), {
38406
- componentType: constants_1$1.rangeInput
38407
- });
38408
-
38409
- RangeInput.install = function (Vue) {
38410
- Vue.component(RangeInput.name, RangeConnected$4);
38411
- }; // Add componentType for SSR
38412
-
38413
-
38414
- RangeInput.componentType = constants_1$1.rangeInput;
38597
+ var version = "1.33.0";
38415
38598
 
38416
38599
  var components$1 = [ReactiveList, ResultCard, ResultList, ReactiveBase, DataSearch, SearchBox, SingleList, MultiList, SingleRange, MultiRange, RangeSlider, DynamicRangeSlider, ReactiveComponent, SelectedFilters, ToggleButton, SingleDropdownList, MultiDropdownList, StateProvider, RangeInput];
38417
38600
  function install (Vue) {
@@ -38451,6 +38634,7 @@
38451
38634
  exports.SingleRange = SingleRange;
38452
38635
  exports.StateProvider = StateProvider;
38453
38636
  exports.ToggleButton = ToggleButton;
38637
+ exports.componentTypes = constants_1$1;
38454
38638
  exports.default = index$3;
38455
38639
  exports.initReactivesearch = initReactivesearch;
38456
38640
  exports.install = install;