@appbaseio/reactivesearch-vue 3.0.0-alpha.7 → 3.0.0-rc.1

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 (61) hide show
  1. package/dist/@appbaseio/reactivesearch-vue.umd.js +3046 -1186
  2. package/dist/@appbaseio/reactivesearch-vue.umd.js.map +1 -1
  3. package/dist/@appbaseio/reactivesearch-vue.umd.min.js +5 -5
  4. package/dist/@appbaseio/reactivesearch-vue.umd.min.js.map +1 -1
  5. package/dist/cjs/{ComponentWrapper-2dc930e1.js → ComponentWrapper-9146d811.js} +1 -1
  6. package/dist/cjs/{DropDown-f48bea16.js → DropDown-b16418e9.js} +1 -1
  7. package/dist/cjs/DynamicRangeSlider.js +2 -2
  8. package/dist/cjs/{Flex-d5675ea6.js → Flex-ddde6d26.js} +3 -1
  9. package/dist/cjs/{ListItem-23af8974.js → ListItem-7a682970.js} +6 -1
  10. package/dist/cjs/MultiDropdownList.js +5 -5
  11. package/dist/cjs/MultiList.js +4 -4
  12. package/dist/cjs/MultiRange.js +3 -3
  13. package/dist/cjs/{PreferencesConsumer-2c69ac61.js → PreferencesConsumer-85dee673.js} +1 -1
  14. package/dist/cjs/RangeInput.js +4 -4
  15. package/dist/cjs/RangeSlider.js +3 -3
  16. package/dist/cjs/ReactiveBase.js +1 -1
  17. package/dist/cjs/ReactiveComponent.js +297 -43
  18. package/dist/cjs/ReactiveGoogleMap.js +3 -3
  19. package/dist/cjs/ReactiveList.js +5 -5
  20. package/dist/cjs/ResultList.js +1 -1
  21. package/dist/cjs/SelectedFilters.js +1 -1
  22. package/dist/cjs/SingleDropdownList.js +5 -5
  23. package/dist/cjs/SingleList.js +4 -4
  24. package/dist/cjs/SingleRange.js +3 -3
  25. package/dist/cjs/StateProvider.js +1 -1
  26. package/dist/cjs/ToggleButton.js +3 -3
  27. package/dist/cjs/{index-1481798c.js → index-779ed366.js} +2 -4
  28. package/dist/cjs/index.js +17 -14
  29. package/dist/cjs/{ReactiveComponent-8180c806.js → install-7cdf6798.js} +756 -244
  30. package/dist/cjs/install.js +28 -32
  31. package/dist/cjs/{utils-36b1b880.js → utils-c9bd5628.js} +9 -0
  32. package/dist/cjs/version.js +1 -1
  33. package/dist/es/{ComponentWrapper-3a215eed.js → ComponentWrapper-8a3c388d.js} +1 -1
  34. package/dist/es/{DropDown-7174661a.js → DropDown-fc1fef02.js} +1 -1
  35. package/dist/es/DynamicRangeSlider.js +2 -2
  36. package/dist/es/{Flex-a08e22d7.js → Flex-25792bc3.js} +3 -1
  37. package/dist/es/{ListItem-1cb1b4de.js → ListItem-e3c6acf4.js} +6 -1
  38. package/dist/es/MultiDropdownList.js +5 -5
  39. package/dist/es/MultiList.js +4 -4
  40. package/dist/es/MultiRange.js +3 -3
  41. package/dist/es/{PreferencesConsumer-24e88f3b.js → PreferencesConsumer-b058d14e.js} +1 -1
  42. package/dist/es/RangeInput.js +4 -4
  43. package/dist/es/RangeSlider.js +3 -3
  44. package/dist/es/ReactiveBase.js +1 -1
  45. package/dist/es/ReactiveComponent.js +298 -42
  46. package/dist/es/ReactiveGoogleMap.js +3 -3
  47. package/dist/es/ReactiveList.js +5 -5
  48. package/dist/es/ResultList.js +1 -1
  49. package/dist/es/SelectedFilters.js +1 -1
  50. package/dist/es/SingleDropdownList.js +5 -5
  51. package/dist/es/SingleList.js +4 -4
  52. package/dist/es/SingleRange.js +3 -3
  53. package/dist/es/StateProvider.js +1 -1
  54. package/dist/es/ToggleButton.js +3 -3
  55. package/dist/es/{index-4520a598.js → index-882489e1.js} +2 -4
  56. package/dist/es/index.js +11 -10
  57. package/dist/es/{ReactiveComponent-f78ff2cd.js → install-0c7962bc.js} +765 -255
  58. package/dist/es/install.js +26 -34
  59. package/dist/es/{utils-9e5a16a1.js → utils-d7dd4f4e.js} +9 -1
  60. package/dist/es/version.js +1 -1
  61. package/package.json +2 -2
@@ -5325,7 +5325,8 @@
5325
5325
  };
5326
5326
  var featuredSuggestionsActionTypes = exports.featuredSuggestionsActionTypes = {
5327
5327
  NAVIGATE: 'navigate',
5328
- FUNCTION: 'function'
5328
+ FUNCTION: 'function',
5329
+ SELECT: 'select'
5329
5330
  };
5330
5331
  var queryFormatMillisecondsMap = exports.queryFormatMillisecondsMap = {
5331
5332
  minute: 60000,
@@ -6140,7 +6141,7 @@
6140
6141
  end: store.aggregations[component + '__range__internal'][componentProps.nestedField].max.value
6141
6142
  } : null;
6142
6143
  } else {
6143
- rangeValue = rangeValue && store.aggregations[component + '__range__internal'].min ? {
6144
+ rangeValue = rangeValue && store.aggregations[component + '__range__internal'].min && store.aggregations[component + '__range__internal'].min.value ? {
6144
6145
  start: store.aggregations[component + '__range__internal'].min.value,
6145
6146
  end: store.aggregations[component + '__range__internal'].max.value
6146
6147
  } : null;
@@ -12948,10 +12949,6 @@
12948
12949
  var connect = function connect() {
12949
12950
  return connector.apply(void 0, arguments);
12950
12951
  };
12951
- // connectToStore(...args, null, {
12952
- // storeKey,
12953
- // });
12954
-
12955
12952
  var X_SEARCH_CLIENT = 'ReactiveSearch Vue';
12956
12953
  var composeThemeObject = function composeThemeObject(ownTheme, userTheme) {
12957
12954
  if (ownTheme === void 0) {
@@ -13064,12 +13061,14 @@
13064
13061
  if (str === void 0) {
13065
13062
  str = '';
13066
13063
  }
13064
+ var propsWhichRequirePascalCase = ['u-r-l-params'];
13067
13065
  var arr = str.split('-');
13068
13066
  var capital = arr.map(function (item, index) {
13069
13067
  return index ? item.charAt(0).toUpperCase() + item.slice(1).toLowerCase() : item;
13070
13068
  });
13071
13069
  // ^-- change here.
13072
13070
  var capitalString = capital.join('');
13071
+ if (propsWhichRequirePascalCase.includes(str)) capitalString = capitalString[0].toUpperCase() + capitalString.substring(1);
13073
13072
  return capitalString || '';
13074
13073
  };
13075
13074
  var isEmpty = function isEmpty(val) {
@@ -13397,7 +13396,7 @@
13397
13396
  }, function (props) {
13398
13397
  return "url(" + props.src + ")";
13399
13398
  });
13400
- var ListItem = styled('a')(_templateObject3$1 || (_templateObject3$1 = _taggedTemplateLiteralLoose(["\n\twidth: 100%;\n\theight: auto;\n\toutline: none;\n\ttext-decoration: none;\n\tborder-radius: 0;\n\tbackground-color: ", ";\n\tdisplay: flex;\n\tflex-direction: row;\n\tmargin: 0;\n\tpadding: 10px;\n\tborder-bottom: 1px solid ", ";\n\tcolor: ", ";\n\t", "; all 0.3s ease;\n\n\t&:hover, &:focus {\n\t\tbackground-color: ", ";\n\t}\n\n\t&:last-child {\n\t\tborder: 0;\n\t}\n\n\th2 {\n\t\twidth: 100%;\n\t\tline-height: 1.2rem;\n\t\twhite-space: nowrap;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\tmargin: 0;\n\t\tpadding: 0 0 8px;\n\t}\n\n\tp {\n\t\tmargin: 0;\n\t}\n\n\tarticle {\n\t\twidth: ", ";\n\t\tpadding-left: ", ";\n\t\tfont-size: 0.9rem;\n\t}\n\n\t&:hover, &:focus {\n\t\tbox-shadow: 0 0 0 0 rgba(0,0,0,0.10);\n\t}\n\n\t@media (max-width: 420px) {\n\t\tmin-width: 0;\n\t\tmargin: 0;\n\t\tborder-radius: 0;\n\t\tbox-shadow: none;\n\t\tborder: 1px solid #eee;\n\n\t\t&:hover, &:focus {\n\t\t\tbox-shadow: 0;\n\t\t}\n\t}\n"])), function (_ref) {
13399
+ var ListItem = styled('a')(_templateObject3$1 || (_templateObject3$1 = _taggedTemplateLiteralLoose(["\n\twidth: 100%;\n\theight: auto;\n\toutline: none;\n\ttext-decoration: none;\n\tborder-radius: 0;\n\tbackground-color: ", ";\n\tdisplay: flex;\n\tflex-direction: row;\n\tmargin: 0;\n\tpadding: 10px;\n\tborder-bottom: 1px solid ", ";\n\tcolor: ", ";\n\t", "; all 0.3s ease;\n\n\t&:hover, &:focus {\n\t\tbackground-color: ", ";\n\t}\n\n\t&:last-child {\n\t\tborder: 0;\n\t}\n\n\th2 {\n\t\twidth: 100%;\n\t\tline-height: 1.2rem;\n\t\twhite-space: nowrap;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\tmargin: 0;\n\t\tpadding: 0 0 8px;\n\t}\n\n\tp {\n\t\tmargin: 0;\n\t}\n\n\tarticle {\n\t\twidth: ", ";\n\t\tpadding-left: ", ";\n\t\tfont-size: 0.9rem;\n\t}\n\n\t&:hover, &:focus {\n\t\tbox-shadow: 0 0 0 0 rgba(0,0,0,0.10);\n\t}\n\n\t@media (max-width: 420px) {\n\t\tmin-width: 0;\n\t\tmargin: 0;\n\t\tborder-radius: 0;\n\t\tbox-shadow: none;\n\t\tborder: 1px solid #eee;\n\n\t\t&:hover, &:focus {\n\t\t\tbox-shadow: 0;\n\t\t}\n\t}\n\n\t", "\n"])), function (_ref) {
13401
13400
  var theme = _ref.theme;
13402
13401
  return theme.colors.backgroundColor ? curriedLighten(0.1, theme.colors.backgroundColor) : '#fff';
13403
13402
  }, function (_ref2) {
@@ -13418,6 +13417,11 @@
13418
13417
  return '100%';
13419
13418
  }, function (props) {
13420
13419
  return props.image ? '10px' : 0;
13420
+ }, function (props) {
13421
+ if (props.isTreeListItem) {
13422
+ return 'border-bottom: none; width:max-content; cursor:pointer; padding: 5px 12px;';
13423
+ }
13424
+ return '';
13421
13425
  });
13422
13426
 
13423
13427
  var ResultListWrapper = {
@@ -13472,7 +13476,7 @@
13472
13476
  colors = _ref$theme$colors === void 0 ? {} : _ref$theme$colors;
13473
13477
  return "\n\tborder: 1px solid " + (colors.borderColor || '#ccc') + ";\n";
13474
13478
  };
13475
- var Flex = styled('div')(_templateObject$5 || (_templateObject$5 = _taggedTemplateLiteralLoose(["\n\tdisplay: ", ";\n\t", ";\n\t", ";\n\t", ";\n\t", ";\n\t", ";\n\n\t", ";\n\t", ";\n\n\t", ";\n\t", ";\n\t", ";\n\n\tsvg.cancel-icon {\n\t\tcursor: pointer;\n\t\tfill: ", ";\n\t\tflex-basis: 30px;\n\n\t\t&:hover {\n\t\t\tfill: ", ";\n\t\t}\n\t}\n"])), function (props) {
13479
+ var Flex = styled('div')(_templateObject$5 || (_templateObject$5 = _taggedTemplateLiteralLoose(["\n\tdisplay: ", ";\n\t", ";\n\t", ";\n\t", ";\n\t", ";\n\t", ";\n\n\t", ";\n\t", ";\n\t", ";\n\n\t", ";\n\t", ";\n\t", ";\n\n\tsvg.cancel-icon {\n\t\tcursor: pointer;\n\t\tfill: ", ";\n\t\tflex-basis: 30px;\n\n\t\t&:hover {\n\t\t\tfill: ", ";\n\t\t}\n\t}\n"])), function (props) {
13476
13480
  return props.inline ? 'inline-flex' : 'flex';
13477
13481
  }, function (props) {
13478
13482
  return (props.labelPosition === 'left' || props.iconPosition === 'right') && leftLabel;
@@ -13488,6 +13492,8 @@
13488
13492
  return props.justifyContent && "\n\t\t\tjustify-content: " + props.justifyContent + ";\n\t\t";
13489
13493
  }, function (props) {
13490
13494
  return props.alignItems && "\n\t\t\talign-items: " + props.alignItems + ";\n\t\t";
13495
+ }, function (props) {
13496
+ return props.gap && "\n\t\t\tgap: " + props.gap + ";\n\t\t";
13491
13497
  }, function (props) {
13492
13498
  return props.flex && "\n\t\t\tflex: " + props.flex + ";\n\t\t";
13493
13499
  }, function (props) {
@@ -20292,6 +20298,14 @@
20292
20298
  }
20293
20299
  return _extends({}, clonedQuery, extractQuery(props));
20294
20300
  };
20301
+ var sanitizeObject = function sanitizeObject(obj) {
20302
+ return JSON.parse(JSON.stringify(obj, function (key, value) {
20303
+ return (
20304
+ // eslint-disable-next-line eqeqeq
20305
+ value === null || value == {} || value === false ? undefined : value
20306
+ );
20307
+ }));
20308
+ };
20295
20309
 
20296
20310
  var updateQuery$2 = lib_5.updateQuery,
20297
20311
  setQueryOptions$1 = lib_5.setQueryOptions,
@@ -21140,234 +21154,2064 @@
21140
21154
  Vue.component(ListConnected$1.name, ListConnected$1);
21141
21155
  };
21142
21156
 
21143
- var _templateObject$m, _templateObject2$7;
21144
- var small = "\n\tmin-height: 0;\n\theight: 30px;\n\tborder: 0;\n\tbox-shadow: rgba(0, 0, 0, 0.3) 0px 1px 4px -1px;\n\tborder-radius: 2px;\n";
21145
- var dark$2 = function dark(_ref) {
21146
- var theme = _ref.theme;
21147
- return "\n\tbackground-color: " + (theme.colors ? theme.colors.backgroundColor : '') + ";\n\tborder-color: " + (theme.colors ? theme.colors.borderColor : '') + ";\n\tcolor: " + (theme.colors ? theme.colors.textColor : '') + ";\n\n\t&:hover,\n\t&:focus {\n\t\tbackground-color: " + (theme.colors ? theme.colors.backgroundColor : '') + ";\n\t}\n";
21148
- };
21149
- var Select = styled('button')(_templateObject$m || (_templateObject$m = _taggedTemplateLiteralLoose(["\n\twidth: 100%;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: space-between;\n\tmin-height: 42px;\n\tborder-radius: 0;\n\toutline: none;\n\tpadding: 5px 12px;\n\tfont-size: 0.9rem;\n\tline-height: 1.2rem;\n\tbackground-color: #fff;\n\tborder: 1px solid #ccc;\n\tcolor: #424242;\n\tcursor: pointer;\n\tuser-select: none;\n\ttransition: all 0.3s ease;\n\n\t", ";\n\n\t& > div {\n\t\twidth: calc(100% - 24px);\n\t\twhite-space: nowrap;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\ttext-align: left;\n\t}\n\n\t&:hover,\n\t&:focus {\n\t\tbackground-color: #fcfcfc;\n\t}\n\n\t", ";\n"])), function (props) {
21150
- return props.small ? small : null;
21151
- }, function (_ref2) {
21152
- var themePreset = _ref2.themePreset;
21153
- return themePreset === 'dark' && dark$2;
21154
- });
21155
- var Tick = styled('span')(_templateObject2$7 || (_templateObject2$7 = _taggedTemplateLiteralLoose(["\n\twidth: 16px;\n\theight: 16px;\n\tdisplay: inline-block;\n\tposition: relative;\n\tuser-select: none;\n\talign-items: center;\n\n\t&::after {\n\t\tbox-sizing: content-box;\n\t\tcontent: '';\n\t\tposition: absolute;\n\t\tbackground-color: transparent;\n\t\ttop: 50%;\n\t\tleft: 0;\n\t\twidth: 8px;\n\t\theight: 4px;\n\t\tmargin-top: -4px;\n\t\tborder-style: solid;\n\t\tborder-color: ", ";\n\t\tborder-width: 0 0 2px 2px;\n\t\tborder-radius: 0;\n\t\tborder-image: none;\n\t\ttransform: rotate(-45deg) scale(1);\n\t\ttransition: all 200ms ease-out;\n\t}\n"])), function (_ref3) {
21156
- var theme = _ref3.theme;
21157
- return theme.colors.primaryColor;
21157
+ var reactIs_development = createCommonjsModule(function (module, exports) {
21158
+
21159
+ {
21160
+ (function () {
21161
+
21162
+ // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
21163
+ // nor polyfill, then a plain number is used for performance.
21164
+ var hasSymbol = typeof Symbol === 'function' && Symbol["for"];
21165
+ var REACT_ELEMENT_TYPE = hasSymbol ? Symbol["for"]('react.element') : 0xeac7;
21166
+ var REACT_PORTAL_TYPE = hasSymbol ? Symbol["for"]('react.portal') : 0xeaca;
21167
+ var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol["for"]('react.fragment') : 0xeacb;
21168
+ var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol["for"]('react.strict_mode') : 0xeacc;
21169
+ var REACT_PROFILER_TYPE = hasSymbol ? Symbol["for"]('react.profiler') : 0xead2;
21170
+ var REACT_PROVIDER_TYPE = hasSymbol ? Symbol["for"]('react.provider') : 0xeacd;
21171
+ var REACT_CONTEXT_TYPE = hasSymbol ? Symbol["for"]('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
21172
+ // (unstable) APIs that have been removed. Can we remove the symbols?
21173
+
21174
+ var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol["for"]('react.async_mode') : 0xeacf;
21175
+ var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol["for"]('react.concurrent_mode') : 0xeacf;
21176
+ var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol["for"]('react.forward_ref') : 0xead0;
21177
+ var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol["for"]('react.suspense') : 0xead1;
21178
+ var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol["for"]('react.suspense_list') : 0xead8;
21179
+ var REACT_MEMO_TYPE = hasSymbol ? Symbol["for"]('react.memo') : 0xead3;
21180
+ var REACT_LAZY_TYPE = hasSymbol ? Symbol["for"]('react.lazy') : 0xead4;
21181
+ var REACT_BLOCK_TYPE = hasSymbol ? Symbol["for"]('react.block') : 0xead9;
21182
+ var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol["for"]('react.fundamental') : 0xead5;
21183
+ var REACT_RESPONDER_TYPE = hasSymbol ? Symbol["for"]('react.responder') : 0xead6;
21184
+ var REACT_SCOPE_TYPE = hasSymbol ? Symbol["for"]('react.scope') : 0xead7;
21185
+ function isValidElementType(type) {
21186
+ return typeof type === 'string' || typeof type === 'function' ||
21187
+ // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
21188
+ type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
21189
+ }
21190
+ function typeOf(object) {
21191
+ if (typeof object === 'object' && object !== null) {
21192
+ var $$typeof = object.$$typeof;
21193
+ switch ($$typeof) {
21194
+ case REACT_ELEMENT_TYPE:
21195
+ var type = object.type;
21196
+ switch (type) {
21197
+ case REACT_ASYNC_MODE_TYPE:
21198
+ case REACT_CONCURRENT_MODE_TYPE:
21199
+ case REACT_FRAGMENT_TYPE:
21200
+ case REACT_PROFILER_TYPE:
21201
+ case REACT_STRICT_MODE_TYPE:
21202
+ case REACT_SUSPENSE_TYPE:
21203
+ return type;
21204
+ default:
21205
+ var $$typeofType = type && type.$$typeof;
21206
+ switch ($$typeofType) {
21207
+ case REACT_CONTEXT_TYPE:
21208
+ case REACT_FORWARD_REF_TYPE:
21209
+ case REACT_LAZY_TYPE:
21210
+ case REACT_MEMO_TYPE:
21211
+ case REACT_PROVIDER_TYPE:
21212
+ return $$typeofType;
21213
+ default:
21214
+ return $$typeof;
21215
+ }
21216
+ }
21217
+ case REACT_PORTAL_TYPE:
21218
+ return $$typeof;
21219
+ }
21220
+ }
21221
+ return undefined;
21222
+ } // AsyncMode is deprecated along with isAsyncMode
21223
+
21224
+ var AsyncMode = REACT_ASYNC_MODE_TYPE;
21225
+ var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
21226
+ var ContextConsumer = REACT_CONTEXT_TYPE;
21227
+ var ContextProvider = REACT_PROVIDER_TYPE;
21228
+ var Element = REACT_ELEMENT_TYPE;
21229
+ var ForwardRef = REACT_FORWARD_REF_TYPE;
21230
+ var Fragment = REACT_FRAGMENT_TYPE;
21231
+ var Lazy = REACT_LAZY_TYPE;
21232
+ var Memo = REACT_MEMO_TYPE;
21233
+ var Portal = REACT_PORTAL_TYPE;
21234
+ var Profiler = REACT_PROFILER_TYPE;
21235
+ var StrictMode = REACT_STRICT_MODE_TYPE;
21236
+ var Suspense = REACT_SUSPENSE_TYPE;
21237
+ var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated
21238
+
21239
+ function isAsyncMode(object) {
21240
+ {
21241
+ if (!hasWarnedAboutDeprecatedIsAsyncMode) {
21242
+ hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
21243
+
21244
+ console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
21245
+ }
21246
+ }
21247
+ return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
21248
+ }
21249
+ function isConcurrentMode(object) {
21250
+ return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
21251
+ }
21252
+ function isContextConsumer(object) {
21253
+ return typeOf(object) === REACT_CONTEXT_TYPE;
21254
+ }
21255
+ function isContextProvider(object) {
21256
+ return typeOf(object) === REACT_PROVIDER_TYPE;
21257
+ }
21258
+ function isElement(object) {
21259
+ return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
21260
+ }
21261
+ function isForwardRef(object) {
21262
+ return typeOf(object) === REACT_FORWARD_REF_TYPE;
21263
+ }
21264
+ function isFragment(object) {
21265
+ return typeOf(object) === REACT_FRAGMENT_TYPE;
21266
+ }
21267
+ function isLazy(object) {
21268
+ return typeOf(object) === REACT_LAZY_TYPE;
21269
+ }
21270
+ function isMemo(object) {
21271
+ return typeOf(object) === REACT_MEMO_TYPE;
21272
+ }
21273
+ function isPortal(object) {
21274
+ return typeOf(object) === REACT_PORTAL_TYPE;
21275
+ }
21276
+ function isProfiler(object) {
21277
+ return typeOf(object) === REACT_PROFILER_TYPE;
21278
+ }
21279
+ function isStrictMode(object) {
21280
+ return typeOf(object) === REACT_STRICT_MODE_TYPE;
21281
+ }
21282
+ function isSuspense(object) {
21283
+ return typeOf(object) === REACT_SUSPENSE_TYPE;
21284
+ }
21285
+ exports.AsyncMode = AsyncMode;
21286
+ exports.ConcurrentMode = ConcurrentMode;
21287
+ exports.ContextConsumer = ContextConsumer;
21288
+ exports.ContextProvider = ContextProvider;
21289
+ exports.Element = Element;
21290
+ exports.ForwardRef = ForwardRef;
21291
+ exports.Fragment = Fragment;
21292
+ exports.Lazy = Lazy;
21293
+ exports.Memo = Memo;
21294
+ exports.Portal = Portal;
21295
+ exports.Profiler = Profiler;
21296
+ exports.StrictMode = StrictMode;
21297
+ exports.Suspense = Suspense;
21298
+ exports.isAsyncMode = isAsyncMode;
21299
+ exports.isConcurrentMode = isConcurrentMode;
21300
+ exports.isContextConsumer = isContextConsumer;
21301
+ exports.isContextProvider = isContextProvider;
21302
+ exports.isElement = isElement;
21303
+ exports.isForwardRef = isForwardRef;
21304
+ exports.isFragment = isFragment;
21305
+ exports.isLazy = isLazy;
21306
+ exports.isMemo = isMemo;
21307
+ exports.isPortal = isPortal;
21308
+ exports.isProfiler = isProfiler;
21309
+ exports.isStrictMode = isStrictMode;
21310
+ exports.isSuspense = isSuspense;
21311
+ exports.isValidElementType = isValidElementType;
21312
+ exports.typeOf = typeOf;
21313
+ })();
21314
+ }
21158
21315
  });
21316
+ var reactIs_development_1 = reactIs_development.AsyncMode;
21317
+ var reactIs_development_2 = reactIs_development.ConcurrentMode;
21318
+ var reactIs_development_3 = reactIs_development.ContextConsumer;
21319
+ var reactIs_development_4 = reactIs_development.ContextProvider;
21320
+ var reactIs_development_5 = reactIs_development.Element;
21321
+ var reactIs_development_6 = reactIs_development.ForwardRef;
21322
+ var reactIs_development_7 = reactIs_development.Fragment;
21323
+ var reactIs_development_8 = reactIs_development.Lazy;
21324
+ var reactIs_development_9 = reactIs_development.Memo;
21325
+ var reactIs_development_10 = reactIs_development.Portal;
21326
+ var reactIs_development_11 = reactIs_development.Profiler;
21327
+ var reactIs_development_12 = reactIs_development.StrictMode;
21328
+ var reactIs_development_13 = reactIs_development.Suspense;
21329
+ var reactIs_development_14 = reactIs_development.isAsyncMode;
21330
+ var reactIs_development_15 = reactIs_development.isConcurrentMode;
21331
+ var reactIs_development_16 = reactIs_development.isContextConsumer;
21332
+ var reactIs_development_17 = reactIs_development.isContextProvider;
21333
+ var reactIs_development_18 = reactIs_development.isElement;
21334
+ var reactIs_development_19 = reactIs_development.isForwardRef;
21335
+ var reactIs_development_20 = reactIs_development.isFragment;
21336
+ var reactIs_development_21 = reactIs_development.isLazy;
21337
+ var reactIs_development_22 = reactIs_development.isMemo;
21338
+ var reactIs_development_23 = reactIs_development.isPortal;
21339
+ var reactIs_development_24 = reactIs_development.isProfiler;
21340
+ var reactIs_development_25 = reactIs_development.isStrictMode;
21341
+ var reactIs_development_26 = reactIs_development.isSuspense;
21342
+ var reactIs_development_27 = reactIs_development.isValidElementType;
21343
+ var reactIs_development_28 = reactIs_development.typeOf;
21344
+
21345
+ var reactIs = createCommonjsModule(function (module) {
21159
21346
 
21160
- var _templateObject$n;
21161
- var open = "\n\ttop: 0.55em;\n\ttransform: rotate(-45deg);\n";
21162
- var Chevron = styled('span')(_templateObject$n || (_templateObject$n = _taggedTemplateLiteralLoose(["\n\t&::before {\n\t\tcontent: '';\n\t\tborder-style: solid;\n\t\tborder-width: 0.15em 0.15em 0 0;\n\t\tdisplay: inline-block;\n\t\theight: 0.45em;\n\t\tposition: relative;\n\t\ttop: 0.35em;\n\t\tleft: 0;\n\t\ttransform: rotate(135deg);\n\t\tvertical-align: top;\n\t\twidth: 0.45em;\n\n\t\t", ";\n\t}\n"])), function (props) {
21163
- return props.open ? open : null;
21347
+ {
21348
+ module.exports = reactIs_development;
21349
+ }
21164
21350
  });
21165
21351
 
21166
- var getClassName$6 = lib_8.getClassName;
21167
- var Dropdown = {
21168
- data: function data() {
21169
- this.__state = {
21170
- isOpen: false,
21171
- searchTerm: ''
21172
- };
21173
- return this.__state;
21174
- },
21175
- inject: {
21176
- theme: {
21177
- from: 'theme_reactivesearch'
21178
- }
21179
- },
21180
- props: {
21181
- innerClass: types.style,
21182
- items: types.data,
21183
- keyField: Q.string.def('key'),
21184
- labelField: Q.string.def('label'),
21185
- multi: Q.bool,
21186
- // change event
21187
- placeholder: types.string,
21188
- returnsObject: Q.bool,
21189
- customLabelRenderer: types.func,
21190
- hasCustomRenderer: Q.bool,
21191
- customRenderer: types.func,
21192
- renderItem: types.func,
21193
- renderNoResults: Q.any,
21194
- handleChange: types.func,
21195
- transformData: types.func,
21196
- selectedItem: types.selectedValue,
21197
- showCount: Q.bool,
21198
- single: Q.bool,
21199
- small: Q.bool.def(false),
21200
- themePreset: types.themePreset,
21201
- showSearch: Q.bool,
21202
- showClear: Q.bool,
21203
- searchPlaceholder: Q.string.def('Type here to search...')
21204
- },
21205
- render: function render() {
21206
- var _this = this;
21207
- var _this$$props = this.$props,
21208
- items = _this$$props.items,
21209
- selectedItem = _this$$props.selectedItem,
21210
- placeholder = _this$$props.placeholder,
21211
- labelField = _this$$props.labelField,
21212
- keyField = _this$$props.keyField,
21213
- themePreset = _this$$props.themePreset,
21214
- renderItem = _this$$props.renderItem,
21215
- transformData = _this$$props.transformData,
21216
- footer = _this$$props.footer,
21217
- customLabelRenderer = _this$$props.customLabelRenderer,
21218
- hasCustomRenderer = _this$$props.hasCustomRenderer,
21219
- customRenderer = _this$$props.customRenderer;
21220
- var itemsToRender = items;
21221
- if (transformData) {
21222
- itemsToRender = transformData(itemsToRender);
21352
+ /*
21353
+ object-assign
21354
+ (c) Sindre Sorhus
21355
+ @license MIT
21356
+ */
21357
+
21358
+ /* eslint-disable no-unused-vars */
21359
+ var getOwnPropertySymbols = Object.getOwnPropertySymbols;
21360
+ var hasOwnProperty$1 = Object.prototype.hasOwnProperty;
21361
+ var propIsEnumerable = Object.prototype.propertyIsEnumerable;
21362
+ function toObject(val) {
21363
+ if (val === null || val === undefined) {
21364
+ throw new TypeError('Object.assign cannot be called with null or undefined');
21365
+ }
21366
+ return Object(val);
21367
+ }
21368
+ function shouldUseNative() {
21369
+ try {
21370
+ if (!Object.assign) {
21371
+ return false;
21223
21372
  }
21224
- var filteredItemsToRender = itemsToRender.filter(function (item) {
21225
- if (String(item[labelField]).length) {
21226
- if (_this.$props.showSearch && _this.$data.searchTerm) {
21227
- return suggestions_1(String(item[labelField])).toLowerCase().includes(suggestions_1(_this.$data.searchTerm.toLowerCase()));
21228
- }
21229
- return true;
21230
- }
21373
+
21374
+ // Detect buggy property enumeration order in older V8 versions.
21375
+
21376
+ // https://bugs.chromium.org/p/v8/issues/detail?id=4118
21377
+ var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
21378
+ test1[5] = 'de';
21379
+ if (Object.getOwnPropertyNames(test1)[0] === '5') {
21231
21380
  return false;
21381
+ }
21382
+
21383
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3056
21384
+ var test2 = {};
21385
+ for (var i = 0; i < 10; i++) {
21386
+ test2['_' + String.fromCharCode(i)] = i;
21387
+ }
21388
+ var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
21389
+ return test2[n];
21232
21390
  });
21233
- return vue.createVNode(Downshift, {
21234
- "isOpen": this.$data.isOpen,
21235
- "selectedItem": selectedItem,
21236
- "handleChange": this.onChange,
21237
- "handleMouseup": this.handleStateChange
21238
- }, {
21239
- "default": function _default(_ref) {
21240
- var getItemProps = _ref.getItemProps,
21241
- isOpen = _ref.isOpen,
21242
- highlightedIndex = _ref.highlightedIndex,
21243
- getButtonProps = _ref.getButtonProps,
21244
- getItemEvents = _ref.getItemEvents,
21245
- getInputEvents = _ref.getInputEvents;
21246
- return vue.createVNode("div", {
21247
- "class": suggestionsContainer
21248
- }, [vue.createVNode(Select, vue.mergeProps(babelHelperVueTransformOn(getButtonProps({
21249
- onClick: _this.toggle
21250
- })), {
21251
- "class": getClassName$6(_this.$props.innerClass, 'select') || '',
21252
- "title": selectedItem ? _this.renderToString(selectedItem) : placeholder,
21253
- "small": _this.$props.small,
21254
- "themePreset": _this.$props.themePreset
21255
- }), {
21256
- "default": function _default() {
21257
- return [customLabelRenderer ? customLabelRenderer(selectedItem) : vue.createVNode("div", null, [selectedItem ? _this.renderToString(selectedItem) : placeholder]), vue.createVNode(Chevron, {
21258
- "open": isOpen
21259
- }, null)];
21260
- }
21261
- }), hasCustomRenderer ? customRenderer(itemsToRender, {
21262
- getItemProps: getItemProps,
21263
- isOpen: isOpen,
21264
- highlightedIndex: highlightedIndex,
21265
- getButtonProps: getButtonProps,
21266
- getItemEvents: getItemEvents
21267
- }) : isOpen && itemsToRender.length ? vue.createVNode("ul", {
21268
- "class": suggestions$1(themePreset, _this.theme) + " " + (_this.$props.small ? 'small' : '') + " " + getClassName$6(_this.$props.innerClass, 'list')
21269
- }, [_this.$props.showSearch ? _this.renderSearchbox({
21270
- on: {
21271
- input: getInputEvents({
21272
- onInput: _this.handleInputChange
21273
- }).input
21274
- }
21275
- }) : null, !hasCustomRenderer && filteredItemsToRender.length === 0 ? _this.renderNoResult() : filteredItemsToRender.map(function (item, index) {
21276
- var selected = _this.$props.multi // MultiDropdownList
21277
- && (selectedItem && !!selectedItem[item[keyField]] // MultiDropdownRange
21278
- || Array.isArray(selectedItem) && selectedItem.find(function (value) {
21279
- return value[labelField] === item[labelField];
21280
- }));
21281
- if (!_this.$props.multi) selected = item.key === selectedItem;
21282
- return vue.createVNode("li", vue.mergeProps(getItemProps({
21283
- item: item
21284
- }), babelHelperVueTransformOn(getItemEvents({
21285
- item: item
21286
- })), {
21287
- "key": item[keyField],
21288
- "class": "" + (selected ? 'active' : ''),
21289
- "style": {
21290
- backgroundColor: _this.getBackgroundColor(highlightedIndex === index, selected)
21291
- }
21292
- }), [renderItem ? renderItem({
21293
- label: item[labelField],
21294
- count: item.doc_count,
21295
- isChecked: selected && _this.$props.multi
21296
- }) : vue.createVNode("div", null, [typeof item[labelField] === 'string' ? vue.createVNode("span", {
21297
- "innerHTML": item[labelField]
21298
- }, null) : item[labelField], _this.$props.showCount && item.doc_count && vue.createVNode("span", {
21299
- "class": getClassName$6(_this.$props.innerClass, 'count') || ''
21300
- }, [vue.createTextVNode("\xA0("), item.doc_count, vue.createTextVNode(")")])]), selected && _this.$props.multi ? vue.createVNode(Tick, {
21301
- "class": getClassName$6(_this.$props.innerClass, 'icon') || ''
21302
- }, null) : null]);
21303
- }), footer]) : null]);
21304
- }
21391
+ if (order2.join('') !== '0123456789') {
21392
+ return false;
21393
+ }
21394
+
21395
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3056
21396
+ var test3 = {};
21397
+ 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
21398
+ test3[letter] = letter;
21305
21399
  });
21306
- },
21307
- methods: {
21308
- toggle: function toggle() {
21309
- this.isOpen = !this.$data.isOpen;
21310
- },
21311
- close: function close() {
21312
- this.isOpen = false;
21313
- },
21314
- onChange: function onChange(item) {
21315
- if (this.$props.returnsObject) {
21316
- this.$props.handleChange(item);
21317
- } else {
21318
- this.$props.handleChange(item[this.$props.keyField]);
21319
- }
21320
- if (!this.$props.multi) {
21321
- this.isOpen = false;
21322
- this.searchTerm = '';
21323
- }
21324
- },
21325
- handleStateChange: function handleStateChange(_ref2) {
21326
- var isOpen = _ref2.isOpen;
21327
- this.isOpen = isOpen;
21328
- },
21329
- getBackgroundColor: function getBackgroundColor(highlighted, selected) {
21330
- var isDark = this.$props.themePreset === 'dark';
21331
- if (highlighted) {
21332
- return isDark ? '#555' : '#eee';
21333
- }
21334
- if (selected) {
21335
- return isDark ? '#686868' : '#fafafa';
21336
- }
21337
- return isDark ? '#424242' : '#fff';
21338
- },
21339
- handleInputChange: function handleInputChange(e) {
21340
- var value = e.target.value;
21341
- this.searchTerm = value;
21342
- },
21343
- clearSearchTerm: function clearSearchTerm() {
21344
- this.searchTerm = '';
21345
- },
21346
- renderToString: function renderToString(value) {
21347
- var _this2 = this;
21348
- var customLabelRenderer = this.$props.customLabelRenderer;
21349
- if (customLabelRenderer) {
21350
- var customLabel = customLabelRenderer(value);
21351
- if (typeof customLabel === 'string') {
21352
- return customLabel;
21353
- }
21354
- }
21355
- if (Array.isArray(value) && value.length) {
21356
- var arrayToRender = value.map(function (item) {
21357
- return _this2.renderToString(item);
21358
- });
21359
- return arrayToRender.join(', ');
21400
+ if (Object.keys(Object.assign({}, test3)).join('') !== 'abcdefghijklmnopqrst') {
21401
+ return false;
21402
+ }
21403
+ return true;
21404
+ } catch (err) {
21405
+ // We don't expect any of the above to throw, but better to be safe.
21406
+ return false;
21407
+ }
21408
+ }
21409
+ var objectAssign = shouldUseNative() ? Object.assign : function (target, source) {
21410
+ var from;
21411
+ var to = toObject(target);
21412
+ var symbols;
21413
+ for (var s = 1; s < arguments.length; s++) {
21414
+ from = Object(arguments[s]);
21415
+ for (var key in from) {
21416
+ if (hasOwnProperty$1.call(from, key)) {
21417
+ to[key] = from[key];
21360
21418
  }
21361
- if (value && typeof value === 'object') {
21362
- if (value[this.$props.labelField]) {
21363
- return value[this.$props.labelField];
21364
- }
21365
- if (Object.keys(value).length) {
21366
- return this.renderToString(Object.keys(value));
21419
+ }
21420
+ if (getOwnPropertySymbols) {
21421
+ symbols = getOwnPropertySymbols(from);
21422
+ for (var i = 0; i < symbols.length; i++) {
21423
+ if (propIsEnumerable.call(from, symbols[i])) {
21424
+ to[symbols[i]] = from[symbols[i]];
21367
21425
  }
21368
- return this.$props.placeholder;
21369
21426
  }
21370
- return value;
21427
+ }
21428
+ }
21429
+ return to;
21430
+ };
21431
+
21432
+ /**
21433
+ * Copyright (c) 2013-present, Facebook, Inc.
21434
+ *
21435
+ * This source code is licensed under the MIT license found in the
21436
+ * LICENSE file in the root directory of this source tree.
21437
+ */
21438
+
21439
+ var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
21440
+ var ReactPropTypesSecret_1 = ReactPropTypesSecret;
21441
+
21442
+ var has = Function.call.bind(Object.prototype.hasOwnProperty);
21443
+
21444
+ var printWarning = function printWarning() {};
21445
+ {
21446
+ var ReactPropTypesSecret$1 = ReactPropTypesSecret_1;
21447
+ var loggedTypeFailures = {};
21448
+ var has$1 = has;
21449
+ printWarning = function printWarning(text) {
21450
+ var message = 'Warning: ' + text;
21451
+ if (typeof console !== 'undefined') {
21452
+ console.error(message);
21453
+ }
21454
+ try {
21455
+ // --- Welcome to debugging React ---
21456
+ // This error was thrown as a convenience so that you can use this stack
21457
+ // to find the callsite that caused this warning to fire.
21458
+ throw new Error(message);
21459
+ } catch (x) {/**/}
21460
+ };
21461
+ }
21462
+
21463
+ /**
21464
+ * Assert that the values match with the type specs.
21465
+ * Error messages are memorized and will only be shown once.
21466
+ *
21467
+ * @param {object} typeSpecs Map of name to a ReactPropType
21468
+ * @param {object} values Runtime values that need to be type-checked
21469
+ * @param {string} location e.g. "prop", "context", "child context"
21470
+ * @param {string} componentName Name of the component for error messages.
21471
+ * @param {?Function} getStack Returns the component stack.
21472
+ * @private
21473
+ */
21474
+ function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
21475
+ {
21476
+ for (var typeSpecName in typeSpecs) {
21477
+ if (has$1(typeSpecs, typeSpecName)) {
21478
+ var error;
21479
+ // Prop type validation may throw. In case they do, we don't want to
21480
+ // fail the render phase where it didn't fail before. So we log it.
21481
+ // After these have been cleaned up, we'll let them throw.
21482
+ try {
21483
+ // This is intentionally an invariant that gets caught. It's the same
21484
+ // behavior as without this statement except with a better message.
21485
+ if (typeof typeSpecs[typeSpecName] !== 'function') {
21486
+ var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');
21487
+ err.name = 'Invariant Violation';
21488
+ throw err;
21489
+ }
21490
+ error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret$1);
21491
+ } catch (ex) {
21492
+ error = ex;
21493
+ }
21494
+ if (error && !(error instanceof Error)) {
21495
+ printWarning((componentName || 'React class') + ': type specification of ' + location + ' `' + typeSpecName + '` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).');
21496
+ }
21497
+ if (error instanceof Error && !(error.message in loggedTypeFailures)) {
21498
+ // Only monitor this failure once because there tends to be a lot of the
21499
+ // same error.
21500
+ loggedTypeFailures[error.message] = true;
21501
+ var stack = getStack ? getStack() : '';
21502
+ printWarning('Failed ' + location + ' type: ' + error.message + (stack != null ? stack : ''));
21503
+ }
21504
+ }
21505
+ }
21506
+ }
21507
+ }
21508
+
21509
+ /**
21510
+ * Resets warning cache when testing.
21511
+ *
21512
+ * @private
21513
+ */
21514
+ checkPropTypes.resetWarningCache = function () {
21515
+ {
21516
+ loggedTypeFailures = {};
21517
+ }
21518
+ };
21519
+ var checkPropTypes_1 = checkPropTypes;
21520
+
21521
+ var printWarning$1 = function printWarning() {};
21522
+ {
21523
+ printWarning$1 = function printWarning(text) {
21524
+ var message = 'Warning: ' + text;
21525
+ if (typeof console !== 'undefined') {
21526
+ console.error(message);
21527
+ }
21528
+ try {
21529
+ // --- Welcome to debugging React ---
21530
+ // This error was thrown as a convenience so that you can use this stack
21531
+ // to find the callsite that caused this warning to fire.
21532
+ throw new Error(message);
21533
+ } catch (x) {}
21534
+ };
21535
+ }
21536
+ function emptyFunctionThatReturnsNull() {
21537
+ return null;
21538
+ }
21539
+ var factoryWithTypeCheckers = function factoryWithTypeCheckers(isValidElement, throwOnDirectAccess) {
21540
+ /* global Symbol */
21541
+ var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
21542
+ var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
21543
+
21544
+ /**
21545
+ * Returns the iterator method function contained on the iterable object.
21546
+ *
21547
+ * Be sure to invoke the function with the iterable as context:
21548
+ *
21549
+ * var iteratorFn = getIteratorFn(myIterable);
21550
+ * if (iteratorFn) {
21551
+ * var iterator = iteratorFn.call(myIterable);
21552
+ * ...
21553
+ * }
21554
+ *
21555
+ * @param {?object} maybeIterable
21556
+ * @return {?function}
21557
+ */
21558
+ function getIteratorFn(maybeIterable) {
21559
+ var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
21560
+ if (typeof iteratorFn === 'function') {
21561
+ return iteratorFn;
21562
+ }
21563
+ }
21564
+
21565
+ /**
21566
+ * Collection of methods that allow declaration and validation of props that are
21567
+ * supplied to React components. Example usage:
21568
+ *
21569
+ * var Props = require('ReactPropTypes');
21570
+ * var MyArticle = React.createClass({
21571
+ * propTypes: {
21572
+ * // An optional string prop named "description".
21573
+ * description: Props.string,
21574
+ *
21575
+ * // A required enum prop named "category".
21576
+ * category: Props.oneOf(['News','Photos']).isRequired,
21577
+ *
21578
+ * // A prop named "dialog" that requires an instance of Dialog.
21579
+ * dialog: Props.instanceOf(Dialog).isRequired
21580
+ * },
21581
+ * render: function() { ... }
21582
+ * });
21583
+ *
21584
+ * A more formal specification of how these methods are used:
21585
+ *
21586
+ * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
21587
+ * decl := ReactPropTypes.{type}(.isRequired)?
21588
+ *
21589
+ * Each and every declaration produces a function with the same signature. This
21590
+ * allows the creation of custom validation functions. For example:
21591
+ *
21592
+ * var MyLink = React.createClass({
21593
+ * propTypes: {
21594
+ * // An optional string or URI prop named "href".
21595
+ * href: function(props, propName, componentName) {
21596
+ * var propValue = props[propName];
21597
+ * if (propValue != null && typeof propValue !== 'string' &&
21598
+ * !(propValue instanceof URI)) {
21599
+ * return new Error(
21600
+ * 'Expected a string or an URI for ' + propName + ' in ' +
21601
+ * componentName
21602
+ * );
21603
+ * }
21604
+ * }
21605
+ * },
21606
+ * render: function() {...}
21607
+ * });
21608
+ *
21609
+ * @internal
21610
+ */
21611
+
21612
+ var ANONYMOUS = '<<anonymous>>';
21613
+
21614
+ // Important!
21615
+ // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
21616
+ var ReactPropTypes = {
21617
+ array: createPrimitiveTypeChecker('array'),
21618
+ bigint: createPrimitiveTypeChecker('bigint'),
21619
+ bool: createPrimitiveTypeChecker('boolean'),
21620
+ func: createPrimitiveTypeChecker('function'),
21621
+ number: createPrimitiveTypeChecker('number'),
21622
+ object: createPrimitiveTypeChecker('object'),
21623
+ string: createPrimitiveTypeChecker('string'),
21624
+ symbol: createPrimitiveTypeChecker('symbol'),
21625
+ any: createAnyTypeChecker(),
21626
+ arrayOf: createArrayOfTypeChecker,
21627
+ element: createElementTypeChecker(),
21628
+ elementType: createElementTypeTypeChecker(),
21629
+ instanceOf: createInstanceTypeChecker,
21630
+ node: createNodeChecker(),
21631
+ objectOf: createObjectOfTypeChecker,
21632
+ oneOf: createEnumTypeChecker,
21633
+ oneOfType: createUnionTypeChecker,
21634
+ shape: createShapeTypeChecker,
21635
+ exact: createStrictShapeTypeChecker
21636
+ };
21637
+
21638
+ /**
21639
+ * inlined Object.is polyfill to avoid requiring consumers ship their own
21640
+ * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
21641
+ */
21642
+ /*eslint-disable no-self-compare*/
21643
+ function is(x, y) {
21644
+ // SameValue algorithm
21645
+ if (x === y) {
21646
+ // Steps 1-5, 7-10
21647
+ // Steps 6.b-6.e: +0 != -0
21648
+ return x !== 0 || 1 / x === 1 / y;
21649
+ } else {
21650
+ // Step 6.a: NaN == NaN
21651
+ return x !== x && y !== y;
21652
+ }
21653
+ }
21654
+ /*eslint-enable no-self-compare*/
21655
+
21656
+ /**
21657
+ * We use an Error-like object for backward compatibility as people may call
21658
+ * PropTypes directly and inspect their output. However, we don't use real
21659
+ * Errors anymore. We don't inspect their stack anyway, and creating them
21660
+ * is prohibitively expensive if they are created too often, such as what
21661
+ * happens in oneOfType() for any type before the one that matched.
21662
+ */
21663
+ function PropTypeError(message, data) {
21664
+ this.message = message;
21665
+ this.data = data && typeof data === 'object' ? data : {};
21666
+ this.stack = '';
21667
+ }
21668
+ // Make `instanceof Error` still work for returned errors.
21669
+ PropTypeError.prototype = Error.prototype;
21670
+ function createChainableTypeChecker(validate) {
21671
+ {
21672
+ var manualPropTypeCallCache = {};
21673
+ var manualPropTypeWarningCount = 0;
21674
+ }
21675
+ function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
21676
+ componentName = componentName || ANONYMOUS;
21677
+ propFullName = propFullName || propName;
21678
+ if (secret !== ReactPropTypesSecret_1) {
21679
+ if (throwOnDirectAccess) {
21680
+ // New behavior only for users of `prop-types` package
21681
+ var err = new Error('Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use `PropTypes.checkPropTypes()` to call them. ' + 'Read more at http://fb.me/use-check-prop-types');
21682
+ err.name = 'Invariant Violation';
21683
+ throw err;
21684
+ } else if ( typeof console !== 'undefined') {
21685
+ // Old behavior for people using React.PropTypes
21686
+ var cacheKey = componentName + ':' + propName;
21687
+ if (!manualPropTypeCallCache[cacheKey] &&
21688
+ // Avoid spamming the console because they are often not actionable except for lib authors
21689
+ manualPropTypeWarningCount < 3) {
21690
+ printWarning$1('You are manually calling a React.PropTypes validation ' + 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' + 'and will throw in the standalone `prop-types` package. ' + 'You may be seeing this warning due to a third-party PropTypes ' + 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.');
21691
+ manualPropTypeCallCache[cacheKey] = true;
21692
+ manualPropTypeWarningCount++;
21693
+ }
21694
+ }
21695
+ }
21696
+ if (props[propName] == null) {
21697
+ if (isRequired) {
21698
+ if (props[propName] === null) {
21699
+ return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
21700
+ }
21701
+ return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
21702
+ }
21703
+ return null;
21704
+ } else {
21705
+ return validate(props, propName, componentName, location, propFullName);
21706
+ }
21707
+ }
21708
+ var chainedCheckType = checkType.bind(null, false);
21709
+ chainedCheckType.isRequired = checkType.bind(null, true);
21710
+ return chainedCheckType;
21711
+ }
21712
+ function createPrimitiveTypeChecker(expectedType) {
21713
+ function validate(props, propName, componentName, location, propFullName, secret) {
21714
+ var propValue = props[propName];
21715
+ var propType = getPropType(propValue);
21716
+ if (propType !== expectedType) {
21717
+ // `propValue` being instance of, say, date/regexp, pass the 'object'
21718
+ // check, but we can offer a more precise error message here rather than
21719
+ // 'of type `object`'.
21720
+ var preciseType = getPreciseType(propValue);
21721
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'), {
21722
+ expectedType: expectedType
21723
+ });
21724
+ }
21725
+ return null;
21726
+ }
21727
+ return createChainableTypeChecker(validate);
21728
+ }
21729
+ function createAnyTypeChecker() {
21730
+ return createChainableTypeChecker(emptyFunctionThatReturnsNull);
21731
+ }
21732
+ function createArrayOfTypeChecker(typeChecker) {
21733
+ function validate(props, propName, componentName, location, propFullName) {
21734
+ if (typeof typeChecker !== 'function') {
21735
+ return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
21736
+ }
21737
+ var propValue = props[propName];
21738
+ if (!Array.isArray(propValue)) {
21739
+ var propType = getPropType(propValue);
21740
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
21741
+ }
21742
+ for (var i = 0; i < propValue.length; i++) {
21743
+ var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret_1);
21744
+ if (error instanceof Error) {
21745
+ return error;
21746
+ }
21747
+ }
21748
+ return null;
21749
+ }
21750
+ return createChainableTypeChecker(validate);
21751
+ }
21752
+ function createElementTypeChecker() {
21753
+ function validate(props, propName, componentName, location, propFullName) {
21754
+ var propValue = props[propName];
21755
+ if (!isValidElement(propValue)) {
21756
+ var propType = getPropType(propValue);
21757
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
21758
+ }
21759
+ return null;
21760
+ }
21761
+ return createChainableTypeChecker(validate);
21762
+ }
21763
+ function createElementTypeTypeChecker() {
21764
+ function validate(props, propName, componentName, location, propFullName) {
21765
+ var propValue = props[propName];
21766
+ if (!reactIs.isValidElementType(propValue)) {
21767
+ var propType = getPropType(propValue);
21768
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));
21769
+ }
21770
+ return null;
21771
+ }
21772
+ return createChainableTypeChecker(validate);
21773
+ }
21774
+ function createInstanceTypeChecker(expectedClass) {
21775
+ function validate(props, propName, componentName, location, propFullName) {
21776
+ if (!(props[propName] instanceof expectedClass)) {
21777
+ var expectedClassName = expectedClass.name || ANONYMOUS;
21778
+ var actualClassName = getClassName(props[propName]);
21779
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
21780
+ }
21781
+ return null;
21782
+ }
21783
+ return createChainableTypeChecker(validate);
21784
+ }
21785
+ function createEnumTypeChecker(expectedValues) {
21786
+ if (!Array.isArray(expectedValues)) {
21787
+ {
21788
+ if (arguments.length > 1) {
21789
+ printWarning$1('Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' + 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).');
21790
+ } else {
21791
+ printWarning$1('Invalid argument supplied to oneOf, expected an array.');
21792
+ }
21793
+ }
21794
+ return emptyFunctionThatReturnsNull;
21795
+ }
21796
+ function validate(props, propName, componentName, location, propFullName) {
21797
+ var propValue = props[propName];
21798
+ for (var i = 0; i < expectedValues.length; i++) {
21799
+ if (is(propValue, expectedValues[i])) {
21800
+ return null;
21801
+ }
21802
+ }
21803
+ var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
21804
+ var type = getPreciseType(value);
21805
+ if (type === 'symbol') {
21806
+ return String(value);
21807
+ }
21808
+ return value;
21809
+ });
21810
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
21811
+ }
21812
+ return createChainableTypeChecker(validate);
21813
+ }
21814
+ function createObjectOfTypeChecker(typeChecker) {
21815
+ function validate(props, propName, componentName, location, propFullName) {
21816
+ if (typeof typeChecker !== 'function') {
21817
+ return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
21818
+ }
21819
+ var propValue = props[propName];
21820
+ var propType = getPropType(propValue);
21821
+ if (propType !== 'object') {
21822
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
21823
+ }
21824
+ for (var key in propValue) {
21825
+ if (has(propValue, key)) {
21826
+ var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret_1);
21827
+ if (error instanceof Error) {
21828
+ return error;
21829
+ }
21830
+ }
21831
+ }
21832
+ return null;
21833
+ }
21834
+ return createChainableTypeChecker(validate);
21835
+ }
21836
+ function createUnionTypeChecker(arrayOfTypeCheckers) {
21837
+ if (!Array.isArray(arrayOfTypeCheckers)) {
21838
+ printWarning$1('Invalid argument supplied to oneOfType, expected an instance of array.') ;
21839
+ return emptyFunctionThatReturnsNull;
21840
+ }
21841
+ for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
21842
+ var checker = arrayOfTypeCheckers[i];
21843
+ if (typeof checker !== 'function') {
21844
+ printWarning$1('Invalid argument supplied to oneOfType. Expected an array of check functions, but ' + 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.');
21845
+ return emptyFunctionThatReturnsNull;
21846
+ }
21847
+ }
21848
+ function validate(props, propName, componentName, location, propFullName) {
21849
+ var expectedTypes = [];
21850
+ for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
21851
+ var checker = arrayOfTypeCheckers[i];
21852
+ var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret_1);
21853
+ if (checkerResult == null) {
21854
+ return null;
21855
+ }
21856
+ if (checkerResult.data && has(checkerResult.data, 'expectedType')) {
21857
+ expectedTypes.push(checkerResult.data.expectedType);
21858
+ }
21859
+ }
21860
+ var expectedTypesMessage = expectedTypes.length > 0 ? ', expected one of type [' + expectedTypes.join(', ') + ']' : '';
21861
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.'));
21862
+ }
21863
+ return createChainableTypeChecker(validate);
21864
+ }
21865
+ function createNodeChecker() {
21866
+ function validate(props, propName, componentName, location, propFullName) {
21867
+ if (!isNode(props[propName])) {
21868
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
21869
+ }
21870
+ return null;
21871
+ }
21872
+ return createChainableTypeChecker(validate);
21873
+ }
21874
+ function invalidValidatorError(componentName, location, propFullName, key, type) {
21875
+ return new PropTypeError((componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + type + '`.');
21876
+ }
21877
+ function createShapeTypeChecker(shapeTypes) {
21878
+ function validate(props, propName, componentName, location, propFullName) {
21879
+ var propValue = props[propName];
21880
+ var propType = getPropType(propValue);
21881
+ if (propType !== 'object') {
21882
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
21883
+ }
21884
+ for (var key in shapeTypes) {
21885
+ var checker = shapeTypes[key];
21886
+ if (typeof checker !== 'function') {
21887
+ return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
21888
+ }
21889
+ var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret_1);
21890
+ if (error) {
21891
+ return error;
21892
+ }
21893
+ }
21894
+ return null;
21895
+ }
21896
+ return createChainableTypeChecker(validate);
21897
+ }
21898
+ function createStrictShapeTypeChecker(shapeTypes) {
21899
+ function validate(props, propName, componentName, location, propFullName) {
21900
+ var propValue = props[propName];
21901
+ var propType = getPropType(propValue);
21902
+ if (propType !== 'object') {
21903
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
21904
+ }
21905
+ // We need to check all keys in case some are required but missing from props.
21906
+ var allKeys = objectAssign({}, props[propName], shapeTypes);
21907
+ for (var key in allKeys) {
21908
+ var checker = shapeTypes[key];
21909
+ if (has(shapeTypes, key) && typeof checker !== 'function') {
21910
+ return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
21911
+ }
21912
+ if (!checker) {
21913
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' + '\nBad object: ' + JSON.stringify(props[propName], null, ' ') + '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' '));
21914
+ }
21915
+ var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret_1);
21916
+ if (error) {
21917
+ return error;
21918
+ }
21919
+ }
21920
+ return null;
21921
+ }
21922
+ return createChainableTypeChecker(validate);
21923
+ }
21924
+ function isNode(propValue) {
21925
+ switch (typeof propValue) {
21926
+ case 'number':
21927
+ case 'string':
21928
+ case 'undefined':
21929
+ return true;
21930
+ case 'boolean':
21931
+ return !propValue;
21932
+ case 'object':
21933
+ if (Array.isArray(propValue)) {
21934
+ return propValue.every(isNode);
21935
+ }
21936
+ if (propValue === null || isValidElement(propValue)) {
21937
+ return true;
21938
+ }
21939
+ var iteratorFn = getIteratorFn(propValue);
21940
+ if (iteratorFn) {
21941
+ var iterator = iteratorFn.call(propValue);
21942
+ var step;
21943
+ if (iteratorFn !== propValue.entries) {
21944
+ while (!(step = iterator.next()).done) {
21945
+ if (!isNode(step.value)) {
21946
+ return false;
21947
+ }
21948
+ }
21949
+ } else {
21950
+ // Iterator will provide entry [k,v] tuples rather than values.
21951
+ while (!(step = iterator.next()).done) {
21952
+ var entry = step.value;
21953
+ if (entry) {
21954
+ if (!isNode(entry[1])) {
21955
+ return false;
21956
+ }
21957
+ }
21958
+ }
21959
+ }
21960
+ } else {
21961
+ return false;
21962
+ }
21963
+ return true;
21964
+ default:
21965
+ return false;
21966
+ }
21967
+ }
21968
+ function isSymbol(propType, propValue) {
21969
+ // Native Symbol.
21970
+ if (propType === 'symbol') {
21971
+ return true;
21972
+ }
21973
+
21974
+ // falsy value can't be a Symbol
21975
+ if (!propValue) {
21976
+ return false;
21977
+ }
21978
+
21979
+ // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
21980
+ if (propValue['@@toStringTag'] === 'Symbol') {
21981
+ return true;
21982
+ }
21983
+
21984
+ // Fallback for non-spec compliant Symbols which are polyfilled.
21985
+ if (typeof Symbol === 'function' && propValue instanceof Symbol) {
21986
+ return true;
21987
+ }
21988
+ return false;
21989
+ }
21990
+
21991
+ // Equivalent of `typeof` but with special handling for array and regexp.
21992
+ function getPropType(propValue) {
21993
+ var propType = typeof propValue;
21994
+ if (Array.isArray(propValue)) {
21995
+ return 'array';
21996
+ }
21997
+ if (propValue instanceof RegExp) {
21998
+ // Old webkits (at least until Android 4.0) return 'function' rather than
21999
+ // 'object' for typeof a RegExp. We'll normalize this here so that /bla/
22000
+ // passes PropTypes.object.
22001
+ return 'object';
22002
+ }
22003
+ if (isSymbol(propType, propValue)) {
22004
+ return 'symbol';
22005
+ }
22006
+ return propType;
22007
+ }
22008
+
22009
+ // This handles more types than `getPropType`. Only used for error messages.
22010
+ // See `createPrimitiveTypeChecker`.
22011
+ function getPreciseType(propValue) {
22012
+ if (typeof propValue === 'undefined' || propValue === null) {
22013
+ return '' + propValue;
22014
+ }
22015
+ var propType = getPropType(propValue);
22016
+ if (propType === 'object') {
22017
+ if (propValue instanceof Date) {
22018
+ return 'date';
22019
+ } else if (propValue instanceof RegExp) {
22020
+ return 'regexp';
22021
+ }
22022
+ }
22023
+ return propType;
22024
+ }
22025
+
22026
+ // Returns a string that is postfixed to a warning about an invalid type.
22027
+ // For example, "undefined" or "of type array"
22028
+ function getPostfixForTypeWarning(value) {
22029
+ var type = getPreciseType(value);
22030
+ switch (type) {
22031
+ case 'array':
22032
+ case 'object':
22033
+ return 'an ' + type;
22034
+ case 'boolean':
22035
+ case 'date':
22036
+ case 'regexp':
22037
+ return 'a ' + type;
22038
+ default:
22039
+ return type;
22040
+ }
22041
+ }
22042
+
22043
+ // Returns class name of the object, if any.
22044
+ function getClassName(propValue) {
22045
+ if (!propValue.constructor || !propValue.constructor.name) {
22046
+ return ANONYMOUS;
22047
+ }
22048
+ return propValue.constructor.name;
22049
+ }
22050
+ ReactPropTypes.checkPropTypes = checkPropTypes_1;
22051
+ ReactPropTypes.resetWarningCache = checkPropTypes_1.resetWarningCache;
22052
+ ReactPropTypes.PropTypes = ReactPropTypes;
22053
+ return ReactPropTypes;
22054
+ };
22055
+
22056
+ var propTypes = createCommonjsModule(function (module) {
22057
+ /**
22058
+ * Copyright (c) 2013-present, Facebook, Inc.
22059
+ *
22060
+ * This source code is licensed under the MIT license found in the
22061
+ * LICENSE file in the root directory of this source tree.
22062
+ */
22063
+
22064
+ {
22065
+ var ReactIs = reactIs;
22066
+
22067
+ // By explicitly using `prop-types` you are opting into new development behavior.
22068
+ // http://fb.me/prop-types-in-prod
22069
+ var throwOnDirectAccess = true;
22070
+ module.exports = factoryWithTypeCheckers(ReactIs.isElement, throwOnDirectAccess);
22071
+ }
22072
+ });
22073
+
22074
+ var types_1 = createCommonjsModule(function (module, exports) {
22075
+ Object.defineProperty(exports, "__esModule", {
22076
+ value: true
22077
+ });
22078
+ var _dateFormats2 = _interopRequireDefault(dateFormats_1);
22079
+ function _interopRequireDefault(obj) {
22080
+ return obj && obj.__esModule ? obj : {
22081
+ "default": obj
22082
+ };
22083
+ }
22084
+ var reactKeyType = (0, propTypes.oneOfType)([propTypes.string, (0, propTypes.arrayOf)(propTypes.string), propTypes.object, (0, propTypes.arrayOf)(propTypes.object)]);
22085
+ function validateLocation(props, propName) {
22086
+ if (isNaN(props[propName])) {
22087
+ return new Error(propName + ' value must be a number');
22088
+ }
22089
+ if (propName === 'lat' && (props[propName] < -90 || props[propName] > 90)) {
22090
+ return new Error(propName + ' value should be between -90 and 90.');
22091
+ } else if (propName === 'lng' && (props[propName] < -180 || props[propName] > 180)) {
22092
+ return new Error(propName + ' value should be between -180 and 180.');
22093
+ }
22094
+ return null;
22095
+ }
22096
+ var dataFieldValidator = function dataFieldValidator(props, propName, componentName) {
22097
+ var requiredError = new Error(propName + ' supplied to ' + componentName + ' is required. Validation failed.');
22098
+ var propValue = props[propName];
22099
+ if (!propValue) return requiredError;
22100
+ if (typeof propValue !== 'string' && typeof propValue !== 'object' && !Array.isArray(propValue)) {
22101
+ return new Error('Invalid ' + propName + ' supplied to ' + componentName + '. Validation failed.');
22102
+ }
22103
+ if (Array.isArray(propValue) && propValue.length === 0) return requiredError;
22104
+ };
22105
+ var types = {
22106
+ any: propTypes.any,
22107
+ analyticsConfig: (0, propTypes.shape)({
22108
+ emptyQuery: propTypes.bool,
22109
+ suggestionAnalytics: propTypes.bool,
22110
+ userId: propTypes.string,
22111
+ customEvents: propTypes.object
22112
+ }),
22113
+ appbaseConfig: (0, propTypes.shape)({
22114
+ enableQueryRules: propTypes.bool,
22115
+ enableSearchRelevancy: propTypes.bool,
22116
+ recordAnalytics: propTypes.bool,
22117
+ emptyQuery: propTypes.bool,
22118
+ suggestionAnalytics: propTypes.bool,
22119
+ userId: propTypes.string,
22120
+ useCache: propTypes.bool,
22121
+ customEvents: propTypes.object,
22122
+ enableTelemetry: propTypes.bool,
22123
+ queryString: propTypes.object
22124
+ }),
22125
+ bool: propTypes.bool,
22126
+ boolRequired: propTypes.bool.isRequired,
22127
+ components: (0, propTypes.arrayOf)(propTypes.string),
22128
+ children: propTypes.any,
22129
+ data: (0, propTypes.arrayOf)(propTypes.object),
22130
+ dataFieldArray: (0, propTypes.oneOfType)([propTypes.string, (0, propTypes.arrayOf)(propTypes.string)]).isRequired,
22131
+ dataNumberBox: (0, propTypes.shape)({
22132
+ label: propTypes.string,
22133
+ start: propTypes.number.isRequired,
22134
+ end: propTypes.number.isRequired
22135
+ }).isRequired,
22136
+ date: (0, propTypes.oneOfType)([propTypes.string, (0, propTypes.arrayOf)(propTypes.string)]),
22137
+ dateObject: propTypes.object,
22138
+ excludeFields: (0, propTypes.arrayOf)(propTypes.string),
22139
+ fieldWeights: (0, propTypes.arrayOf)(propTypes.number),
22140
+ filterLabel: propTypes.string,
22141
+ func: propTypes.func,
22142
+ funcRequired: propTypes.func.isRequired,
22143
+ fuzziness: (0, propTypes.oneOf)([0, 1, 2, 'AUTO']),
22144
+ headers: propTypes.object,
22145
+ hits: (0, propTypes.arrayOf)(propTypes.object),
22146
+ rawData: propTypes.object,
22147
+ iconPosition: (0, propTypes.oneOf)(['left', 'right']),
22148
+ includeFields: (0, propTypes.arrayOf)(propTypes.string),
22149
+ labelPosition: (0, propTypes.oneOf)(['left', 'right', 'top', 'bottom']),
22150
+ number: propTypes.number,
22151
+ options: (0, propTypes.oneOfType)([(0, propTypes.arrayOf)(propTypes.object), propTypes.object]),
22152
+ paginationAt: (0, propTypes.oneOf)(['top', 'bottom', 'both']),
22153
+ range: (0, propTypes.shape)({
22154
+ start: (0, propTypes.oneOfType)([propTypes.number, propTypes.string, propTypes.object]).isRequired,
22155
+ end: (0, propTypes.oneOfType)([propTypes.number, propTypes.string, propTypes.object]).isRequired
22156
+ }),
22157
+ rangeLabels: (0, propTypes.shape)({
22158
+ start: propTypes.string.isRequired,
22159
+ end: propTypes.string.isRequired
22160
+ }),
22161
+ react: (0, propTypes.shape)({
22162
+ and: reactKeyType,
22163
+ or: reactKeyType,
22164
+ not: reactKeyType
22165
+ }),
22166
+ categorySearchValue: (0, propTypes.shape)({
22167
+ term: propTypes.string,
22168
+ category: propTypes.string
22169
+ }),
22170
+ selectedValues: propTypes.object,
22171
+ selectedValue: (0, propTypes.oneOfType)([propTypes.string, (0, propTypes.arrayOf)(propTypes.string), (0, propTypes.arrayOf)(propTypes.object), propTypes.object, propTypes.number, (0, propTypes.arrayOf)(propTypes.number)]),
22172
+ suggestions: (0, propTypes.arrayOf)(propTypes.object),
22173
+ supportedOrientations: (0, propTypes.oneOf)(['portrait', 'portrait-upside-down', 'landscape', 'landscape-left', 'landscape-right']),
22174
+ tooltipTrigger: (0, propTypes.oneOf)(['hover', 'none', 'focus', 'always']),
22175
+ sortBy: (0, propTypes.oneOf)(['asc', 'desc']),
22176
+ sortOptions: (0, propTypes.arrayOf)((0, propTypes.shape)({
22177
+ label: propTypes.string,
22178
+ dataField: propTypes.string,
22179
+ sortBy: propTypes.string
22180
+ })),
22181
+ sortByWithCount: (0, propTypes.oneOf)(['asc', 'desc', 'count']),
22182
+ stats: (0, propTypes.arrayOf)(propTypes.object),
22183
+ string: propTypes.string,
22184
+ stringArray: (0, propTypes.arrayOf)(propTypes.string),
22185
+ stringOrArray: (0, propTypes.oneOfType)([propTypes.string, (0, propTypes.arrayOf)(propTypes.string)]),
22186
+ stringRequired: propTypes.string.isRequired,
22187
+ style: propTypes.object,
22188
+ themePreset: (0, propTypes.oneOf)(['light', 'dark']),
22189
+ queryFormatDate: (0, propTypes.oneOf)(Object.keys(_dateFormats2["default"])),
22190
+ queryFormatSearch: (0, propTypes.oneOf)(['and', 'or']),
22191
+ queryFormatNumberBox: (0, propTypes.oneOf)(['exact', 'lte', 'gte']),
22192
+ params: propTypes.object.isRequired,
22193
+ props: propTypes.object,
22194
+ rangeLabelsAlign: (0, propTypes.oneOf)(['left', 'right']),
22195
+ title: (0, propTypes.oneOfType)([propTypes.string, propTypes.any]),
22196
+ location: (0, propTypes.shape)({
22197
+ lat: validateLocation,
22198
+ lng: validateLocation
22199
+ }),
22200
+ unit: (0, propTypes.oneOf)(['mi', 'miles', 'yd', 'yards', 'ft', 'feet', 'in', 'inch', 'km', 'kilometers', 'm', 'meters', 'cm', 'centimeters', 'mm', 'millimeters', 'NM', 'nmi', 'nauticalmiles']),
22201
+ aggregationData: propTypes.array,
22202
+ showClearAll: (0, propTypes.oneOf)([constants$1.CLEAR_ALL.NEVER, constants$1.CLEAR_ALL.ALWAYS, constants$1.CLEAR_ALL.DEFAULT, true, false]),
22203
+ componentType: (0, propTypes.oneOf)(Object.values(constants$1.componentTypes)),
22204
+ componentObject: propTypes.object,
22205
+ dataFieldValidator: dataFieldValidator,
22206
+ focusShortcuts: (0, propTypes.oneOfType)([(0, propTypes.arrayOf)(propTypes.string), (0, propTypes.arrayOf)(propTypes.number)]),
22207
+ mongodb: (0, propTypes.shape)({
22208
+ db: propTypes.string,
22209
+ collection: propTypes.string
22210
+ }),
22211
+ calendarInterval: (0, propTypes.oneOf)(['month', 'day', 'year', 'week', 'quarter', 'hour', 'minute']),
22212
+ preferences: propTypes.object,
22213
+ endpoint: (0, propTypes.shape)({
22214
+ url: propTypes.string.isRequired,
22215
+ method: propTypes.string,
22216
+ headers: propTypes.object,
22217
+ body: propTypes.object
22218
+ })
22219
+ };
22220
+ exports["default"] = types;
22221
+ });
22222
+ var types$1 = unwrapExports(types_1);
22223
+
22224
+ var _templateObject$m, _templateObject2$7;
22225
+ var HierarchicalMenuList = styled('ul')(_templateObject$m || (_templateObject$m = _taggedTemplateLiteralLoose(["\n\tlist-style: none;\n\tpadding: 0;\n\tmargin: 0;\n\tmax-height: 0;\n\toverflow: hidden;\n\n\t&.--open {\n\t\tmax-height: 100%;\n\t}\n"])));
22226
+ var HierarchicalMenuListItem = styled('li')(_templateObject2$7 || (_templateObject2$7 = _taggedTemplateLiteralLoose(["\n\tfont-weight: 400;\n\tline-height: 1.5;\n\tbox-sizing: border-box;\n\n\ta {\n\t\tcolor: #424242;\n\t\ttext-decoration: none;\n\t\tgap: 5px;\n\t\t.--leaf-icon,\n\t\t.--folder-icon {\n\t\t\tline-height: 15px;\n\t\t\tsvg {\n\t\t\t\theight: 15px;\n\t\t\t}\n\t\t}\n\n\t\tinput {\n\t\t\tmargin: 0;\n\t\t\tcursor: pointer;\n\t\t}\n\t}\n\n\t.--switcher-icon {\n\t\ttransition: all 0.2s ease-in;\n\t\tmargin-right: 2px;\n\t}\n\t.--list-child {\n\t\tpadding-left: 1rem;\n\t\tposition: relative;\n\t\t&:before {\n\t\t\theight: 100%;\n\t\t\tcontent: '';\n\t\t\tposition: absolute;\n\t\t\tborder-left: 1px solid #787878;\n\t\t\twidth: 0;\n\t\t\tleft: 19px;\n\t\t\t", ";\n\t\t}\n\n\t\t&.--show-switcher-icon {\n\t\t\tpadding-left: 36px;\n\t\t}\n\t}\n\t.--list-item-label {\n\t\tline-height: 100%;\n\t}\n\t.--list-item-count {\n\t\tmargin-left: 10px;\n\t\tpadding: 0.1rem 0.4rem;\n\t\tfont-size: 0.8rem;\n\t\tcolor: #424242;\n\t\tbackground-color: #dee1e6;\n\t\tborder-radius: 8px;\n\t}\n\t&.-selected-item {\n\t\tfont-weight: 700 !important;\n\t}\n\t&.-expanded-item {\n\t\t& > a {\n\t\t\t& div > .--switcher-icon {\n\t\t\t\ttransform: rotate(90deg);\n\t\t\t}\n\t\t}\n\t}\n\t.--list-item-label-count-wrapper {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\t&:hover {\n\t\t\t.--list-item-count,\n\t\t\t.--list-item-label {\n\t\t\t\tfont-weight: 700;\n\t\t\t}\n\t\t}\n\t}\n"])), function (props) {
22227
+ return !props.showLine && "\n\t\t\t\t\tdisplay: none;\n\t\t\t\t";
22228
+ });
22229
+
22230
+ var HierarchicalMenuListItemComponent = {
22231
+ name: 'HierarchicalMenuListItemComponent',
22232
+ data: function data() {
22233
+ return {
22234
+ isExpanded: false,
22235
+ newParentPath: ''
22236
+ };
22237
+ },
22238
+ created: function created() {
22239
+ var listItemLabel = this.listItem.key;
22240
+ var newParentPath = listItemLabel;
22241
+ if (this.parentPath) {
22242
+ newParentPath = "" + this.parentPath + constants_6$1 + listItemLabel;
22243
+ }
22244
+ this.newParentPath = newParentPath;
22245
+ this.isExpanded = !!helper_6(this.selectedValues, newParentPath, constants_6$1);
22246
+ },
22247
+ watch: {
22248
+ listItem: function listItem(newVal) {
22249
+ if (newVal.initiallyExpanded) {
22250
+ this.isExpanded = newVal.initiallyExpanded;
22251
+ }
22252
+ },
22253
+ selectedValues: function selectedValues(newVal) {
22254
+ this.isExpanded = !!helper_6(newVal, this.newParentPath, constants_6$1);
22255
+ }
22256
+ },
22257
+ props: {
22258
+ parentPath: types$1.string,
22259
+ selectedValues: types$1.rawData,
22260
+ mode: types$1.string,
22261
+ searchTerm: types$1.string,
22262
+ listItem: types$1.rawData,
22263
+ showLine: types$1.bool,
22264
+ renderItem: types$1.func,
22265
+ handleListItemClick: types$1.func,
22266
+ renderSwitcherIcon: types$1.func,
22267
+ showCheckbox: Q.bool,
22268
+ innerClass: types$1.style,
22269
+ showRadio: Q.bool,
22270
+ renderIcon: types$1.func,
22271
+ showCount: Q.bool,
22272
+ showSwitcherIcon: types$1.bool,
22273
+ switcherIcon: types$1.children
22274
+ },
22275
+ render: function render() {
22276
+ var _this = this;
22277
+ var _this$$props = this.$props,
22278
+ selectedValues = _this$$props.selectedValues,
22279
+ mode = _this$$props.mode,
22280
+ searchTerm = _this$$props.searchTerm,
22281
+ listItem = _this$$props.listItem,
22282
+ parentPath = _this$$props.parentPath,
22283
+ showLine = _this$$props.showLine,
22284
+ renderItem = _this$$props.renderItem,
22285
+ handleListItemClick = _this$$props.handleListItemClick,
22286
+ showCheckbox = _this$$props.showCheckbox,
22287
+ innerClass = _this$$props.innerClass,
22288
+ showRadio = _this$$props.showRadio,
22289
+ renderIcon = _this$$props.renderIcon,
22290
+ showCount = _this$$props.showCount,
22291
+ showSwitcherIcon = _this$$props.showSwitcherIcon;
22292
+ if (!(listItem instanceof Object) || Object.keys(listItem).length === 0) {
22293
+ return null;
22294
+ }
22295
+ var listItemLabel = listItem.key;
22296
+ var listItemCount = listItem.count;
22297
+ var isLeafNode = !(Array.isArray(listItem.list) && listItem.list.length > 0);
22298
+ var renderSwitcherIcon = function renderSwitcherIcon(isExpandedProp) {
22299
+ if (showSwitcherIcon === false) {
22300
+ return null;
22301
+ }
22302
+ var switcherIcon = _this.$props.switcherIcon;
22303
+ if (switcherIcon) return switcherIcon(isExpandedProp);
22304
+ return (
22305
+ /* eslint-disable jsx-a11y/click-events-have-key-events
22306
+ , jsx-a11y/no-static-element-interactions,jsx-a11y/no-noninteractive-tabindex */
22307
+ vue.createVNode("span", {
22308
+ "tabIndex": "0",
22309
+ "onClick": function onClick(e) {
22310
+ e.stopPropagation();
22311
+ _this.isExpanded = !_this.isExpanded;
22312
+ },
22313
+ "class": "--switcher-icon"
22314
+ }, [vue.createTextVNode("\u27A4")])
22315
+ );
22316
+ };
22317
+ var isSelected = false;
22318
+ if (mode === 'single') {
22319
+ if (helper_6(selectedValues, this.newParentPath, constants_6$1) === true) {
22320
+ isSelected = true;
22321
+ }
22322
+ } else {
22323
+ isSelected = !!helper_6(selectedValues, this.newParentPath, constants_6$1);
22324
+ }
22325
+ return vue.createVNode(HierarchicalMenuListItem, {
22326
+ "class": (isSelected ? '-selected-item' : '') + " " + (this.isExpanded ? '-expanded-item' : ''),
22327
+ "key": this.newParentPath,
22328
+ "showLine": showLine
22329
+ }, {
22330
+ "default": function _default() {
22331
+ return [vue.createVNode(ListItem, {
22332
+ "isTreeListItem": true,
22333
+ "onClick": function onClick() {
22334
+ handleListItemClick(listItemLabel, parentPath);
22335
+ },
22336
+ "style": {
22337
+ textDecoration: 'none'
22338
+ }
22339
+ }, {
22340
+ "default": function _default() {
22341
+ return [renderItem ? renderItem(listItemLabel, listItemCount, isSelected) : vue.createVNode(Flex, {
22342
+ "alignItems": "center",
22343
+ "gap": "5px"
22344
+ }, {
22345
+ "default": function _default() {
22346
+ return [!isLeafNode && renderSwitcherIcon(isSelected), mode === 'multiple' && showCheckbox && vue.createVNode(Flex, {
22347
+ "alignItems": "center",
22348
+ "gap": "5px"
22349
+ }, {
22350
+ "default": function _default() {
22351
+ return [vue.createVNode(Checkbox, {
22352
+ "type": "checkbox",
22353
+ "class": helper_28(innerClass, 'checkbox') || null,
22354
+ "checked": isSelected,
22355
+ "id": listItemLabel + "-checkbox-" + _this.newParentPath,
22356
+ "name": listItemLabel + "-checkbox-" + _this.newParentPath,
22357
+ "show": true,
22358
+ "readOnly": true
22359
+ }, null), vue.createVNode("label", {
22360
+ "style": {
22361
+ width: '26px',
22362
+ marginTop: 0,
22363
+ marginBottom: 0,
22364
+ marginRight: '-9px',
22365
+ left: '-3px'
22366
+ },
22367
+ "htmlFor": listItemLabel + "-checkbox-" + _this.newParentPath,
22368
+ "onClick": function onClick(e) {
22369
+ e.stopPropagation();
22370
+ }
22371
+ }, null)];
22372
+ }
22373
+ }), mode === 'single' && showRadio && vue.createVNode(Flex, {
22374
+ "alignItems": "center",
22375
+ "gap": "5px"
22376
+ }, {
22377
+ "default": function _default() {
22378
+ return [vue.createVNode(Radio, {
22379
+ "checked": isSelected,
22380
+ "class": helper_28(innerClass, 'radio') || null,
22381
+ "id": listItemLabel + "-radio-" + _this.newParentPath,
22382
+ "name": listItemLabel + "-radio-" + _this.newParentPath,
22383
+ "show": true,
22384
+ "readOnly": true,
22385
+ "type": "radio"
22386
+ }, null), vue.createVNode("label", {
22387
+ "style": {
22388
+ width: '26px',
22389
+ marginTop: 0,
22390
+ marginBottom: 0,
22391
+ marginRight: '-9px',
22392
+ left: '-3px'
22393
+ },
22394
+ "htmlFor": listItemLabel + "-radio-" + _this.newParentPath,
22395
+ "onClick": function onClick(e) {
22396
+ e.stopPropagation();
22397
+ }
22398
+ }, null)];
22399
+ }
22400
+ }), ' ', renderIcon(isLeafNode), vue.createVNode("div", {
22401
+ "class": "--list-item-label-count-wrapper"
22402
+ }, [vue.createVNode("span", {
22403
+ "class": "--list-item-label " + (helper_28(innerClass, 'label') || '')
22404
+ }, [listItemLabel]), showCount && vue.createVNode("span", {
22405
+ "class": "--list-item-count " + (helper_28(innerClass, 'count') || '')
22406
+ }, [listItemCount])])];
22407
+ }
22408
+ })];
22409
+ }
22410
+ }), isLeafNode === false && vue.createVNode("div", {
22411
+ "class": "--list-child " + (showSwitcherIcon ? ' --show-switcher-icon' : '')
22412
+ }, [vue.createVNode(HierarchicalMenuComponent, {
22413
+ "key": _this.newParentPath + "-" + listItemLabel + "-" + listItemCount,
22414
+ "listArray": listItem.list,
22415
+ "parentPath": _this.newParentPath,
22416
+ "isExpanded": _this.isExpanded,
22417
+ "listItemProps": {
22418
+ mode: mode,
22419
+ selectedValues: selectedValues,
22420
+ searchTerm: searchTerm,
22421
+ showLine: showLine,
22422
+ renderItem: renderItem,
22423
+ handleListItemClick: handleListItemClick,
22424
+ renderSwitcherIcon: renderSwitcherIcon,
22425
+ showCheckbox: showCheckbox,
22426
+ innerClass: innerClass,
22427
+ showRadio: showRadio,
22428
+ renderIcon: renderIcon,
22429
+ showCount: showCount,
22430
+ showSwitcherIcon: showSwitcherIcon,
22431
+ switcherIcon: _this.$props.switcherIcon
22432
+ }
22433
+ }, null)])];
22434
+ }
22435
+ });
22436
+ }
22437
+ };
22438
+
22439
+ function _isSlot$6(s) {
22440
+ return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
22441
+ }
22442
+ var HierarchicalMenuComponent = {
22443
+ name: 'HierarchicalMenuComponent',
22444
+ props: {
22445
+ listArray: Q.arrayOf(Q.object),
22446
+ // array of objects
22447
+ parentPath: Q.string.def(''),
22448
+ isExpanded: Q.bool.def(false),
22449
+ listItemProps: types$1.rawData
22450
+ },
22451
+ render: function render() {
22452
+ var _slot;
22453
+ var _this$$props = this.$props,
22454
+ listArray = _this$$props.listArray,
22455
+ isExpanded = _this$$props.isExpanded,
22456
+ parentPath = _this$$props.parentPath,
22457
+ listItemProps = _this$$props.listItemProps;
22458
+ if (!Array.isArray(listArray) || listArray.length === 0) {
22459
+ return null;
22460
+ }
22461
+ return vue.createVNode(HierarchicalMenuList, {
22462
+ "class": "" + (isExpanded ? '--open' : ''),
22463
+ "isSelected": isExpanded
22464
+ }, _isSlot$6(_slot = listArray.map(function (listItem) {
22465
+ return vue.createVNode(HierarchicalMenuListItemComponent, vue.mergeProps({
22466
+ "key": parentPath + "__" + JSON.stringify(listItem),
22467
+ "parentPath": parentPath,
22468
+ "listItem": listItem
22469
+ }, listItemProps), null);
22470
+ })) ? _slot : {
22471
+ "default": function _default() {
22472
+ return [_slot];
22473
+ }
22474
+ });
22475
+ }
22476
+ };
22477
+
22478
+ function _isSlot$7(s) {
22479
+ return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
22480
+ }
22481
+ var updateQueryAction = lib_5.updateQuery,
22482
+ setQueryOptions$3 = lib_5.setQueryOptions;
22483
+ var transformValueIntoLocalState = function transformValueIntoLocalState(valueArray) {
22484
+ var valueToSet = {};
22485
+ if (valueArray.length) {
22486
+ var newSelectedValues = {};
22487
+ valueArray.forEach(function (valueItem) {
22488
+ helper_48(newSelectedValues, valueItem.split(' > '), !helper_6(newSelectedValues, valueItem.split(' > '), constants_6$1), true);
22489
+ });
22490
+ valueToSet = newSelectedValues;
22491
+ }
22492
+ return valueToSet;
22493
+ };
22494
+ var TreeList = {
22495
+ name: 'TreeList',
22496
+ props: {
22497
+ selectedValue: types.selectedValue,
22498
+ error: types.title,
22499
+ rawData: types.rawData,
22500
+ aggregationData: types.rawData,
22501
+ themePreset: types.themePreset,
22502
+ updateQueryAction: types.funcRequired,
22503
+ setQueryOptions: types.funcRequired,
22504
+ // component props
22505
+ componentId: types.string.isRequired,
22506
+ className: types.string,
22507
+ style: types.style,
22508
+ showRadio: Q.bool.def(false),
22509
+ showCheckbox: types.bool.def(false),
22510
+ mode: Q.oneOf(['single', 'multiple']).def('multiple'),
22511
+ showCount: Q.bool.def(false),
22512
+ showSearch: Q.bool.def(false),
22513
+ showIcon: Q.bool.def(false),
22514
+ icon: types.children,
22515
+ showLeafIcon: Q.bool.def(false),
22516
+ leafIcon: types.children,
22517
+ showLine: Q.bool.def(false),
22518
+ switcherIcon: types.func,
22519
+ render: types.func,
22520
+ renderItem: types.func,
22521
+ innerClass: types.style,
22522
+ placeholder: types.string,
22523
+ title: types.title,
22524
+ isLoading: types.bool,
22525
+ dataField: types.stringArray.isRequired,
22526
+ onQueryChange: types.func,
22527
+ defaultValue: types.stringArray,
22528
+ value: types.stringArray,
22529
+ customQuery: types.func,
22530
+ defaultQuery: types.func,
22531
+ enableAppbase: types.bool,
22532
+ index: types.string,
22533
+ showFilter: types.bool,
22534
+ URLParams: types.bool,
22535
+ filterLabel: types.string,
22536
+ onChange: types.func,
22537
+ onValueChange: types.func,
22538
+ beforeValueChange: types.func,
22539
+ sortBy: types.sortByWithCount.def('count'),
22540
+ onError: types.func,
22541
+ showSwitcherIcon: types.bool.def(true),
22542
+ renderError: types.title,
22543
+ renderNoResults: types.func,
22544
+ loader: types.title,
22545
+ aggergationSize: types.number,
22546
+ endpoint: types.endpoint,
22547
+ queryFormat: types.queryFormatSearch.def('or'),
22548
+ size: types.number.def(100),
22549
+ nestedField: types.string,
22550
+ react: types.react,
22551
+ transformData: types.func,
22552
+ selectAllLabel: types.string,
22553
+ showMissing: Q.bool.def(false),
22554
+ missingLabel: Q.string.def('N/A')
22555
+ },
22556
+ data: function data() {
22557
+ var props = this.$props;
22558
+ this.__state = {
22559
+ selectedValues: {},
22560
+ searchTerm: '',
22561
+ aggregationData: []
22562
+ };
22563
+ this.internalComponent = props.componentId + "__internal";
22564
+ return this.__state;
22565
+ },
22566
+ created: function created() {
22567
+ var props = this.$props;
22568
+ var componentId = props.componentId;
22569
+ var defaultValue = this.defaultValue || this.value;
22570
+ var currentValueArray = this.selectedValue || defaultValue || [];
22571
+ // update local state for selected values
22572
+ if (currentValueArray.length) {
22573
+ var newSelectedValues = transformValueIntoLocalState(currentValueArray);
22574
+ this.setValue(newSelectedValues, true);
22575
+ }
22576
+
22577
+ // Set custom and default queries in store
22578
+ helper_32(componentId, props, currentValueArray);
22579
+ helper_31(componentId, props, currentValueArray);
22580
+ this.updateQueryOptions();
22581
+ },
22582
+ mounted: function mounted() {
22583
+ var _this$$props = this.$props,
22584
+ enableAppbase = _this$$props.enableAppbase,
22585
+ index = _this$$props.index;
22586
+ if (!enableAppbase && index) {
22587
+ console.warn('Warning(ReactiveSearch): In order to use the `index` prop, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
22588
+ }
22589
+ },
22590
+ watch: {
22591
+ defaultQuery: function defaultQuery() {
22592
+ this.updateDefaultQuery();
22593
+ this.updateQuery([]);
22594
+ },
22595
+ customQuery: function customQuery() {
22596
+ var valueArray = helper_4(this.$data.selectedValues) || [];
22597
+ this.updateQuery(valueArray);
22598
+ },
22599
+ sortBy: function sortBy() {
22600
+ this.updateQueryOptions();
22601
+ },
22602
+ dataField: function dataField() {
22603
+ var valueArray = helper_4(this.$data.selectedValues) || [];
22604
+ this.updateQueryOptions();
22605
+ this.updateQuery(valueArray);
22606
+ },
22607
+ value: function value(newVal, oldVal) {
22608
+ if (!helper_33(newVal, oldVal)) {
22609
+ this.setValue(newVal);
22610
+ }
22611
+ },
22612
+ selectedValue: function selectedValue(newVal) {
22613
+ if (!helper_33(helper_4(this.$data.selectedValues), newVal)) {
22614
+ var _this$$props2 = this.$props,
22615
+ value = _this$$props2.value,
22616
+ onChange = _this$$props2.onChange;
22617
+ var valueToSet = [];
22618
+ if (Array.isArray(newVal) && newVal.length) {
22619
+ valueToSet = newVal;
22620
+ }
22621
+ if (value === undefined) {
22622
+ this.setValue(valueToSet);
22623
+ } else if (onChange && !helper_33(value, valueToSet)) {
22624
+ onChange(valueToSet);
22625
+ }
22626
+ }
22627
+ },
22628
+ aggregationData: function aggregationData(newVal, oldVal) {
22629
+ if (newVal && !helper_33(newVal, oldVal)) {
22630
+ this.$data.aggregationData = newVal;
22631
+ }
22632
+ }
22633
+ },
22634
+ computed: {
22635
+ hasCustomRenderer: function hasCustomRenderer$1() {
22636
+ return hasCustomRenderer(this);
22637
+ }
22638
+ },
22639
+ methods: {
22640
+ renderIcon: function renderIcon(isLeafNode) {
22641
+ var _this$$props3 = this.$props,
22642
+ showIcon = _this$$props3.showIcon,
22643
+ showLeafIcon = _this$$props3.showLeafIcon,
22644
+ icon = _this$$props3.icon;
22645
+ if (isLeafNode) {
22646
+ if (!showLeafIcon) return null;
22647
+ var _ref = this.$slots || this.$props,
22648
+ leafIcon = _ref.leafIcon;
22649
+ if (leafIcon) return leafIcon();
22650
+ return vue.createVNode("span", {
22651
+ "role": "img",
22652
+ "aria-label": "file",
22653
+ "class": "--leaf-icon"
22654
+ }, [vue.createVNode("svg", {
22655
+ "viewBox": "64 64 896 896",
22656
+ "focusable": "false",
22657
+ "data-icon": "file",
22658
+ "width": "1em",
22659
+ "height": "1em",
22660
+ "fill": "currentColor",
22661
+ "aria-hidden": "true"
22662
+ }, [vue.createVNode("path", {
22663
+ "d": "M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494z"
22664
+ }, null)])]);
22665
+ }
22666
+ if (!showIcon) return null;
22667
+ if (icon) {
22668
+ return icon;
22669
+ }
22670
+ if (this.$slots.icon) {
22671
+ return this.$slots.icon();
22672
+ }
22673
+ return vue.createVNode("span", {
22674
+ "role": "img",
22675
+ "aria-label": "folder-open",
22676
+ "class": "--folder-icon"
22677
+ }, [vue.createVNode("svg", {
22678
+ "viewBox": "64 64 896 896",
22679
+ "focusable": "false",
22680
+ "data-icon": "folder-open",
22681
+ "width": "1em",
22682
+ "height": "1em",
22683
+ "fill": "currentColor",
22684
+ "aria-hidden": "true"
22685
+ }, [vue.createVNode("path", {
22686
+ "d": "M928 444H820V330.4c0-17.7-14.3-32-32-32H473L355.7 186.2a8.15 8.15 0 00-5.5-2.2H96c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h698c13 0 24.8-7.9 29.7-20l134-332c1.5-3.8 2.3-7.9 2.3-12 0-17.7-14.3-32-32-32zM136 256h188.5l119.6 114.4H748V444H238c-13 0-24.8 7.9-29.7 20L136 643.2V256zm635.3 512H159l103.3-256h612.4L771.3 768z"
22687
+ }, null)])]);
22688
+ },
22689
+ getTransformedData: function getTransformedData() {
22690
+ var _this$$props4 = this.$props,
22691
+ dataField = _this$$props4.dataField,
22692
+ showSearch = _this$$props4.showSearch;
22693
+ var transformedData = helper_5(this.$data.aggregationData, dataField);
22694
+ var filteredData = [];
22695
+ if (showSearch && this.searchTerm) {
22696
+ filteredData = this.filterDataBasedOnSearchTerm(transformedData, '');
22697
+ }
22698
+ return filteredData.length ? filteredData : transformedData;
22699
+ },
22700
+ handleInputChange: function handleInputChange(e) {
22701
+ var value = e.target.value;
22702
+ this.searchTerm = value;
22703
+ },
22704
+ renderSearch: function renderSearch() {
22705
+ var _this$$props5 = this.$props,
22706
+ showSearch = _this$$props5.showSearch,
22707
+ innerClass = _this$$props5.innerClass,
22708
+ placeholder = _this$$props5.placeholder,
22709
+ componentId = _this$$props5.componentId,
22710
+ themePreset = _this$$props5.themePreset;
22711
+ if (showSearch) {
22712
+ return vue.createVNode(Input, {
22713
+ "class": helper_28(innerClass, 'input') || null,
22714
+ "onInput": this.handleInputChange,
22715
+ "value": this.searchTerm,
22716
+ "placeholder": placeholder || 'Search',
22717
+ "style": {
22718
+ margin: '0 0 8px'
22719
+ },
22720
+ "aria-label": componentId + "-search",
22721
+ "themePreset": themePreset
22722
+ }, null);
22723
+ }
22724
+ return null;
22725
+ },
22726
+ handleListItemClick: function handleListItemClick(key, parentPath) {
22727
+ var path = key;
22728
+ if (parentPath) {
22729
+ path = "" + parentPath + constants_6$1 + key;
22730
+ }
22731
+ var newSelectedValues = _extends({}, this.selectedValues);
22732
+ if (this.$props.mode === 'single') {
22733
+ newSelectedValues = {};
22734
+ helper_48(newSelectedValues, path.split(constants_6$1), true, true);
22735
+ } else {
22736
+ var newValue = !helper_6(newSelectedValues, path, constants_6$1);
22737
+ helper_48(newSelectedValues, path.split(constants_6$1), newValue, true);
22738
+ }
22739
+ newSelectedValues = sanitizeObject(_extends({}, newSelectedValues));
22740
+ if (this.$props.value === undefined) {
22741
+ this.setValue(newSelectedValues);
22742
+ } else if (this.$props.onChange) {
22743
+ var valueToSet = helper_4(newSelectedValues);
22744
+ this.$props.onChange(valueToSet);
22745
+ }
22746
+ },
22747
+ filterDataBasedOnSearchTerm: function filterDataBasedOnSearchTerm(listArray, parentPath) {
22748
+ var _this = this;
22749
+ if (!(listArray && Array.isArray(listArray) && listArray.length)) {
22750
+ return null;
22751
+ }
22752
+ var result = [];
22753
+ listArray.forEach(function (ele) {
22754
+ var isLeafItem = !ele.list;
22755
+ var newParentPath = ele.key;
22756
+ if (parentPath) {
22757
+ newParentPath = parentPath + "." + ele.key;
22758
+ }
22759
+ var keyHasSearchTerm = suggestions_1(ele.key).toLowerCase().includes(suggestions_1(_this.$data.searchTerm).toLowerCase()) || helper_6(_this.$data.selectedValues, newParentPath, constants_6$1);
22760
+ if (isLeafItem && keyHasSearchTerm) {
22761
+ result.push(_extends({}, ele, {
22762
+ initiallyExpanded: keyHasSearchTerm
22763
+ }));
22764
+ } else if (!isLeafItem) {
22765
+ var filteredChildrenItems = _this.filterDataBasedOnSearchTerm(ele.list, newParentPath);
22766
+ if (keyHasSearchTerm || !!filteredChildrenItems.length) {
22767
+ result.push(_extends({}, ele, {
22768
+ initiallyExpanded: keyHasSearchTerm || !!filteredChildrenItems.length,
22769
+ list: filteredChildrenItems
22770
+ }));
22771
+ }
22772
+ }
22773
+ });
22774
+ return result;
22775
+ },
22776
+ getComponent: function getComponent() {
22777
+ var _this$$props6 = this.$props,
22778
+ rawData = _this$$props6.rawData,
22779
+ error = _this$$props6.error,
22780
+ isLoading = _this$$props6.isLoading;
22781
+ var data = {
22782
+ data: this.getTransformedData(),
22783
+ rawData: rawData,
22784
+ error: error,
22785
+ handleClick: this.handleListItemClick,
22786
+ value: this.$data.selectedValues,
22787
+ loading: isLoading,
22788
+ PATH_SEPARATOR: constants_6$1
22789
+ };
22790
+ return this.$slots.render(data) || helper_8(data, this.$props);
22791
+ },
22792
+ getDefaultQuery: function getDefaultQuery(value) {
22793
+ var _this2 = this;
22794
+ var query = null;
22795
+ var type = 'term';
22796
+ var booleanAggregator = this.$props.queryFormat === 'or' ? 'should' : 'must';
22797
+ if (!Array.isArray(value) || value.length === 0) {
22798
+ return null;
22799
+ }
22800
+ if (value) {
22801
+ var _bool;
22802
+ // adds a sub-query with must as an array of objects for each term/value
22803
+ var queryArray = value.map(function (item) {
22804
+ return {
22805
+ bool: {
22806
+ must: item.split(' > ').map(function (subItem, i) {
22807
+ var _type, _ref2;
22808
+ return _ref2 = {}, _ref2[type] = (_type = {}, _type[_this2.$props.dataField[i]] = subItem, _type), _ref2;
22809
+ })
22810
+ }
22811
+ };
22812
+ });
22813
+ var listQuery = {
22814
+ bool: (_bool = {}, _bool[booleanAggregator] = queryArray, _bool)
22815
+ };
22816
+ query = value.length ? listQuery : null;
22817
+ }
22818
+ if (query && this.$props.nestedField) {
22819
+ return {
22820
+ nested: {
22821
+ path: this.$props.nestedField,
22822
+ query: query
22823
+ }
22824
+ };
22825
+ }
22826
+ return query;
22827
+ },
22828
+ updateQuery: function updateQuery(value) {
22829
+ var customQuery = this.$props.customQuery;
22830
+ var query = this.getDefaultQuery(value);
22831
+ var customQueryOptions;
22832
+ if (customQuery) {
22833
+ var _ref3 = customQuery(value, this.$props) || {};
22834
+ query = _ref3.query;
22835
+ customQueryOptions = helper_24(customQuery(value, this.$props));
22836
+ helper_32(this.$props.componentId, this.$props, value);
22837
+ }
22838
+ this.setQueryOptions(this.$props.componentId, _extends({}, this.generateQueryOptions(), customQueryOptions));
22839
+ this.updateQueryAction({
22840
+ componentId: this.$props.componentId,
22841
+ query: query,
22842
+ value: value,
22843
+ label: this.$props.filterLabel,
22844
+ showFilter: this.$props.showFilter,
22845
+ URLParams: this.$props.URLParams,
22846
+ componentType: constants_1$1.treeList
22847
+ });
22848
+ },
22849
+ setValue: function setValue(value, hasMountedParam) {
22850
+ var _this3 = this;
22851
+ if (hasMountedParam === void 0) {
22852
+ hasMountedParam = true;
22853
+ }
22854
+ var finalValues = Array.isArray(value) === false ? helper_4(value) : value;
22855
+ var performUpdate = function performUpdate() {
22856
+ var handleUpdates = function handleUpdates() {
22857
+ _this3.updateQuery(finalValues);
22858
+ if (_this3.$props.onValueChange) _this3.$props.onValueChange(finalValues);
22859
+ };
22860
+ if (hasMountedParam) {
22861
+ _this3.selectedValues = Array.isArray(value) ? transformValueIntoLocalState(value) : value;
22862
+ handleUpdates();
22863
+ } else {
22864
+ handleUpdates();
22865
+ }
22866
+ };
22867
+ helper_39(this.$props.componentId, finalValues, this.$props.beforeValueChange, performUpdate);
22868
+ },
22869
+ generateQueryOptions: function generateQueryOptions() {
22870
+ var queryOptions = helper_36(this.$props);
22871
+ var valueArray = helper_4(this.selectedValues);
22872
+ return helper_17(valueArray, queryOptions, this.$props);
22873
+ },
22874
+ updateDefaultQuery: function updateDefaultQuery(queryOptions) {
22875
+ var value = helper_4(this.selectedValues);
22876
+ // Update default query for RS API
22877
+ helper_31(this.$props.componentId, this.$props, value);
22878
+ helper_19(transform_11(this.$props.componentId), queryOptions, value, this.$props, this.generateQueryOptions(), null);
22879
+ },
22880
+ updateQueryOptions: function updateQueryOptions() {
22881
+ // for a new query due to other changes don't append after to get fresh results
22882
+ var queryOptions = this.generateQueryOptions(this.$props, {}, helper_4(this.$data.selectedValues));
22883
+ if (this.$props.defaultQuery) {
22884
+ // eslint-disable-next-line no-use-before-define
22885
+ this.updateDefaultQuery(queryOptions);
22886
+ } else {
22887
+ this.setQueryOptions(transform_11(this.$props.componentId), queryOptions);
22888
+ }
22889
+ }
22890
+ },
22891
+ render: function render() {
22892
+ var _this4 = this;
22893
+ var props = this.$props;
22894
+ var style = props.style,
22895
+ className = props.className,
22896
+ mode = props.mode,
22897
+ showLine = props.showLine,
22898
+ renderItem = props.renderItem,
22899
+ showCheckbox = props.showCheckbox,
22900
+ innerClass = props.innerClass,
22901
+ showRadio = props.showRadio,
22902
+ showCount = props.showCount,
22903
+ showSwitcherIcon = props.showSwitcherIcon,
22904
+ switcherIcon = props.switcherIcon,
22905
+ title = props.title,
22906
+ loader = props.loader,
22907
+ renderError = props.renderError;
22908
+ if (this.isLoading) {
22909
+ return (this.$slots.loader ? this.$slots.loader() : loader) || null;
22910
+ }
22911
+ if (this.error) {
22912
+ if (this.$slots.renderError) {
22913
+ return this.$slots.renderError(this.error);
22914
+ }
22915
+ return helper_9(renderError) ? renderError(this.error) : renderError;
22916
+ }
22917
+ var transformedData = this.getTransformedData();
22918
+ if (!transformedData || transformedData.length === 0) {
22919
+ return this.$slots.renderNoResults ? this.$slots.renderNoResults() : null;
22920
+ }
22921
+ return vue.createVNode(Container, {
22922
+ "style": style,
22923
+ "class": className
22924
+ }, {
22925
+ "default": function _default() {
22926
+ return [props.title && vue.createVNode(Title, {
22927
+ "class": helper_28(innerClass, 'title') || null
22928
+ }, _isSlot$7(title) ? title : {
22929
+ "default": function _default() {
22930
+ return [title];
22931
+ }
22932
+ }), _this4.renderSearch(), _this4.hasCustomRenderer ? _this4.getComponent() : vue.createVNode(HierarchicalMenuComponent, {
22933
+ "key": "initial-node",
22934
+ "listArray": transformedData,
22935
+ "parentPath": "",
22936
+ "isExpanded": true,
22937
+ "listItemProps": {
22938
+ mode: mode,
22939
+ selectedValues: _this4.selectedValues,
22940
+ searchTerm: _this4.searchTerm,
22941
+ showLine: showLine,
22942
+ renderItem: renderItem != null ? renderItem : _this4.$slots.renderItem,
22943
+ handleListItemClick: _this4.handleListItemClick,
22944
+ showCheckbox: showCheckbox,
22945
+ innerClass: innerClass,
22946
+ showRadio: showRadio,
22947
+ renderIcon: _this4.renderIcon,
22948
+ showCount: showCount,
22949
+ showSwitcherIcon: showSwitcherIcon,
22950
+ switcherIcon: switcherIcon != null ? switcherIcon : _this4.$slots.switcherIcon
22951
+ }
22952
+ }, null)];
22953
+ }
22954
+ });
22955
+ }
22956
+ };
22957
+ var mapStateToProps$6 = function mapStateToProps(state, props) {
22958
+ return {
22959
+ selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || null,
22960
+ rawData: state.rawData[props.componentId] || {},
22961
+ aggregationData: props.nestedField && state.aggregations[props.componentId] ? state.aggregations[props.componentId].reactivesearch_nested : state.aggregations[props.componentId] || {},
22962
+ themePreset: state.config.themePreset,
22963
+ error: state.error[props.componentId],
22964
+ isLoading: state.isLoading[props.componentId],
22965
+ enableAppbase: state.config.enableAppbase
22966
+ };
22967
+ };
22968
+ var mapDispatchtoProps$4 = {
22969
+ setQueryOptions: setQueryOptions$3,
22970
+ updateQueryAction: updateQueryAction
22971
+ };
22972
+ TreeList.hasInternalComponent = function () {
22973
+ return true;
22974
+ };
22975
+ var TreeListConnected = PreferencesConsumer(ComponentWrapper$1(connect(mapStateToProps$6, mapDispatchtoProps$4)(TreeList), {
22976
+ componentType: constants_1$1.treeList,
22977
+ internalComponent: TreeList.hasInternalComponent()
22978
+ }));
22979
+ TreeListConnected.name = TreeList.name;
22980
+ TreeListConnected.install = function (Vue) {
22981
+ Vue.component(TreeListConnected.name, TreeListConnected);
22982
+ };
22983
+
22984
+ // Add componentType for SSR
22985
+ TreeListConnected.componentType = constants_1$1.treeList;
22986
+
22987
+ var _templateObject$n, _templateObject2$8;
22988
+ var small = "\n\tmin-height: 0;\n\theight: 30px;\n\tborder: 0;\n\tbox-shadow: rgba(0, 0, 0, 0.3) 0px 1px 4px -1px;\n\tborder-radius: 2px;\n";
22989
+ var dark$2 = function dark(_ref) {
22990
+ var theme = _ref.theme;
22991
+ return "\n\tbackground-color: " + (theme.colors ? theme.colors.backgroundColor : '') + ";\n\tborder-color: " + (theme.colors ? theme.colors.borderColor : '') + ";\n\tcolor: " + (theme.colors ? theme.colors.textColor : '') + ";\n\n\t&:hover,\n\t&:focus {\n\t\tbackground-color: " + (theme.colors ? theme.colors.backgroundColor : '') + ";\n\t}\n";
22992
+ };
22993
+ var Select = styled('button')(_templateObject$n || (_templateObject$n = _taggedTemplateLiteralLoose(["\n\twidth: 100%;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: space-between;\n\tmin-height: 42px;\n\tborder-radius: 0;\n\toutline: none;\n\tpadding: 5px 12px;\n\tfont-size: 0.9rem;\n\tline-height: 1.2rem;\n\tbackground-color: #fff;\n\tborder: 1px solid #ccc;\n\tcolor: #424242;\n\tcursor: pointer;\n\tuser-select: none;\n\ttransition: all 0.3s ease;\n\n\t", ";\n\n\t& > div {\n\t\twidth: calc(100% - 24px);\n\t\twhite-space: nowrap;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\ttext-align: left;\n\t}\n\n\t&:hover,\n\t&:focus {\n\t\tbackground-color: #fcfcfc;\n\t}\n\n\t", ";\n"])), function (props) {
22994
+ return props.small ? small : null;
22995
+ }, function (_ref2) {
22996
+ var themePreset = _ref2.themePreset;
22997
+ return themePreset === 'dark' && dark$2;
22998
+ });
22999
+ var Tick = styled('span')(_templateObject2$8 || (_templateObject2$8 = _taggedTemplateLiteralLoose(["\n\twidth: 16px;\n\theight: 16px;\n\tdisplay: inline-block;\n\tposition: relative;\n\tuser-select: none;\n\talign-items: center;\n\n\t&::after {\n\t\tbox-sizing: content-box;\n\t\tcontent: '';\n\t\tposition: absolute;\n\t\tbackground-color: transparent;\n\t\ttop: 50%;\n\t\tleft: 0;\n\t\twidth: 8px;\n\t\theight: 4px;\n\t\tmargin-top: -4px;\n\t\tborder-style: solid;\n\t\tborder-color: ", ";\n\t\tborder-width: 0 0 2px 2px;\n\t\tborder-radius: 0;\n\t\tborder-image: none;\n\t\ttransform: rotate(-45deg) scale(1);\n\t\ttransition: all 200ms ease-out;\n\t}\n"])), function (_ref3) {
23000
+ var theme = _ref3.theme;
23001
+ return theme.colors.primaryColor;
23002
+ });
23003
+
23004
+ var _templateObject$o;
23005
+ var open = "\n\ttop: 0.55em;\n\ttransform: rotate(-45deg);\n";
23006
+ var Chevron = styled('span')(_templateObject$o || (_templateObject$o = _taggedTemplateLiteralLoose(["\n\t&::before {\n\t\tcontent: '';\n\t\tborder-style: solid;\n\t\tborder-width: 0.15em 0.15em 0 0;\n\t\tdisplay: inline-block;\n\t\theight: 0.45em;\n\t\tposition: relative;\n\t\ttop: 0.35em;\n\t\tleft: 0;\n\t\ttransform: rotate(135deg);\n\t\tvertical-align: top;\n\t\twidth: 0.45em;\n\n\t\t", ";\n\t}\n"])), function (props) {
23007
+ return props.open ? open : null;
23008
+ });
23009
+
23010
+ var getClassName$6 = lib_8.getClassName;
23011
+ var Dropdown = {
23012
+ data: function data() {
23013
+ this.__state = {
23014
+ isOpen: false,
23015
+ searchTerm: ''
23016
+ };
23017
+ return this.__state;
23018
+ },
23019
+ inject: {
23020
+ theme: {
23021
+ from: 'theme_reactivesearch'
23022
+ }
23023
+ },
23024
+ props: {
23025
+ innerClass: types.style,
23026
+ items: types.data,
23027
+ keyField: Q.string.def('key'),
23028
+ labelField: Q.string.def('label'),
23029
+ multi: Q.bool,
23030
+ // change event
23031
+ placeholder: types.string,
23032
+ returnsObject: Q.bool,
23033
+ customLabelRenderer: types.func,
23034
+ hasCustomRenderer: Q.bool,
23035
+ customRenderer: types.func,
23036
+ renderItem: types.func,
23037
+ renderNoResults: Q.any,
23038
+ handleChange: types.func,
23039
+ transformData: types.func,
23040
+ selectedItem: types.selectedValue,
23041
+ showCount: Q.bool,
23042
+ single: Q.bool,
23043
+ small: Q.bool.def(false),
23044
+ themePreset: types.themePreset,
23045
+ showSearch: Q.bool,
23046
+ showClear: Q.bool,
23047
+ searchPlaceholder: Q.string.def('Type here to search...')
23048
+ },
23049
+ render: function render() {
23050
+ var _this = this;
23051
+ var _this$$props = this.$props,
23052
+ items = _this$$props.items,
23053
+ selectedItem = _this$$props.selectedItem,
23054
+ placeholder = _this$$props.placeholder,
23055
+ labelField = _this$$props.labelField,
23056
+ keyField = _this$$props.keyField,
23057
+ themePreset = _this$$props.themePreset,
23058
+ renderItem = _this$$props.renderItem,
23059
+ transformData = _this$$props.transformData,
23060
+ footer = _this$$props.footer,
23061
+ customLabelRenderer = _this$$props.customLabelRenderer,
23062
+ hasCustomRenderer = _this$$props.hasCustomRenderer,
23063
+ customRenderer = _this$$props.customRenderer;
23064
+ var itemsToRender = items;
23065
+ if (transformData) {
23066
+ itemsToRender = transformData(itemsToRender);
23067
+ }
23068
+ var filteredItemsToRender = itemsToRender.filter(function (item) {
23069
+ if (String(item[labelField]).length) {
23070
+ if (_this.$props.showSearch && _this.$data.searchTerm) {
23071
+ return suggestions_1(String(item[labelField])).toLowerCase().includes(suggestions_1(_this.$data.searchTerm.toLowerCase()));
23072
+ }
23073
+ return true;
23074
+ }
23075
+ return false;
23076
+ });
23077
+ return vue.createVNode(Downshift, {
23078
+ "isOpen": this.$data.isOpen,
23079
+ "selectedItem": selectedItem,
23080
+ "handleChange": this.onChange,
23081
+ "handleMouseup": this.handleStateChange
23082
+ }, {
23083
+ "default": function _default(_ref) {
23084
+ var getItemProps = _ref.getItemProps,
23085
+ isOpen = _ref.isOpen,
23086
+ highlightedIndex = _ref.highlightedIndex,
23087
+ getButtonProps = _ref.getButtonProps,
23088
+ getItemEvents = _ref.getItemEvents,
23089
+ getInputEvents = _ref.getInputEvents;
23090
+ return vue.createVNode("div", {
23091
+ "class": suggestionsContainer
23092
+ }, [vue.createVNode(Select, vue.mergeProps(babelHelperVueTransformOn(getButtonProps({
23093
+ onClick: _this.toggle
23094
+ })), {
23095
+ "class": getClassName$6(_this.$props.innerClass, 'select') || '',
23096
+ "title": selectedItem ? _this.renderToString(selectedItem) : placeholder,
23097
+ "small": _this.$props.small,
23098
+ "themePreset": _this.$props.themePreset
23099
+ }), {
23100
+ "default": function _default() {
23101
+ return [customLabelRenderer ? customLabelRenderer(selectedItem) : vue.createVNode("div", null, [selectedItem ? _this.renderToString(selectedItem) : placeholder]), vue.createVNode(Chevron, {
23102
+ "open": isOpen
23103
+ }, null)];
23104
+ }
23105
+ }), hasCustomRenderer ? customRenderer(itemsToRender, {
23106
+ getItemProps: getItemProps,
23107
+ isOpen: isOpen,
23108
+ highlightedIndex: highlightedIndex,
23109
+ getButtonProps: getButtonProps,
23110
+ getItemEvents: getItemEvents
23111
+ }) : isOpen && itemsToRender.length ? vue.createVNode("ul", {
23112
+ "class": suggestions$1(themePreset, _this.theme) + " " + (_this.$props.small ? 'small' : '') + " " + getClassName$6(_this.$props.innerClass, 'list')
23113
+ }, [_this.$props.showSearch ? _this.renderSearchbox({
23114
+ on: {
23115
+ input: getInputEvents({
23116
+ onInput: _this.handleInputChange
23117
+ }).input
23118
+ }
23119
+ }) : null, !hasCustomRenderer && filteredItemsToRender.length === 0 ? _this.renderNoResult() : filteredItemsToRender.map(function (item, index) {
23120
+ var selected = _this.$props.multi // MultiDropdownList
23121
+ && (selectedItem && !!selectedItem[item[keyField]] // MultiDropdownRange
23122
+ || Array.isArray(selectedItem) && selectedItem.find(function (value) {
23123
+ return value[labelField] === item[labelField];
23124
+ }));
23125
+ if (!_this.$props.multi) selected = item.key === selectedItem;
23126
+ return vue.createVNode("li", vue.mergeProps(getItemProps({
23127
+ item: item
23128
+ }), babelHelperVueTransformOn(getItemEvents({
23129
+ item: item
23130
+ })), {
23131
+ "key": item[keyField],
23132
+ "class": "" + (selected ? 'active' : ''),
23133
+ "style": {
23134
+ backgroundColor: _this.getBackgroundColor(highlightedIndex === index, selected)
23135
+ }
23136
+ }), [renderItem ? renderItem({
23137
+ label: item[labelField],
23138
+ count: item.doc_count,
23139
+ isChecked: selected && _this.$props.multi
23140
+ }) : vue.createVNode("div", null, [typeof item[labelField] === 'string' ? vue.createVNode("span", {
23141
+ "innerHTML": item[labelField]
23142
+ }, null) : item[labelField], _this.$props.showCount && item.doc_count && vue.createVNode("span", {
23143
+ "class": getClassName$6(_this.$props.innerClass, 'count') || ''
23144
+ }, [vue.createTextVNode("\xA0("), item.doc_count, vue.createTextVNode(")")])]), selected && _this.$props.multi ? vue.createVNode(Tick, {
23145
+ "class": getClassName$6(_this.$props.innerClass, 'icon') || ''
23146
+ }, null) : null]);
23147
+ }), footer]) : null]);
23148
+ }
23149
+ });
23150
+ },
23151
+ methods: {
23152
+ toggle: function toggle() {
23153
+ this.isOpen = !this.$data.isOpen;
23154
+ },
23155
+ close: function close() {
23156
+ this.isOpen = false;
23157
+ },
23158
+ onChange: function onChange(item) {
23159
+ if (this.$props.returnsObject) {
23160
+ this.$props.handleChange(item);
23161
+ } else {
23162
+ this.$props.handleChange(item[this.$props.keyField]);
23163
+ }
23164
+ if (!this.$props.multi) {
23165
+ this.isOpen = false;
23166
+ this.searchTerm = '';
23167
+ }
23168
+ },
23169
+ handleStateChange: function handleStateChange(_ref2) {
23170
+ var isOpen = _ref2.isOpen;
23171
+ this.isOpen = isOpen;
23172
+ },
23173
+ getBackgroundColor: function getBackgroundColor(highlighted, selected) {
23174
+ var isDark = this.$props.themePreset === 'dark';
23175
+ if (highlighted) {
23176
+ return isDark ? '#555' : '#eee';
23177
+ }
23178
+ if (selected) {
23179
+ return isDark ? '#686868' : '#fafafa';
23180
+ }
23181
+ return isDark ? '#424242' : '#fff';
23182
+ },
23183
+ handleInputChange: function handleInputChange(e) {
23184
+ var value = e.target.value;
23185
+ this.searchTerm = value;
23186
+ },
23187
+ clearSearchTerm: function clearSearchTerm() {
23188
+ this.searchTerm = '';
23189
+ },
23190
+ renderToString: function renderToString(value) {
23191
+ var _this2 = this;
23192
+ var customLabelRenderer = this.$props.customLabelRenderer;
23193
+ if (customLabelRenderer) {
23194
+ var customLabel = customLabelRenderer(value);
23195
+ if (typeof customLabel === 'string') {
23196
+ return customLabel;
23197
+ }
23198
+ }
23199
+ if (Array.isArray(value) && value.length) {
23200
+ var arrayToRender = value.map(function (item) {
23201
+ return _this2.renderToString(item);
23202
+ });
23203
+ return arrayToRender.join(', ');
23204
+ }
23205
+ if (value && typeof value === 'object') {
23206
+ if (value[this.$props.labelField]) {
23207
+ return value[this.$props.labelField];
23208
+ }
23209
+ if (Object.keys(value).length) {
23210
+ return this.renderToString(Object.keys(value));
23211
+ }
23212
+ return this.$props.placeholder;
23213
+ }
23214
+ return value;
21371
23215
  },
21372
23216
  renderNoResult: function renderNoResult() {
21373
23217
  var renderNoResults = this.$slots.renderNoResults || this.$props.renderNoResults;
@@ -21422,11 +23266,11 @@
21422
23266
  }
21423
23267
  };
21424
23268
 
21425
- function _isSlot$6(s) {
23269
+ function _isSlot$8(s) {
21426
23270
  return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
21427
23271
  }
21428
23272
  var updateQuery$4 = lib_5.updateQuery,
21429
- setQueryOptions$3 = lib_5.setQueryOptions,
23273
+ setQueryOptions$4 = lib_5.setQueryOptions,
21430
23274
  setCustomQuery$3 = lib_5.setCustomQuery,
21431
23275
  setDefaultQuery$4 = lib_5.setDefaultQuery;
21432
23276
  var getQueryOptions$3 = lib_8.getQueryOptions,
@@ -21637,7 +23481,7 @@
21637
23481
  "css": loadMoreContainer
21638
23482
  }, [vue.createVNode(Button, {
21639
23483
  "onClick": _this2.handleLoadMore
21640
- }, _isSlot$6(loadMoreLabel) ? loadMoreLabel : {
23484
+ }, _isSlot$8(loadMoreLabel) ? loadMoreLabel : {
21641
23485
  "default": function _default() {
21642
23486
  return [loadMoreLabel];
21643
23487
  }
@@ -21784,7 +23628,7 @@
21784
23628
  SingleDropdownList.hasInternalComponent = function () {
21785
23629
  return true;
21786
23630
  };
21787
- var mapStateToProps$6 = function mapStateToProps(state, props) {
23631
+ var mapStateToProps$7 = function mapStateToProps(state, props) {
21788
23632
  return {
21789
23633
  options: props.nestedField && state.aggregations[props.componentId] ? state.aggregations[props.componentId].reactivesearch_nested : state.aggregations[props.componentId],
21790
23634
  rawData: state.rawData[props.componentId],
@@ -21796,13 +23640,13 @@
21796
23640
  componentProps: state.props[props.componentId]
21797
23641
  };
21798
23642
  };
21799
- var mapDispatchtoProps$4 = {
21800
- setQueryOptions: setQueryOptions$3,
23643
+ var mapDispatchtoProps$5 = {
23644
+ setQueryOptions: setQueryOptions$4,
21801
23645
  updateQuery: updateQuery$4,
21802
23646
  setCustomQuery: setCustomQuery$3,
21803
23647
  setDefaultQuery: setDefaultQuery$4
21804
23648
  };
21805
- var ListConnected$2 = PreferencesConsumer(ComponentWrapper$1(connect(mapStateToProps$6, mapDispatchtoProps$4)(SingleDropdownList), {
23649
+ var ListConnected$2 = PreferencesConsumer(ComponentWrapper$1(connect(mapStateToProps$7, mapDispatchtoProps$5)(SingleDropdownList), {
21806
23650
  componentType: constants_1$1.singleDropdownList,
21807
23651
  internalComponent: SingleDropdownList.hasInternalComponent()
21808
23652
  }));
@@ -21816,11 +23660,11 @@
21816
23660
  Vue.component(ListConnected$2.name, ListConnected$2);
21817
23661
  };
21818
23662
 
21819
- function _isSlot$7(s) {
23663
+ function _isSlot$9(s) {
21820
23664
  return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
21821
23665
  }
21822
23666
  var updateQuery$5 = lib_5.updateQuery,
21823
- setQueryOptions$4 = lib_5.setQueryOptions,
23667
+ setQueryOptions$5 = lib_5.setQueryOptions,
21824
23668
  setCustomQuery$4 = lib_5.setCustomQuery,
21825
23669
  setDefaultQuery$5 = lib_5.setDefaultQuery;
21826
23670
  var isEqual$8 = lib_8.isEqual,
@@ -22043,7 +23887,7 @@
22043
23887
  "css": loadMoreContainer
22044
23888
  }, [vue.createVNode(Button, {
22045
23889
  "onClick": _this3.handleLoadMore
22046
- }, _isSlot$7(loadMoreLabel) ? loadMoreLabel : {
23890
+ }, _isSlot$9(loadMoreLabel) ? loadMoreLabel : {
22047
23891
  "default": function _default() {
22048
23892
  return [loadMoreLabel];
22049
23893
  }
@@ -22239,7 +24083,7 @@
22239
24083
  MultiDropdownList.hasInternalComponent = function () {
22240
24084
  return true;
22241
24085
  };
22242
- var mapStateToProps$7 = function mapStateToProps(state, props) {
24086
+ var mapStateToProps$8 = function mapStateToProps(state, props) {
22243
24087
  return {
22244
24088
  options: props.nestedField && state.aggregations[props.componentId] ? state.aggregations[props.componentId].reactivesearch_nested : state.aggregations[props.componentId],
22245
24089
  rawData: state.rawData[props.componentId],
@@ -22251,13 +24095,13 @@
22251
24095
  componentProps: state.props[props.componentId]
22252
24096
  };
22253
24097
  };
22254
- var mapDispatchtoProps$5 = {
22255
- setQueryOptions: setQueryOptions$4,
24098
+ var mapDispatchtoProps$6 = {
24099
+ setQueryOptions: setQueryOptions$5,
22256
24100
  updateQuery: updateQuery$5,
22257
24101
  setCustomQuery: setCustomQuery$4,
22258
24102
  setDefaultQuery: setDefaultQuery$5
22259
24103
  };
22260
- var ListConnected$3 = PreferencesConsumer(ComponentWrapper$1(connect(mapStateToProps$7, mapDispatchtoProps$5)(MultiDropdownList), {
24104
+ var ListConnected$3 = PreferencesConsumer(ComponentWrapper$1(connect(mapStateToProps$8, mapDispatchtoProps$6)(MultiDropdownList), {
22261
24105
  componentType: constants_1$1.multiDropdownList,
22262
24106
  internalComponent: MultiDropdownList.hasInternalComponent()
22263
24107
  }));
@@ -22273,7 +24117,7 @@
22273
24117
  };
22274
24118
 
22275
24119
  var updateQuery$6 = lib_5.updateQuery,
22276
- setQueryOptions$5 = lib_5.setQueryOptions,
24120
+ setQueryOptions$6 = lib_5.setQueryOptions,
22277
24121
  setCustomQuery$5 = lib_5.setCustomQuery;
22278
24122
  var isEqual$9 = lib_8.isEqual,
22279
24123
  checkValueChange$5 = lib_8.checkValueChange,
@@ -22436,123 +24280,410 @@
22436
24280
  componentType: constants_1$1.toggleButton
22437
24281
  });
22438
24282
  },
22439
- handleClick: function handleClick(item) {
22440
- var _this$$props = this.$props,
22441
- enableStrictSelection = _this$$props.enableStrictSelection,
22442
- multiSelect = _this$$props.multiSelect;
22443
- if (enableStrictSelection && !multiSelect && this.$data.currentValue.find(function (stateItem) {
22444
- return isEqual$9(item, stateItem);
22445
- })) {
22446
- return false;
24283
+ handleClick: function handleClick(item) {
24284
+ var _this$$props = this.$props,
24285
+ enableStrictSelection = _this$$props.enableStrictSelection,
24286
+ multiSelect = _this$$props.multiSelect;
24287
+ if (enableStrictSelection && !multiSelect && this.$data.currentValue.find(function (stateItem) {
24288
+ return isEqual$9(item, stateItem);
24289
+ })) {
24290
+ return false;
24291
+ }
24292
+ var value = this.$props.value;
24293
+ if (value === undefined) {
24294
+ this.handleToggle(item);
24295
+ } else {
24296
+ this.$emit('change', item.value);
24297
+ }
24298
+ return true;
24299
+ },
24300
+ renderButton: function renderButton(item) {
24301
+ var _this2 = this;
24302
+ var renderItem = this.$slots.renderItem || this.renderItem;
24303
+ var isSelected = this.$data.currentValue.some(function (value) {
24304
+ return value.value === item.value;
24305
+ });
24306
+ return renderItem ? renderItem({
24307
+ item: item,
24308
+ isSelected: isSelected,
24309
+ handleClick: function handleClick() {
24310
+ return _this2.handleClick(item);
24311
+ }
24312
+ }) : vue.createVNode(Button, {
24313
+ "class": getClassName$9(this.$props.innerClass, 'button') + " " + (isSelected ? 'active' : ''),
24314
+ "onClick": function onClick() {
24315
+ return _this2.handleClick(item);
24316
+ },
24317
+ "key": item.value,
24318
+ "primary": isSelected,
24319
+ "large": true,
24320
+ "tabIndex": isSelected ? '-1' : '0',
24321
+ "onKeypress": function onKeypress(e) {
24322
+ return handleA11yAction$1(e, function () {
24323
+ return _this2.handleClick(item);
24324
+ });
24325
+ }
24326
+ }, {
24327
+ "default": function _default() {
24328
+ return [item.label];
24329
+ }
24330
+ });
24331
+ }
24332
+ },
24333
+ render: function render() {
24334
+ var _this3 = this;
24335
+ return vue.createVNode(Container, {
24336
+ "class": toggleButtons
24337
+ }, {
24338
+ "default": function _default() {
24339
+ return [_this3.$props.title && vue.createVNode(Title, {
24340
+ "class": getClassName$9(_this3.$props.innerClass, 'title')
24341
+ }, {
24342
+ "default": function _default() {
24343
+ return [_this3.$props.title];
24344
+ }
24345
+ }), _this3.$props.data.map(function (item) {
24346
+ return _this3.renderButton(item);
24347
+ })];
24348
+ }
24349
+ });
24350
+ }
24351
+ };
24352
+ ToggleButton.parseValue = function (value, props) {
24353
+ if (Array.isArray(value)) {
24354
+ if (typeof value[0] === 'string') {
24355
+ return props.data.filter(function (item) {
24356
+ return value.includes(item.value);
24357
+ });
24358
+ }
24359
+ return value;
24360
+ }
24361
+ return props.data.filter(function (item) {
24362
+ return item.value === value;
24363
+ });
24364
+ };
24365
+ ToggleButton.defaultQuery = function (value, props) {
24366
+ return {
24367
+ query: {
24368
+ queryFormat: props.queryFormat,
24369
+ dataField: props.dataField,
24370
+ value: value,
24371
+ nestedField: props.nestedField,
24372
+ selectAllLabel: props.selectAllLabel,
24373
+ showMissing: props.showMissing,
24374
+ multiSelect: props.multiSelect
24375
+ }
24376
+ };
24377
+ };
24378
+ var mapStateToProps$9 = function mapStateToProps(state, props) {
24379
+ return {
24380
+ selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || null,
24381
+ componentProps: state.props[props.componentId]
24382
+ };
24383
+ };
24384
+ var mapDispatchtoProps$7 = {
24385
+ updateQueryHandler: updateQuery$6,
24386
+ setQueryOptions: setQueryOptions$6,
24387
+ setCustomQuery: setCustomQuery$5
24388
+ };
24389
+ var TBConnected = PreferencesConsumer(ComponentWrapper$1(connect(mapStateToProps$9, mapDispatchtoProps$7)(ToggleButton), {
24390
+ componentType: constants_1$1.toggleButton
24391
+ }));
24392
+ TBConnected.parseValue = ToggleButton.parseValue;
24393
+ TBConnected.defaultQuery = ToggleButton.defaultQuery;
24394
+ TBConnected.name = ToggleButton.name;
24395
+ TBConnected.install = function (Vue) {
24396
+ Vue.component(TBConnected.name, TBConnected);
24397
+ };
24398
+ // Add componentType for SSR
24399
+ TBConnected.componentType = constants_1$1.toggleButton;
24400
+
24401
+ var _excluded$1 = ["options"];
24402
+ var updateQuery$7 = lib_5.updateQuery,
24403
+ setQueryOptions$7 = lib_5.setQueryOptions,
24404
+ setCustomQuery$6 = lib_5.setCustomQuery,
24405
+ setDefaultQuery$6 = lib_5.setDefaultQuery;
24406
+ var parseHits$1 = lib_8.parseHits,
24407
+ isEqual$a = lib_8.isEqual,
24408
+ getCompositeAggsQuery$4 = lib_8.getCompositeAggsQuery,
24409
+ getResultStats$2 = lib_8.getResultStats,
24410
+ extractQueryFromCustomQuery$5 = lib_8.extractQueryFromCustomQuery,
24411
+ getOptionsForCustomQuery$5 = lib_8.getOptionsForCustomQuery;
24412
+ var ReactiveComponent = {
24413
+ name: 'ReactiveComponent',
24414
+ props: {
24415
+ componentId: types.stringRequired,
24416
+ aggregationField: types.string,
24417
+ aggregationSize: Q.number,
24418
+ size: Q.number,
24419
+ defaultQuery: types.func,
24420
+ customQuery: types.func,
24421
+ filterLabel: types.string,
24422
+ react: types.react,
24423
+ showFilter: Q.bool.def(true),
24424
+ URLParams: Q.bool.def(false),
24425
+ distinctField: types.string,
24426
+ distinctFieldConfig: types.props,
24427
+ index: Q.string,
24428
+ endpoint: types.endpointConfig
24429
+ },
24430
+ created: function created() {
24431
+ var _this = this;
24432
+ var props = this.$props;
24433
+ this.internalComponent = null;
24434
+ this.$defaultQuery = null;
24435
+ // Set custom query in store
24436
+ updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.selectedValue);
24437
+ var customQuery = props.customQuery,
24438
+ componentId = props.componentId,
24439
+ filterLabel = props.filterLabel,
24440
+ showFilter = props.showFilter,
24441
+ URLParams = props.URLParams;
24442
+ if (customQuery) {
24443
+ var calcCustomQuery = customQuery(this.selectedValue, props);
24444
+ var query = extractQueryFromCustomQuery$5(calcCustomQuery);
24445
+ var customQueryOptions = calcCustomQuery ? getOptionsForCustomQuery$5(calcCustomQuery) : null;
24446
+ if (customQueryOptions) {
24447
+ this.setQueryOptions(componentId, _extends({}, customQueryOptions, this.getAggsQuery()), false);
24448
+ } else this.setQueryOptions(componentId, this.getAggsQuery(), false);
24449
+ this.updateQuery({
24450
+ componentId: componentId,
24451
+ query: query,
24452
+ value: this.selectedValue || null,
24453
+ label: filterLabel,
24454
+ showFilter: showFilter,
24455
+ URLParams: URLParams
24456
+ });
24457
+ }
24458
+ this.setQuery = function (_ref) {
24459
+ var options = _ref.options,
24460
+ obj = _objectWithoutPropertiesLoose(_ref, _excluded$1);
24461
+ var queryToBeSet = obj.query;
24462
+
24463
+ // when enableAppbase is true, Backend throws error because of repeated query in request body
24464
+ if (queryToBeSet && queryToBeSet.query) {
24465
+ queryToBeSet = queryToBeSet.query;
24466
+ }
24467
+ var customQueryCalc = _extends({}, options, {
24468
+ query: queryToBeSet
24469
+ });
24470
+ var rsAPIQuery = customQueryCalc;
24471
+ // handle stored queries
24472
+ if (queryToBeSet && queryToBeSet.id) {
24473
+ rsAPIQuery = queryToBeSet;
24474
+ }
24475
+ // Update customQuery field for RS API
24476
+ _this.setCustomQuery(props.componentId, rsAPIQuery);
24477
+ if (options) {
24478
+ _this.setQueryOptions(props.componentId, _extends({}, _this.getAggsQuery(), options), false);
24479
+ }
24480
+ _this.updateQuery(_extends({}, obj, {
24481
+ query: customQueryCalc.query,
24482
+ componentId: props.componentId,
24483
+ label: props.filterLabel,
24484
+ showFilter: props.showFilter,
24485
+ URLParams: props.URLParams
24486
+ }));
24487
+ };
24488
+ if (props.defaultQuery) {
24489
+ this.internalComponent = props.componentId + "__internal";
24490
+ }
24491
+ if (this.internalComponent && this.$props.defaultQuery) {
24492
+ updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.selectedValue);
24493
+ this.$defaultQuery = this.$props.defaultQuery(this.selectedValue, this.$props);
24494
+ var _query = extractQueryFromCustomQuery$5(this.$defaultQuery);
24495
+ var queryOptions = getOptionsForCustomQuery$5(this.$defaultQuery);
24496
+ if (queryOptions) {
24497
+ this.setQueryOptions(this.internalComponent, _extends({}, queryOptions, this.getAggsQuery()), false);
24498
+ } else this.setQueryOptions(this.internalComponent, this.getAggsQuery(), false);
24499
+ this.updateQuery({
24500
+ componentId: this.internalComponent,
24501
+ query: _query
24502
+ });
24503
+ }
24504
+ },
24505
+ watch: {
24506
+ hits: function hits(newVal, oldVal) {
24507
+ if (!isEqual$a(newVal, oldVal)) {
24508
+ this.$emit('data', this.getData());
24509
+ }
24510
+ },
24511
+ rawData: function rawData(newVal, oldVal) {
24512
+ if (!isEqual$a(newVal, oldVal)) {
24513
+ this.$emit('data', this.getData());
24514
+ }
24515
+ },
24516
+ aggregations: function aggregations(newVal, oldVal) {
24517
+ if (!isEqual$a(newVal, oldVal)) {
24518
+ this.$emit('data', this.getData());
24519
+ }
24520
+ },
24521
+ aggregationData: function aggregationData(newVal, oldVal) {
24522
+ if (!isEqual$a(newVal, oldVal)) {
24523
+ this.$emit('data', this.getData());
24524
+ }
24525
+ },
24526
+ promotedResults: function promotedResults(newVal, oldVal) {
24527
+ if (!isEqual$a(newVal, oldVal)) {
24528
+ this.$emit('data', this.getData());
24529
+ }
24530
+ },
24531
+ hidden: function hidden(newVal, oldVal) {
24532
+ if (!isEqual$a(newVal, oldVal)) {
24533
+ this.$emit('data', this.getData());
24534
+ }
24535
+ },
24536
+ total: function total(newVal, oldVal) {
24537
+ if (!isEqual$a(newVal, oldVal)) {
24538
+ this.$emit('data', this.getData());
24539
+ }
24540
+ },
24541
+ time: function time(newVal, oldVal) {
24542
+ if (!isEqual$a(newVal, oldVal)) {
24543
+ this.$emit('data', this.getData());
22447
24544
  }
22448
- var value = this.$props.value;
22449
- if (value === undefined) {
22450
- this.handleToggle(item);
22451
- } else {
22452
- this.$emit('change', item.value);
24545
+ },
24546
+ defaultQuery: function defaultQuery(newVal, oldVal) {
24547
+ if (newVal && !isQueryIdentical(newVal, oldVal, this.selectedValue, this.$props)) {
24548
+ this.$defaultQuery = newVal(this.selectedValue, this.$props);
24549
+ var query = extractQueryFromCustomQuery$5(this.$defaultQuery);
24550
+ var queryOptions = getOptionsForCustomQuery$5(this.$defaultQuery);
24551
+ if (queryOptions) {
24552
+ this.setQueryOptions(this.internalComponent, _extends({}, queryOptions, this.getAggsQuery()), false);
24553
+ } else this.setQueryOptions(this.internalComponent, this.getAggsQuery(), false);
24554
+ // Update default query for RS API
24555
+ updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.selectedValue);
24556
+ this.updateQuery({
24557
+ componentId: this.internalComponent,
24558
+ query: query
24559
+ });
22453
24560
  }
22454
- return true;
22455
24561
  },
22456
- renderButton: function renderButton(item) {
22457
- var _this2 = this;
22458
- var renderItem = this.$slots.renderItem || this.renderItem;
22459
- var isSelected = this.$data.currentValue.some(function (value) {
22460
- return value.value === item.value;
24562
+ customQuery: function customQuery(newVal, oldVal) {
24563
+ if (newVal && !isQueryIdentical(newVal, oldVal, this.selectedValue, this.$props)) {
24564
+ var componentId = this.$props.componentId;
24565
+ this.$customQuery = newVal(this.selectedValue, this.$props);
24566
+ var query = extractQueryFromCustomQuery$5(this.$customQuery);
24567
+ var queryOptions = getOptionsForCustomQuery$5(this.$customQuery);
24568
+ if (queryOptions) {
24569
+ this.setQueryOptions(componentId, _extends({}, queryOptions, this.getAggsQuery()), false);
24570
+ } else this.setQueryOptions(componentId, this.getAggsQuery(), false);
24571
+
24572
+ // Update custom query for RS API
24573
+ updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.selectedValue);
24574
+ this.updateQuery({
24575
+ componentId: componentId,
24576
+ query: query
24577
+ });
24578
+ }
24579
+ }
24580
+ },
24581
+ render: function render() {
24582
+ try {
24583
+ var dom = this.$slots["default"];
24584
+ var error = this.error,
24585
+ isLoading = this.isLoading,
24586
+ selectedValue = this.selectedValue;
24587
+ var propsToBePassed = _extends({
24588
+ error: error,
24589
+ loading: isLoading
24590
+ }, this.getData(), {
24591
+ value: selectedValue,
24592
+ setQuery: this.setQuery
22461
24593
  });
22462
- return renderItem ? renderItem({
22463
- item: item,
22464
- isSelected: isSelected,
22465
- handleClick: function handleClick() {
22466
- return _this2.handleClick(item);
22467
- }
22468
- }) : vue.createVNode(Button, {
22469
- "class": getClassName$9(this.$props.innerClass, 'button') + " " + (isSelected ? 'active' : ''),
22470
- "onClick": function onClick() {
22471
- return _this2.handleClick(item);
22472
- },
22473
- "key": item.value,
22474
- "primary": isSelected,
22475
- "large": true,
22476
- "tabIndex": isSelected ? '-1' : '0',
22477
- "onKeypress": function onKeypress(e) {
22478
- return handleA11yAction$1(e, function () {
22479
- return _this2.handleClick(item);
24594
+ return vue.createVNode("div", null, [dom(propsToBePassed)]);
24595
+ } catch (e) {
24596
+ return null;
24597
+ }
24598
+ },
24599
+ methods: {
24600
+ getAggsQuery: function getAggsQuery() {
24601
+ if (this.aggregationField) {
24602
+ return {
24603
+ aggs: getCompositeAggsQuery$4({
24604
+ props: this.$props,
24605
+ showTopHits: true,
24606
+ value: this.selectedValue
24607
+ }).aggs
24608
+ };
24609
+ }
24610
+ return {};
24611
+ },
24612
+ getData: function getData() {
24613
+ var hits = this.hits,
24614
+ aggregations = this.aggregations,
24615
+ aggregationData = this.aggregationData,
24616
+ promotedResults = this.promotedResults,
24617
+ rawData = this.rawData;
24618
+ var filteredResults = parseHits$1(hits);
24619
+ if (promotedResults.length) {
24620
+ var ids = promotedResults.map(function (item) {
24621
+ return item._id;
24622
+ }).filter(Boolean);
24623
+ if (ids) {
24624
+ filteredResults = filteredResults.filter(function (item) {
24625
+ return !ids.includes(item._id);
22480
24626
  });
22481
24627
  }
22482
- }, {
22483
- "default": function _default() {
22484
- return [item.label];
22485
- }
22486
- });
24628
+ filteredResults = [].concat(promotedResults, filteredResults);
24629
+ }
24630
+ return {
24631
+ data: filteredResults,
24632
+ aggregationData: aggregationData,
24633
+ rawData: rawData,
24634
+ aggregations: aggregations,
24635
+ promotedData: promotedResults,
24636
+ resultStats: this.stats
24637
+ };
22487
24638
  }
22488
24639
  },
22489
- render: function render() {
22490
- var _this3 = this;
22491
- return vue.createVNode(Container, {
22492
- "class": toggleButtons
22493
- }, {
22494
- "default": function _default() {
22495
- return [_this3.$props.title && vue.createVNode(Title, {
22496
- "class": getClassName$9(_this3.$props.innerClass, 'title')
22497
- }, {
22498
- "default": function _default() {
22499
- return [_this3.$props.title];
22500
- }
22501
- }), _this3.$props.data.map(function (item) {
22502
- return _this3.renderButton(item);
22503
- })];
22504
- }
22505
- });
22506
- }
22507
- };
22508
- ToggleButton.parseValue = function (value, props) {
22509
- if (Array.isArray(value)) {
22510
- if (typeof value[0] === 'string') {
22511
- return props.data.filter(function (item) {
22512
- return value.includes(item.value);
22513
- });
24640
+ computed: {
24641
+ stats: function stats() {
24642
+ return getResultStats$2(this);
22514
24643
  }
22515
- return value;
22516
24644
  }
22517
- return props.data.filter(function (item) {
22518
- return item.value === value;
22519
- });
22520
24645
  };
22521
- ToggleButton.defaultQuery = function (value, props) {
22522
- return {
22523
- query: {
22524
- queryFormat: props.queryFormat,
22525
- dataField: props.dataField,
22526
- value: value,
22527
- nestedField: props.nestedField,
22528
- selectAllLabel: props.selectAllLabel,
22529
- showMissing: props.showMissing,
22530
- multiSelect: props.multiSelect
22531
- }
22532
- };
24646
+ ReactiveComponent.hasInternalComponent = function (props) {
24647
+ return !!props.defaultQuery;
22533
24648
  };
22534
- var mapStateToProps$8 = function mapStateToProps(state, props) {
24649
+ var mapStateToProps$a = function mapStateToProps(state, props) {
22535
24650
  return {
24651
+ aggregations: state.aggregations[props.componentId] && state.aggregations[props.componentId] || null,
24652
+ aggregationData: state.compositeAggregations[props.componentId] || [],
24653
+ hits: state.hits[props.componentId] && state.hits[props.componentId].hits || [],
24654
+ rawData: state.rawData[props.componentId],
24655
+ error: state.error[props.componentId],
24656
+ isLoading: state.isLoading[props.componentId],
22536
24657
  selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || null,
24658
+ promotedResults: state.promotedResults[props.componentId] || [],
24659
+ time: state.hits[props.componentId] && state.hits[props.componentId].time || 0,
24660
+ total: state.hits[props.componentId] && state.hits[props.componentId].total,
24661
+ hidden: state.hits[props.componentId] && state.hits[props.componentId].hidden,
22537
24662
  componentProps: state.props[props.componentId]
22538
24663
  };
22539
24664
  };
22540
- var mapDispatchtoProps$6 = {
22541
- updateQueryHandler: updateQuery$6,
22542
- setQueryOptions: setQueryOptions$5,
22543
- setCustomQuery: setCustomQuery$5
22544
- };
22545
- var TBConnected = PreferencesConsumer(ComponentWrapper$1(connect(mapStateToProps$8, mapDispatchtoProps$6)(ToggleButton), {
22546
- componentType: constants_1$1.toggleButton
22547
- }));
22548
- TBConnected.parseValue = ToggleButton.parseValue;
22549
- TBConnected.defaultQuery = ToggleButton.defaultQuery;
22550
- TBConnected.name = ToggleButton.name;
22551
- TBConnected.install = function (Vue) {
22552
- Vue.component(TBConnected.name, TBConnected);
24665
+ var mapDispatchtoProps$8 = {
24666
+ setQueryOptions: setQueryOptions$7,
24667
+ updateQuery: updateQuery$7,
24668
+ setCustomQuery: setCustomQuery$6,
24669
+ setDefaultQuery: setDefaultQuery$6
22553
24670
  };
24671
+ var ConnectedComponent = ComponentWrapper$1(connect(mapStateToProps$a, mapDispatchtoProps$8)(ReactiveComponent), {
24672
+ componentType: constants_1$1.reactiveComponent
24673
+ });
24674
+ var RcConnected = PreferencesConsumer({
24675
+ name: 'RcConnected',
24676
+ render: function render() {
24677
+ return vue.h(ConnectedComponent, null, this.$slots);
24678
+ }
24679
+ });
24680
+ RcConnected.name = ReactiveComponent.name;
24681
+ RcConnected.hasInternalComponent = ReactiveComponent.hasInternalComponent;
22554
24682
  // Add componentType for SSR
22555
- TBConnected.componentType = constants_1$1.toggleButton;
24683
+ RcConnected.componentType = constants_1$1.reactiveComponent;
24684
+ RcConnected.install = function (Vue) {
24685
+ Vue.component(RcConnected.name, RcConnected);
24686
+ };
22556
24687
 
22557
24688
  // client only component
22558
24689
  // render the placeholder slot on SSR
@@ -22586,8 +24717,8 @@
22586
24717
  }
22587
24718
  });
22588
24719
 
22589
- var _templateObject$o;
22590
- var Slider = styled('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"])));
24720
+ var _templateObject$p;
24721
+ var Slider = styled('div')(_templateObject$p || (_templateObject$p = _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"])));
22591
24722
 
22592
24723
  var global$1 = typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {};
22593
24724
 
@@ -22620,18 +24751,18 @@
22620
24751
  var addComponent$1 = lib_5.addComponent,
22621
24752
  removeComponent$1 = lib_5.removeComponent,
22622
24753
  watchComponent$1 = lib_5.watchComponent,
22623
- updateQuery$7 = lib_5.updateQuery,
24754
+ updateQuery$8 = lib_5.updateQuery,
22624
24755
  setQueryListener$1 = lib_5.setQueryListener,
22625
- setQueryOptions$6 = lib_5.setQueryOptions,
24756
+ setQueryOptions$8 = lib_5.setQueryOptions,
22626
24757
  setComponentProps$1 = lib_5.setComponentProps,
22627
- setCustomQuery$6 = lib_5.setCustomQuery,
24758
+ setCustomQuery$7 = lib_5.setCustomQuery,
22628
24759
  updateComponentProps$2 = lib_5.updateComponentProps;
22629
24760
  var checkValueChange$6 = lib_8.checkValueChange,
22630
24761
  getClassName$a = lib_8.getClassName,
22631
- isEqual$a = lib_8.isEqual,
24762
+ isEqual$b = lib_8.isEqual,
22632
24763
  checkSomePropChange$1 = lib_8.checkSomePropChange,
22633
- extractQueryFromCustomQuery$5 = lib_8.extractQueryFromCustomQuery,
22634
- getOptionsForCustomQuery$5 = lib_8.getOptionsForCustomQuery;
24764
+ extractQueryFromCustomQuery$6 = lib_8.extractQueryFromCustomQuery,
24765
+ getOptionsForCustomQuery$6 = lib_8.getOptionsForCustomQuery;
22635
24766
  var DynamicRangeSlider = {
22636
24767
  name: 'DynamicRangeSlider',
22637
24768
  components: getComponents(),
@@ -22816,11 +24947,11 @@
22816
24947
  var query = DynamicRangeSlider.defaultQuery(value, this.$props);
22817
24948
  if (this.$props.customQuery) {
22818
24949
  var customQueryTobeSet = this.$props.customQuery(value, this.$props);
22819
- var queryTobeSet = extractQueryFromCustomQuery$5(customQueryTobeSet);
24950
+ var queryTobeSet = extractQueryFromCustomQuery$6(customQueryTobeSet);
22820
24951
  if (queryTobeSet) {
22821
24952
  query = queryTobeSet;
22822
24953
  }
22823
- var customQueryOptions = getOptionsForCustomQuery$5(customQueryTobeSet);
24954
+ var customQueryOptions = getOptionsForCustomQuery$6(customQueryTobeSet);
22824
24955
  updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, value);
22825
24956
  this.setQueryOptions(this.$props.componentId, customQueryOptions, false);
22826
24957
  }
@@ -22867,7 +24998,7 @@
22867
24998
  this.setReact();
22868
24999
  },
22869
25000
  selectedValue: function selectedValue(newValue) {
22870
- if (isEqual$a(newValue, this.currentValue)) return;
25001
+ if (isEqual$b(newValue, this.currentValue)) return;
22871
25002
  var value = newValue || {
22872
25003
  start: this.range.start,
22873
25004
  end: this.range.end
@@ -22876,7 +25007,7 @@
22876
25007
  this.handleChange(DynamicRangeSlider.parseValue(value, this.$props));
22877
25008
  },
22878
25009
  range: function range(newValue, oldValue) {
22879
- if (isEqual$a(newValue, oldValue) || !this.currentValue) return;
25010
+ if (isEqual$b(newValue, oldValue) || !this.currentValue) return;
22880
25011
  var _ref3 = this.currentValue || [],
22881
25012
  currentStart = _ref3[0],
22882
25013
  currentEnd = _ref3[1];
@@ -22893,7 +25024,7 @@
22893
25024
  }
22894
25025
  },
22895
25026
  value: function value(newVal, oldVal) {
22896
- if (!isEqual$a(newVal, oldVal)) {
25027
+ if (!isEqual$b(newVal, oldVal)) {
22897
25028
  this.handleChange(DynamicRangeSlider.parseValue(newVal, this.$props));
22898
25029
  }
22899
25030
  }
@@ -22966,7 +25097,7 @@
22966
25097
  DynamicRangeSlider.hasInternalComponent = function () {
22967
25098
  return true;
22968
25099
  };
22969
- var mapStateToProps$9 = function mapStateToProps(state, props) {
25100
+ var mapStateToProps$b = function mapStateToProps(state, props) {
22970
25101
  var componentId = state.aggregations[props.componentId];
22971
25102
  var internalRange = state.aggregations[props.componentId + "__range__internal"];
22972
25103
  var options = componentId && componentId[props.dataField];
@@ -22991,18 +25122,18 @@
22991
25122
  componentProps: state.props[props.componentId]
22992
25123
  };
22993
25124
  };
22994
- var mapDispatchtoProps$7 = {
25125
+ var mapDispatchtoProps$9 = {
22995
25126
  addComponent: addComponent$1,
22996
25127
  removeComponent: removeComponent$1,
22997
- updateQuery: updateQuery$7,
25128
+ updateQuery: updateQuery$8,
22998
25129
  watchComponent: watchComponent$1,
22999
25130
  setQueryListener: setQueryListener$1,
23000
- setQueryOptions: setQueryOptions$6,
25131
+ setQueryOptions: setQueryOptions$8,
23001
25132
  setComponentProps: setComponentProps$1,
23002
- setCustomQuery: setCustomQuery$6,
25133
+ setCustomQuery: setCustomQuery$7,
23003
25134
  updateComponentProps: updateComponentProps$2
23004
25135
  };
23005
- var RangeConnected = PreferencesConsumer(connect(mapStateToProps$9, mapDispatchtoProps$7)(DynamicRangeSlider));
25136
+ var RangeConnected = PreferencesConsumer(connect(mapStateToProps$b, mapDispatchtoProps$9)(DynamicRangeSlider));
23006
25137
  RangeConnected.defaultQuery = DynamicRangeSlider.defaultQuery;
23007
25138
  RangeConnected.parseValue = DynamicRangeSlider.parseValue;
23008
25139
  RangeConnected.hasInternalComponent = DynamicRangeSlider.hasInternalComponent;
@@ -23014,13 +25145,13 @@
23014
25145
  Vue.component(RangeConnected.name, RangeConnected);
23015
25146
  };
23016
25147
 
23017
- function _isSlot$8(s) {
25148
+ function _isSlot$a(s) {
23018
25149
  return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
23019
25150
  }
23020
- var updateQuery$8 = lib_5.updateQuery,
23021
- setQueryOptions$7 = lib_5.setQueryOptions,
23022
- setCustomQuery$7 = lib_5.setCustomQuery;
23023
- var isEqual$b = lib_8.isEqual,
25151
+ var updateQuery$9 = lib_5.updateQuery,
25152
+ setQueryOptions$9 = lib_5.setQueryOptions,
25153
+ setCustomQuery$8 = lib_5.setCustomQuery;
25154
+ var isEqual$c = lib_8.isEqual,
23024
25155
  checkValueChange$7 = lib_8.checkValueChange,
23025
25156
  getClassName$b = lib_8.getClassName,
23026
25157
  getOptionsFromQuery$1 = lib_8.getOptionsFromQuery;
@@ -23072,12 +25203,12 @@
23072
25203
  this.setValue(newVal);
23073
25204
  },
23074
25205
  value: function value(newVal, oldVal) {
23075
- if (!isEqual$b(newVal, oldVal)) {
25206
+ if (!isEqual$c(newVal, oldVal)) {
23076
25207
  this.setValue(newVal);
23077
25208
  }
23078
25209
  },
23079
25210
  selectedValue: function selectedValue(newVal) {
23080
- if (!isEqual$b(this.$data.currentValue, newVal)) {
25211
+ if (!isEqual$c(this.$data.currentValue, newVal)) {
23081
25212
  this.setValue(newVal);
23082
25213
  }
23083
25214
  },
@@ -23102,7 +25233,7 @@
23102
25233
  }
23103
25234
  }), vue.createVNode(UL, {
23104
25235
  "class": getClassName$b(_this.$props.innerClass, 'list')
23105
- }, _isSlot$8(_slot = _this.$props.data.map(function (item) {
25236
+ }, _isSlot$a(_slot = _this.$props.data.map(function (item) {
23106
25237
  var selected = !!_this.$data.currentValue && _this.$data.currentValue.label === item.label;
23107
25238
  return vue.createVNode("li", {
23108
25239
  "key": item.label,
@@ -23189,18 +25320,18 @@
23189
25320
  }
23190
25321
  };
23191
25322
  };
23192
- var mapStateToProps$a = function mapStateToProps(state, props) {
25323
+ var mapStateToProps$c = function mapStateToProps(state, props) {
23193
25324
  return {
23194
25325
  selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || null,
23195
25326
  componentProps: state.props[props.componentId]
23196
- };
23197
- };
23198
- var mapDispatchtoProps$8 = {
23199
- updateQuery: updateQuery$8,
23200
- setQueryOptions: setQueryOptions$7,
23201
- setCustomQuery: setCustomQuery$7
25327
+ };
25328
+ };
25329
+ var mapDispatchtoProps$a = {
25330
+ updateQuery: updateQuery$9,
25331
+ setQueryOptions: setQueryOptions$9,
25332
+ setCustomQuery: setCustomQuery$8
23202
25333
  };
23203
- var RangeConnected$1 = PreferencesConsumer(ComponentWrapper$1(connect(mapStateToProps$a, mapDispatchtoProps$8)(SingleRange), {
25334
+ var RangeConnected$1 = PreferencesConsumer(ComponentWrapper$1(connect(mapStateToProps$c, mapDispatchtoProps$a)(SingleRange), {
23204
25335
  componentType: constants_1$1.singleRange
23205
25336
  }));
23206
25337
  RangeConnected$1.name = SingleRange.name;
@@ -23213,13 +25344,13 @@
23213
25344
  // Add componentType for SSR
23214
25345
  RangeConnected$1.componentType = constants_1$1.singleRange;
23215
25346
 
23216
- function _isSlot$9(s) {
25347
+ function _isSlot$b(s) {
23217
25348
  return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
23218
25349
  }
23219
- var updateQuery$9 = lib_5.updateQuery,
23220
- setQueryOptions$8 = lib_5.setQueryOptions,
23221
- setCustomQuery$8 = lib_5.setCustomQuery;
23222
- var isEqual$c = lib_8.isEqual,
25350
+ var updateQuery$a = lib_5.updateQuery,
25351
+ setQueryOptions$a = lib_5.setQueryOptions,
25352
+ setCustomQuery$9 = lib_5.setCustomQuery;
25353
+ var isEqual$d = lib_8.isEqual,
23223
25354
  checkValueChange$8 = lib_8.checkValueChange,
23224
25355
  getClassName$c = lib_8.getClassName,
23225
25356
  getOptionsFromQuery$2 = lib_8.getOptionsFromQuery;
@@ -23345,12 +25476,12 @@
23345
25476
  this.selectItem(newVal, true, undefined, true);
23346
25477
  },
23347
25478
  value: function value(newVal, oldVal) {
23348
- if (!isEqual$c(newVal, oldVal)) {
25479
+ if (!isEqual$d(newVal, oldVal)) {
23349
25480
  this.selectItem(newVal, true, undefined, true);
23350
25481
  }
23351
25482
  },
23352
25483
  selectedValue: function selectedValue(newVal) {
23353
- if (!isEqual$c(this.$data.currentValue, newVal)) {
25484
+ if (!isEqual$d(this.$data.currentValue, newVal)) {
23354
25485
  var processSelectedValues = newVal ? newVal.map(function (item) {
23355
25486
  if (typeof item === 'object' && 'label' in item) {
23356
25487
  return item.label;
@@ -23390,278 +25521,42 @@
23390
25521
  "default": function _default() {
23391
25522
  return [_this2.$props.title];
23392
25523
  }
23393
- }), vue.createVNode(UL, {
23394
- "class": getClassName$c(_this2.$props.innerClass, 'list')
23395
- }, _isSlot$9(_slot = _this2.$props.data.map(function (item) {
23396
- var selected = !!_this2.$data.currentValue && _this2.$data.currentValue.label === item.label;
23397
- return vue.createVNode("li", {
23398
- "key": item.label,
23399
- "class": "" + (selected ? 'active' : '')
23400
- }, [vue.createVNode(Checkbox, vue.mergeProps(babelHelperVueTransformOn({
23401
- click: _this2.handleClick
23402
- }), {
23403
- "class": getClassName$c(_this2.$props.innerClass, 'checkbox'),
23404
- "id": _this2.$props.componentId + "-" + item.label,
23405
- "name": _this2.$props.componentId,
23406
- "value": item.label,
23407
- "type": "Checkbox",
23408
- "show": _this2.$props.showCheckbox,
23409
- "checked": _this2.selectedValues[item.label]
23410
- }), null), vue.createVNode("label", {
23411
- "class": getClassName$c(_this2.$props.innerClass, 'label'),
23412
- "for": _this2.$props.componentId + "-" + item.label
23413
- }, [item.label])]);
23414
- })) ? _slot : {
23415
- "default": function _default() {
23416
- return [_slot];
23417
- }
23418
- })];
23419
- }
23420
- });
23421
- }
23422
- };
23423
- MultiRange.parseValue = function (value, props) {
23424
- return value ? props.data.filter(function (item) {
23425
- return value.includes(item.label);
23426
- }) : null;
23427
- };
23428
- MultiRange.defaultQuery = function (value, props) {
23429
- return {
23430
- query: {
23431
- queryFormat: props.queryFormat,
23432
- dataField: props.dataField,
23433
- value: value,
23434
- showMissing: props.showMissing
23435
- }
23436
- };
23437
- };
23438
- var mapStateToProps$b = function mapStateToProps(state, props) {
23439
- return {
23440
- selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || null,
23441
- componentProps: state.props[props.componentId]
23442
- };
23443
- };
23444
- var mapDispatchtoProps$9 = {
23445
- updateQuery: updateQuery$9,
23446
- setQueryOptions: setQueryOptions$8,
23447
- setCustomQuery: setCustomQuery$8
23448
- };
23449
- var RangeConnected$2 = PreferencesConsumer(ComponentWrapper$1(connect(mapStateToProps$b, mapDispatchtoProps$9)(MultiRange), {
23450
- componentType: constants_1$1.multiRange
23451
- }));
23452
- RangeConnected$2.name = MultiRange.name;
23453
- RangeConnected$2.defaultQuery = MultiRange.defaultQuery;
23454
- RangeConnected$2.parseValue = MultiRange.parseValue;
23455
- RangeConnected$2.hasInternalComponent = MultiRange.hasInternalComponent;
23456
- RangeConnected$2.install = function (Vue) {
23457
- Vue.component(RangeConnected$2.name, RangeConnected$2);
23458
- };
23459
- // Add componentType for SSR
23460
- RangeConnected$2.componentType = constants_1$1.multiRange;
23461
-
23462
- var updateQuery$a = lib_5.updateQuery,
23463
- setQueryOptions$9 = lib_5.setQueryOptions,
23464
- setCustomQuery$9 = lib_5.setCustomQuery;
23465
- var checkValueChange$9 = lib_8.checkValueChange,
23466
- getClassName$d = lib_8.getClassName,
23467
- getOptionsFromQuery$3 = lib_8.getOptionsFromQuery,
23468
- isEqual$d = lib_8.isEqual;
23469
- var RangeSlider = {
23470
- name: 'RangeSlider',
23471
- components: getComponents(),
23472
- inject: {
23473
- theme: {
23474
- from: 'theme_reactivesearch'
23475
- }
23476
- },
23477
- data: function data() {
23478
- var state = {
23479
- currentValue: this.$props.range ? [this.$props.range.start, this.$props.range.end] : [],
23480
- stats: []
23481
- };
23482
- return state;
23483
- },
23484
- props: {
23485
- beforeValueChange: types.func,
23486
- className: Q.string.def(''),
23487
- range: Q.shape({
23488
- start: Q.integer.def(0),
23489
- end: Q.integer.def(10)
23490
- }),
23491
- rangeLabels: types.rangeLabels,
23492
- componentId: types.stringRequired,
23493
- customQuery: types.func,
23494
- data: types.data,
23495
- dataField: types.stringRequired,
23496
- defaultValue: types.range,
23497
- value: types.range,
23498
- filterLabel: types.string,
23499
- innerClass: types.style,
23500
- react: types.react,
23501
- showFilter: Q.bool.def(true),
23502
- showCheckbox: Q.bool.def(true),
23503
- title: types.title,
23504
- URLParams: Q.bool.def(false),
23505
- sliderOptions: Q.object.def({}),
23506
- nestedField: types.string,
23507
- index: Q.string,
23508
- endpoint: types.endpointConfig
23509
- },
23510
- methods: {
23511
- handleSliderChange: function handleSliderChange(values) {
23512
- var value = this.$props.value;
23513
- if (value === undefined) {
23514
- this.handleChange(values);
23515
- } else {
23516
- this.$emit('change', {
23517
- start: values[0],
23518
- end: values[1]
23519
- });
23520
- }
23521
- },
23522
- handleSlider: function handleSlider() {
23523
- var sliderValues = this.$refs.slider.getValue();
23524
- this.handleSliderChange(sliderValues);
23525
- },
23526
- handleChange: function handleChange(currentValue, props) {
23527
- var _this = this;
23528
- if (props === void 0) {
23529
- props = this.$props;
23530
- }
23531
- var performUpdate = function performUpdate() {
23532
- _this.currentValue = currentValue;
23533
- _this.updateQueryHandler([currentValue[0], currentValue[1]], props);
23534
- _this.$emit('valueChange', {
23535
- start: currentValue[0],
23536
- end: currentValue[1]
23537
- });
23538
- _this.$emit('value-change', {
23539
- start: currentValue[0],
23540
- end: currentValue[1]
23541
- });
23542
- };
23543
- checkValueChange$9(props.componentId, {
23544
- start: currentValue[0],
23545
- end: currentValue[1]
23546
- }, props.beforeValueChange, performUpdate);
23547
- },
23548
- updateQueryHandler: function updateQueryHandler(value, props) {
23549
- var customQuery = props.customQuery;
23550
- var query = RangeSlider.defaultQuery(value, props);
23551
- if (customQuery) {
23552
- var _ref = customQuery(value, props) || {};
23553
- query = _ref.query;
23554
- var customQueryOptions = getOptionsFromQuery$3(customQuery(value, props));
23555
- updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.currentValue);
23556
- this.setQueryOptions(props.componentId, customQueryOptions, false);
23557
- }
23558
- var showFilter = props.showFilter,
23559
- _props$range = props.range,
23560
- start = _props$range.start,
23561
- end = _props$range.end;
23562
- var currentStart = value[0],
23563
- currentEnd = value[1];
23564
- // check if the slider is at its initial position
23565
- var isInitialValue = currentStart === start && currentEnd === end;
23566
- this.updateQuery({
23567
- componentId: props.componentId,
23568
- query: query,
23569
- value: value,
23570
- label: props.filterLabel,
23571
- showFilter: showFilter && !isInitialValue,
23572
- URLParams: props.URLParams,
23573
- componentType: constants_1$1.rangeSlider
23574
- });
23575
- }
23576
- },
23577
- watch: {
23578
- defaultValue: function defaultValue(newVal) {
23579
- this.handleChange(RangeSlider.parseValue(newVal, this.$props));
23580
- },
23581
- value: function value(newVal, oldVal) {
23582
- if (!isEqual$d(newVal, oldVal)) {
23583
- this.handleChange(RangeSlider.parseValue(newVal, this.$props));
23584
- }
23585
- },
23586
- selectedValue: function selectedValue(newVal) {
23587
- if (!isEqual$d(this.$data.currentValue, newVal)) {
23588
- this.handleChange(RangeSlider.parseValue(newVal, this.$props));
23589
- this.$emit('change', newVal);
23590
- }
23591
- },
23592
- customQuery: function customQuery(newVal, oldVal) {
23593
- if (!isQueryIdentical(newVal, oldVal, this.$data.currentValue, this.$props)) {
23594
- this.updateQueryHandler(this.$data.currentValue, this.$props);
23595
- }
23596
- }
23597
- },
23598
- created: function created() {
23599
- if (!this.$props.range) {
23600
- console.error('%crange is not defined. Read more about this at https://opensource.appbase.io/reactive-manual/vue/range-components/rangeslider.html#props', 'font-size: 12.5px;');
23601
- }
23602
-
23603
- // Set custom query in store
23604
- updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.currentValue);
23605
- var _this$$props = this.$props,
23606
- value = _this$$props.value,
23607
- defaultValue = _this$$props.defaultValue;
23608
- var selectedValue = this.selectedValue;
23609
- if (this.$props.range) {
23610
- if (Array.isArray(selectedValue)) {
23611
- this.handleChange(selectedValue);
23612
- } else if (selectedValue) {
23613
- this.handleChange(RangeSlider.parseValue(selectedValue, this.$props));
23614
- } else if (value) {
23615
- this.handleChange(RangeSlider.parseValue(value, this.$props));
23616
- } else if (defaultValue) {
23617
- this.handleChange(RangeSlider.parseValue(defaultValue, this.$props));
23618
- }
23619
- }
23620
- },
23621
- render: function render() {
23622
- var _this2 = this;
23623
- return vue.createVNode(Container, {
23624
- "class": this.$props.className
23625
- }, {
23626
- "default": function _default() {
23627
- return [_this2.$props.title && vue.createVNode(Title, {
23628
- "class": getClassName$d(_this2.$props.innerClass, 'title')
23629
- }, {
23630
- "default": function _default() {
23631
- return [_this2.$props.title];
23632
- }
23633
- }), _this2.$props.range ? vue.createVNode(NoSSR, null, {
25524
+ }), vue.createVNode(UL, {
25525
+ "class": getClassName$c(_this2.$props.innerClass, 'list')
25526
+ }, _isSlot$b(_slot = _this2.$props.data.map(function (item) {
25527
+ var selected = !!_this2.$data.currentValue && _this2.$data.currentValue.label === item.label;
25528
+ return vue.createVNode("li", {
25529
+ "key": item.label,
25530
+ "class": "" + (selected ? 'active' : '')
25531
+ }, [vue.createVNode(Checkbox, vue.mergeProps(babelHelperVueTransformOn({
25532
+ click: _this2.handleClick
25533
+ }), {
25534
+ "class": getClassName$c(_this2.$props.innerClass, 'checkbox'),
25535
+ "id": _this2.$props.componentId + "-" + item.label,
25536
+ "name": _this2.$props.componentId,
25537
+ "value": item.label,
25538
+ "type": "Checkbox",
25539
+ "show": _this2.$props.showCheckbox,
25540
+ "checked": _this2.selectedValues[item.label]
25541
+ }), null), vue.createVNode("label", {
25542
+ "class": getClassName$c(_this2.$props.innerClass, 'label'),
25543
+ "for": _this2.$props.componentId + "-" + item.label
25544
+ }, [item.label])]);
25545
+ })) ? _slot : {
23634
25546
  "default": function _default() {
23635
- return [vue.createVNode(Slider, {
23636
- "class": getClassName$d(_this2.$props.innerClass, 'slider')
23637
- }, {
23638
- "default": function _default() {
23639
- return [vue.createVNode(vue.resolveComponent("vue-slider-component"), vue.mergeProps({
23640
- "ref": "slider",
23641
- "modelValue": _this2.currentValue,
23642
- "min": _this2.$props.range.start,
23643
- "max": _this2.$props.range.end,
23644
- "dotSize": 20,
23645
- "height": 4,
23646
- "enable-cross": false,
23647
- "onDrag-end": _this2.handleSlider,
23648
- "tooltip": "always"
23649
- }, _this2.$props.sliderOptions), null), _this2.$props.rangeLabels && vue.createVNode("div", {
23650
- "class": "label-container"
23651
- }, [vue.createVNode("label", {
23652
- "class": getClassName$d(_this2.$props.innerClass, 'label') || 'range-label-left'
23653
- }, [_this2.$props.rangeLabels.start]), vue.createVNode("label", {
23654
- "class": getClassName$d(_this2.$props.innerClass, 'label') || 'range-label-right'
23655
- }, [_this2.$props.rangeLabels.end])])];
23656
- }
23657
- })];
25547
+ return [_slot];
23658
25548
  }
23659
- }) : null];
25549
+ })];
23660
25550
  }
23661
25551
  });
23662
25552
  }
23663
25553
  };
23664
- RangeSlider.defaultQuery = function (value, props) {
25554
+ MultiRange.parseValue = function (value, props) {
25555
+ return value ? props.data.filter(function (item) {
25556
+ return value.includes(item.label);
25557
+ }) : null;
25558
+ };
25559
+ MultiRange.defaultQuery = function (value, props) {
23665
25560
  return {
23666
25561
  query: {
23667
25562
  queryFormat: props.queryFormat,
@@ -23671,58 +25566,40 @@
23671
25566
  }
23672
25567
  };
23673
25568
  };
23674
- RangeSlider.parseValue = function (value, props) {
23675
- if (value) {
23676
- return Array.isArray(value) ? value : [value.start, value.end];
23677
- }
23678
- if (props.range) {
23679
- return [props.range.start, props.range.end];
23680
- }
23681
- return [];
23682
- };
23683
- var mapStateToProps$c = function mapStateToProps(state, props) {
25569
+ var mapStateToProps$d = function mapStateToProps(state, props) {
23684
25570
  return {
23685
- options: state.aggregations[props.componentId] ? state.aggregations[props.componentId][props.dataField] && state.aggregations[props.componentId][props.dataField].buckets // eslint-disable-line
23686
- : [],
23687
- selectedValue: state.selectedValues[props.componentId] ? state.selectedValues[props.componentId].value : null,
25571
+ selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || null,
23688
25572
  componentProps: state.props[props.componentId]
23689
25573
  };
23690
25574
  };
23691
- var mapDispatchtoProps$a = {
25575
+ var mapDispatchtoProps$b = {
23692
25576
  updateQuery: updateQuery$a,
23693
- setQueryOptions: setQueryOptions$9,
25577
+ setQueryOptions: setQueryOptions$a,
23694
25578
  setCustomQuery: setCustomQuery$9
23695
25579
  };
23696
- var RangeConnected$3 = PreferencesConsumer(ComponentWrapper$1(connect(mapStateToProps$c, mapDispatchtoProps$a)(RangeSlider), {
23697
- componentType: constants_1$1.rangeSlider
25580
+ var RangeConnected$2 = PreferencesConsumer(ComponentWrapper$1(connect(mapStateToProps$d, mapDispatchtoProps$b)(MultiRange), {
25581
+ componentType: constants_1$1.multiRange
23698
25582
  }));
23699
- RangeConnected$3.name = RangeSlider.name;
23700
- RangeConnected$3.defaultQuery = RangeSlider.defaultQuery;
23701
- RangeConnected$3.parseValue = RangeSlider.parseValue;
23702
- RangeConnected$3.hasInternalComponent = RangeSlider.hasInternalComponent;
23703
- RangeConnected$3.install = function (Vue) {
23704
- Vue.component(RangeConnected$3.name, RangeConnected$3);
25583
+ RangeConnected$2.name = MultiRange.name;
25584
+ RangeConnected$2.defaultQuery = MultiRange.defaultQuery;
25585
+ RangeConnected$2.parseValue = MultiRange.parseValue;
25586
+ RangeConnected$2.hasInternalComponent = MultiRange.hasInternalComponent;
25587
+ RangeConnected$2.install = function (Vue) {
25588
+ Vue.component(RangeConnected$2.name, RangeConnected$2);
23705
25589
  };
23706
-
23707
25590
  // Add componentType for SSR
23708
- RangeConnected$3.componentType = constants_1$1.rangeSlider;
23709
-
23710
- var _templateObject$p;
23711
- var alert = function alert(_ref) {
23712
- var theme = _ref.theme;
23713
- return "\n\tcolor: " + theme.colors.alertColor + ";\n";
23714
- };
23715
- var Content = styled('div')(_templateObject$p || (_templateObject$p = _taggedTemplateLiteralLoose(["\n\t", ";\n\tfont-size: 13px;\n\tmargin: 8px;\n"])), function (props) {
23716
- return props.alert && alert;
23717
- });
25591
+ RangeConnected$2.componentType = constants_1$1.multiRange;
23718
25592
 
23719
- var getClassName$e = lib_8.getClassName,
25593
+ var updateQuery$b = lib_5.updateQuery,
25594
+ setQueryOptions$b = lib_5.setQueryOptions,
25595
+ setCustomQuery$a = lib_5.setCustomQuery;
25596
+ var checkValueChange$9 = lib_8.checkValueChange,
25597
+ getClassName$d = lib_8.getClassName,
25598
+ getOptionsFromQuery$3 = lib_8.getOptionsFromQuery,
23720
25599
  isEqual$e = lib_8.isEqual;
23721
- var RangeInput = {
23722
- name: 'RangeInput',
23723
- components: {
23724
- RangeSlider: RangeConnected$3
23725
- },
25600
+ var RangeSlider = {
25601
+ name: 'RangeSlider',
25602
+ components: getComponents(),
23726
25603
  inject: {
23727
25604
  theme: {
23728
25605
  from: 'theme_reactivesearch'
@@ -23730,43 +25607,27 @@
23730
25607
  },
23731
25608
  data: function data() {
23732
25609
  var state = {
23733
- currentValue: {
23734
- start: this.$props.range ? this.$props.range.start : 0,
23735
- end: this.$props.range ? this.$props.range.end : 10
23736
- },
23737
- isStartValid: true,
23738
- isEndValid: true
25610
+ currentValue: this.$props.range ? [this.$props.range.start, this.$props.range.end] : [],
25611
+ stats: []
23739
25612
  };
23740
25613
  return state;
23741
25614
  },
23742
25615
  props: {
23743
- className: {
23744
- types: types.string,
23745
- "default": ''
23746
- },
23747
- defaultValue: types.range,
23748
- validateRange: types.func,
23749
- value: types.range,
23750
- dataField: types.stringRequired,
23751
- innerClass: types.style,
23752
- range: {
23753
- types: types.range,
23754
- "default": function _default() {
23755
- return {
23756
- start: 0,
23757
- end: 10
23758
- };
23759
- }
23760
- },
25616
+ beforeValueChange: types.func,
25617
+ className: Q.string.def(''),
25618
+ range: Q.shape({
25619
+ start: Q.integer.def(0),
25620
+ end: Q.integer.def(10)
25621
+ }),
23761
25622
  rangeLabels: types.rangeLabels,
23762
- stepValue: types.number,
23763
- componentStyle: types.style,
23764
25623
  componentId: types.stringRequired,
23765
- includeNullValues: Q.bool,
23766
- beforeValueChange: types.func,
23767
25624
  customQuery: types.func,
23768
25625
  data: types.data,
25626
+ dataField: types.stringRequired,
25627
+ defaultValue: types.range,
25628
+ value: types.range,
23769
25629
  filterLabel: types.string,
25630
+ innerClass: types.style,
23770
25631
  react: types.react,
23771
25632
  showFilter: Q.bool.def(true),
23772
25633
  showCheckbox: Q.bool.def(true),
@@ -23774,524 +25635,521 @@
23774
25635
  URLParams: Q.bool.def(false),
23775
25636
  sliderOptions: Q.object.def({}),
23776
25637
  nestedField: types.string,
25638
+ index: Q.string,
23777
25639
  endpoint: types.endpointConfig
23778
25640
  },
23779
25641
  methods: {
23780
- shouldUpdate: function shouldUpdate(value) {
23781
- var validateRange = this.$props.validateRange;
23782
- if (validateRange && value) {
23783
- return validateRange([value.start, value.end]);
23784
- }
23785
- if (value) {
23786
- return value.start <= value.end;
25642
+ handleSliderChange: function handleSliderChange(values) {
25643
+ var value = this.$props.value;
25644
+ if (value === undefined) {
25645
+ this.handleChange(values);
25646
+ } else {
25647
+ this.$emit('change', {
25648
+ start: values[0],
25649
+ end: values[1]
25650
+ });
23787
25651
  }
23788
- return false;
23789
25652
  },
23790
- isControlled: function isControlled() {
23791
- if (this.$props.value && this.$attrs) {
23792
- return true;
23793
- }
23794
- return false;
25653
+ handleSlider: function handleSlider() {
25654
+ var sliderValues = this.$refs.slider.getValue();
25655
+ this.handleSliderChange(sliderValues);
23795
25656
  },
23796
- handleChange: function handleChange(value, event) {
23797
- var currentValue = value;
23798
- if (this.shouldUpdate(value) && !isEqual$e(value, this.currentValue)) {
23799
- switch (event) {
23800
- case 'change':
23801
- if (!value) {
23802
- currentValue = {
23803
- start: this.$props.range ? this.$props.range.start : 0,
23804
- end: this.$props.range ? this.$props.range.end : 10
23805
- };
23806
- }
23807
- this.currentValue = currentValue;
23808
- this.$emit('change', this.currentValue);
23809
- break;
23810
- case 'value-change':
23811
- this.$emit('valueChange', this.currentValue);
23812
- this.$emit('value-change', this.currentValue);
23813
- break;
23814
- default:
23815
- this.currentValue = _extends({}, currentValue);
23816
- break;
23817
- }
25657
+ handleChange: function handleChange(currentValue, props) {
25658
+ var _this = this;
25659
+ if (props === void 0) {
25660
+ props = this.$props;
23818
25661
  }
25662
+ var performUpdate = function performUpdate() {
25663
+ _this.currentValue = currentValue;
25664
+ _this.updateQueryHandler([currentValue[0], currentValue[1]], props);
25665
+ _this.$emit('valueChange', {
25666
+ start: currentValue[0],
25667
+ end: currentValue[1]
25668
+ });
25669
+ _this.$emit('value-change', {
25670
+ start: currentValue[0],
25671
+ end: currentValue[1]
25672
+ });
25673
+ };
25674
+ checkValueChange$9(props.componentId, {
25675
+ start: currentValue[0],
25676
+ end: currentValue[1]
25677
+ }, props.beforeValueChange, performUpdate);
23819
25678
  },
23820
- handleOnChange: function handleOnChange(value) {
23821
- this.handleChange(value || this.$props.range, 'change');
23822
- },
23823
- handleValueChange: function handleValueChange(value) {
23824
- this.handleChange(value, 'value-change');
23825
- },
23826
- handleInputChange: function handleInputChange(e) {
23827
- var _e$target = e.target,
23828
- name = _e$target.name,
23829
- value = _e$target.value;
23830
- if (Number.isNaN(value)) {
23831
- if (name === 'start') {
23832
- this.isStartValid = false;
23833
- } else {
23834
- this.isEndValid = false;
23835
- }
23836
- } else if (name === 'start' && !this.isStartValid) {
23837
- this.isStartValid = true;
23838
- } else if (name === 'end' && !this.isEndValid) {
23839
- this.isEndValid = true;
23840
- }
23841
- if (this.isStartValid && this.isEndValid) {
23842
- if (name === 'start') {
23843
- this.handleChange({
23844
- start: Number(value),
23845
- end: this.currentValue.end
23846
- }, 'change');
23847
- } else {
23848
- this.handleChange({
23849
- start: this.currentValue.start,
23850
- end: Number(value)
23851
- }, 'change');
23852
- }
25679
+ updateQueryHandler: function updateQueryHandler(value, props) {
25680
+ var customQuery = props.customQuery;
25681
+ var query = RangeSlider.defaultQuery(value, props);
25682
+ if (customQuery) {
25683
+ var _ref = customQuery(value, props) || {};
25684
+ query = _ref.query;
25685
+ var customQueryOptions = getOptionsFromQuery$3(customQuery(value, props));
25686
+ updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.currentValue);
25687
+ this.setQueryOptions(props.componentId, customQueryOptions, false);
23853
25688
  }
25689
+ var showFilter = props.showFilter,
25690
+ _props$range = props.range,
25691
+ start = _props$range.start,
25692
+ end = _props$range.end;
25693
+ var currentStart = value[0],
25694
+ currentEnd = value[1];
25695
+ // check if the slider is at its initial position
25696
+ var isInitialValue = currentStart === start && currentEnd === end;
25697
+ this.updateQuery({
25698
+ componentId: props.componentId,
25699
+ query: query,
25700
+ value: value,
25701
+ label: props.filterLabel,
25702
+ showFilter: showFilter && !isInitialValue,
25703
+ URLParams: props.URLParams,
25704
+ componentType: constants_1$1.rangeSlider
25705
+ });
23854
25706
  }
23855
25707
  },
23856
25708
  watch: {
23857
- defaultValue: function defaultValue(newVal, oldVal) {
23858
- if (oldVal.start !== newVal.start || oldVal.end !== newVal.end) {
23859
- this.handleChange(newVal);
23860
- }
25709
+ defaultValue: function defaultValue(newVal) {
25710
+ this.handleChange(RangeSlider.parseValue(newVal, this.$props));
23861
25711
  },
23862
25712
  value: function value(newVal, oldVal) {
23863
25713
  if (!isEqual$e(newVal, oldVal)) {
23864
- if (this.isControlled()) {
23865
- this.handleChange(newVal, 'change');
23866
- }
25714
+ this.handleChange(RangeSlider.parseValue(newVal, this.$props));
25715
+ }
25716
+ },
25717
+ selectedValue: function selectedValue(newVal) {
25718
+ if (!isEqual$e(this.$data.currentValue, newVal)) {
25719
+ this.handleChange(RangeSlider.parseValue(newVal, this.$props));
25720
+ this.$emit('change', newVal);
25721
+ }
25722
+ },
25723
+ customQuery: function customQuery(newVal, oldVal) {
25724
+ if (!isQueryIdentical(newVal, oldVal, this.$data.currentValue, this.$props)) {
25725
+ this.updateQueryHandler(this.$data.currentValue, this.$props);
23867
25726
  }
23868
25727
  }
23869
25728
  },
23870
25729
  created: function created() {
23871
- if (this.$props.defaultValue && this.$props.defaultValue.start && this.$props.defaultValue.end) {
23872
- this.handleChange(this.$props.defaultValue);
25730
+ if (!this.$props.range) {
25731
+ console.error('%crange is not defined. Read more about this at https://opensource.appbase.io/reactive-manual/vue/range-components/rangeslider.html#props', 'font-size: 12.5px;');
23873
25732
  }
23874
- if (this.isControlled()) {
23875
- this.handleChange(this.$props.value, 'change');
25733
+
25734
+ // Set custom query in store
25735
+ updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.currentValue);
25736
+ var _this$$props = this.$props,
25737
+ value = _this$$props.value,
25738
+ defaultValue = _this$$props.defaultValue;
25739
+ var selectedValue = this.selectedValue;
25740
+ if (this.$props.range) {
25741
+ if (Array.isArray(selectedValue)) {
25742
+ this.handleChange(selectedValue);
25743
+ } else if (selectedValue) {
25744
+ this.handleChange(RangeSlider.parseValue(selectedValue, this.$props));
25745
+ } else if (value) {
25746
+ this.handleChange(RangeSlider.parseValue(value, this.$props));
25747
+ } else if (defaultValue) {
25748
+ this.handleChange(RangeSlider.parseValue(defaultValue, this.$props));
25749
+ }
23876
25750
  }
23877
25751
  },
23878
25752
  render: function render() {
23879
- var _this = this;
23880
- var _this$$props = this.$props,
23881
- className = _this$$props.className,
23882
- dataField = _this$$props.dataField,
23883
- range = _this$$props.range,
23884
- rangeLabels = _this$$props.rangeLabels,
23885
- componentId = _this$$props.componentId,
23886
- innerClass = _this$$props.innerClass,
23887
- stepValue = _this$$props.stepValue,
23888
- componentStyle = _this$$props.componentStyle,
23889
- themePreset = _this$$props.themePreset,
23890
- includeNullValues = _this$$props.includeNullValues,
23891
- beforeValueChange = _this$$props.beforeValueChange,
23892
- customQuery = _this$$props.customQuery,
23893
- data = _this$$props.data,
23894
- filterLabel = _this$$props.filterLabel,
23895
- react = _this$$props.react,
23896
- showFilter = _this$$props.showFilter,
23897
- showCheckbox = _this$$props.showCheckbox,
23898
- title = _this$$props.title,
23899
- URLParams = _this$$props.URLParams,
23900
- sliderOptions = _this$$props.sliderOptions,
23901
- nestedField = _this$$props.nestedField;
25753
+ var _this2 = this;
23902
25754
  return vue.createVNode(Container, {
23903
- "style": componentStyle,
23904
- "class": className
25755
+ "class": this.$props.className
23905
25756
  }, {
23906
25757
  "default": function _default() {
23907
- return [vue.createVNode(RangeConnected$3, vue.mergeProps(babelHelperVueTransformOn({
23908
- change: _this.handleOnChange,
23909
- 'value-change': _this.handleValueChange
23910
- }), {
23911
- "componentId": componentId,
23912
- "value": {
23913
- start: _this.currentValue.start,
23914
- end: _this.currentValue.end
23915
- },
23916
- "range": range,
23917
- "dataField": dataField,
23918
- "rangeLabels": rangeLabels,
23919
- "includeNullValues": includeNullValues,
23920
- "beforeValueChange": beforeValueChange,
23921
- "customQuery": customQuery,
23922
- "data": data,
23923
- "filterLabel": filterLabel,
23924
- "react": react,
23925
- "showFilter": showFilter,
23926
- "showCheckbox": showCheckbox,
23927
- "title": title,
23928
- "URLParams": URLParams,
23929
- "sliderOptions": sliderOptions,
23930
- "nestedField": nestedField
23931
- }), null), vue.createVNode(Flex, {
23932
- "class": getClassName$e(innerClass, 'input-container') || ''
25758
+ return [_this2.$props.title && vue.createVNode(Title, {
25759
+ "class": getClassName$d(_this2.$props.innerClass, 'title')
23933
25760
  }, {
23934
25761
  "default": function _default() {
23935
- return [vue.createVNode(Flex, {
23936
- "direction": "column",
23937
- "flex": 2
23938
- }, {
23939
- "default": function _default() {
23940
- return [vue.createVNode(Input, vue.mergeProps(babelHelperVueTransformOn({
23941
- change: _this.handleInputChange
23942
- }), {
23943
- "key": componentId + "-start-value",
23944
- "name": "start",
23945
- "type": "number",
23946
- "step": stepValue,
23947
- "themePreset": themePreset,
23948
- "aria-label": componentId + "-start-input",
23949
- "min": _this.$props.range ? _this.$props.range.start : 0,
23950
- "class": getClassName$e(innerClass, 'input') || '',
23951
- "alert": !_this.isStartValid,
23952
- "value": _this.currentValue.start || 0
23953
- }), null), !_this.isStartValid && vue.createVNode(Content, {
23954
- "alert": true
23955
- }, {
23956
- "default": function _default() {
23957
- return [vue.createTextVNode("Input range is invalid")];
23958
- }
23959
- })];
23960
- }
23961
- }), vue.createVNode(Flex, {
23962
- "justifyContent": "center",
23963
- "alignItems": "center",
23964
- "flex": 1
23965
- }, {
23966
- "default": function _default() {
23967
- return [vue.createTextVNode("-")];
23968
- }
23969
- }), vue.createVNode(Flex, {
23970
- "direction": "column",
23971
- "flex": 2
25762
+ return [_this2.$props.title];
25763
+ }
25764
+ }), _this2.$props.range ? vue.createVNode(NoSSR, null, {
25765
+ "default": function _default() {
25766
+ return [vue.createVNode(Slider, {
25767
+ "class": getClassName$d(_this2.$props.innerClass, 'slider')
23972
25768
  }, {
23973
25769
  "default": function _default() {
23974
- return [vue.createVNode(Input, vue.mergeProps(babelHelperVueTransformOn({
23975
- change: _this.handleInputChange
23976
- }), {
23977
- "key": componentId + "-end-value",
23978
- "name": "end",
23979
- "type": "number",
23980
- "step": stepValue,
23981
- "themePreset": themePreset,
23982
- "aria-label": componentId + "-end-input",
23983
- "max": _this.$props.range ? _this.$props.range.end : 10,
23984
- "class": getClassName$e(innerClass, 'input') || '',
23985
- "alert": !_this.isEndValid,
23986
- "value": _this.currentValue.end || 0
23987
- }), null), !_this.isEndValid && vue.createVNode(Content, {
23988
- "alert": true
23989
- }, {
23990
- "default": function _default() {
23991
- return [vue.createTextVNode("Input range is invalid")];
23992
- }
23993
- })];
25770
+ return [vue.createVNode(vue.resolveComponent("vue-slider-component"), vue.mergeProps({
25771
+ "ref": "slider",
25772
+ "modelValue": _this2.currentValue,
25773
+ "min": _this2.$props.range.start,
25774
+ "max": _this2.$props.range.end,
25775
+ "dotSize": 20,
25776
+ "height": 4,
25777
+ "enable-cross": false,
25778
+ "onDrag-end": _this2.handleSlider,
25779
+ "tooltip": "always"
25780
+ }, _this2.$props.sliderOptions), null), _this2.$props.rangeLabels && vue.createVNode("div", {
25781
+ "class": "label-container"
25782
+ }, [vue.createVNode("label", {
25783
+ "class": getClassName$d(_this2.$props.innerClass, 'label') || 'range-label-left'
25784
+ }, [_this2.$props.rangeLabels.start]), vue.createVNode("label", {
25785
+ "class": getClassName$d(_this2.$props.innerClass, 'label') || 'range-label-right'
25786
+ }, [_this2.$props.rangeLabels.end])])];
23994
25787
  }
23995
25788
  })];
23996
25789
  }
23997
- })];
25790
+ }) : null];
23998
25791
  }
23999
25792
  });
24000
25793
  }
24001
25794
  };
24002
- var mapStateToProps$d = function mapStateToProps(state) {
25795
+ RangeSlider.defaultQuery = function (value, props) {
24003
25796
  return {
24004
- themePreset: state.config.themePreset
25797
+ query: {
25798
+ queryFormat: props.queryFormat,
25799
+ dataField: props.dataField,
25800
+ value: value,
25801
+ showMissing: props.showMissing
25802
+ }
24005
25803
  };
24006
25804
  };
24007
- var RangeConnected$4 = PreferencesConsumer(ComponentWrapper$1(connect(mapStateToProps$d, {})(RangeInput), {
24008
- componentType: constants_1$1.rangeInput
25805
+ RangeSlider.parseValue = function (value, props) {
25806
+ if (value) {
25807
+ return Array.isArray(value) ? value : [value.start, value.end];
25808
+ }
25809
+ if (props.range) {
25810
+ return [props.range.start, props.range.end];
25811
+ }
25812
+ return [];
25813
+ };
25814
+ var mapStateToProps$e = function mapStateToProps(state, props) {
25815
+ return {
25816
+ options: state.aggregations[props.componentId] ? state.aggregations[props.componentId][props.dataField] && state.aggregations[props.componentId][props.dataField].buckets // eslint-disable-line
25817
+ : [],
25818
+ selectedValue: state.selectedValues[props.componentId] ? state.selectedValues[props.componentId].value : null,
25819
+ componentProps: state.props[props.componentId]
25820
+ };
25821
+ };
25822
+ var mapDispatchtoProps$c = {
25823
+ updateQuery: updateQuery$b,
25824
+ setQueryOptions: setQueryOptions$b,
25825
+ setCustomQuery: setCustomQuery$a
25826
+ };
25827
+ var RangeConnected$3 = PreferencesConsumer(ComponentWrapper$1(connect(mapStateToProps$e, mapDispatchtoProps$c)(RangeSlider), {
25828
+ componentType: constants_1$1.rangeSlider
24009
25829
  }));
24010
- RangeConnected$4.name = RangeInput.name;
24011
- RangeConnected$4.install = function (Vue) {
24012
- Vue.component(RangeConnected$4.name, RangeConnected$4);
25830
+ RangeConnected$3.name = RangeSlider.name;
25831
+ RangeConnected$3.defaultQuery = RangeSlider.defaultQuery;
25832
+ RangeConnected$3.parseValue = RangeSlider.parseValue;
25833
+ RangeConnected$3.hasInternalComponent = RangeSlider.hasInternalComponent;
25834
+ RangeConnected$3.install = function (Vue) {
25835
+ Vue.component(RangeConnected$3.name, RangeConnected$3);
24013
25836
  };
24014
25837
 
24015
- // Add componentType for SSR
24016
- RangeConnected$4.componentType = constants_1$1.rangeInput;
24017
-
24018
- var _excluded$1 = ["options"];
24019
- var updateQuery$b = lib_5.updateQuery,
24020
- setQueryOptions$a = lib_5.setQueryOptions,
24021
- setCustomQuery$a = lib_5.setCustomQuery,
24022
- setDefaultQuery$6 = lib_5.setDefaultQuery;
24023
- var parseHits$1 = lib_8.parseHits,
24024
- isEqual$f = lib_8.isEqual,
24025
- getCompositeAggsQuery$4 = lib_8.getCompositeAggsQuery,
24026
- getResultStats$2 = lib_8.getResultStats,
24027
- extractQueryFromCustomQuery$6 = lib_8.extractQueryFromCustomQuery,
24028
- getOptionsForCustomQuery$6 = lib_8.getOptionsForCustomQuery;
24029
- var ReactiveComponent = {
24030
- name: 'ReactiveComponent',
25838
+ // Add componentType for SSR
25839
+ RangeConnected$3.componentType = constants_1$1.rangeSlider;
25840
+
25841
+ var _templateObject$q;
25842
+ var alert = function alert(_ref) {
25843
+ var theme = _ref.theme;
25844
+ return "\n\tcolor: " + theme.colors.alertColor + ";\n";
25845
+ };
25846
+ var Content = styled('div')(_templateObject$q || (_templateObject$q = _taggedTemplateLiteralLoose(["\n\t", ";\n\tfont-size: 13px;\n\tmargin: 8px;\n"])), function (props) {
25847
+ return props.alert && alert;
25848
+ });
25849
+
25850
+ var getClassName$e = lib_8.getClassName,
25851
+ isEqual$f = lib_8.isEqual;
25852
+ var RangeInput = {
25853
+ name: 'RangeInput',
25854
+ components: {
25855
+ RangeSlider: RangeConnected$3
25856
+ },
25857
+ inject: {
25858
+ theme: {
25859
+ from: 'theme_reactivesearch'
25860
+ }
25861
+ },
25862
+ data: function data() {
25863
+ var state = {
25864
+ currentValue: {
25865
+ start: this.$props.range ? this.$props.range.start : 0,
25866
+ end: this.$props.range ? this.$props.range.end : 10
25867
+ },
25868
+ isStartValid: true,
25869
+ isEndValid: true
25870
+ };
25871
+ return state;
25872
+ },
24031
25873
  props: {
25874
+ className: {
25875
+ types: types.string,
25876
+ "default": ''
25877
+ },
25878
+ defaultValue: types.range,
25879
+ validateRange: types.func,
25880
+ value: types.range,
25881
+ dataField: types.stringRequired,
25882
+ innerClass: types.style,
25883
+ range: {
25884
+ types: types.range,
25885
+ "default": function _default() {
25886
+ return {
25887
+ start: 0,
25888
+ end: 10
25889
+ };
25890
+ }
25891
+ },
25892
+ rangeLabels: types.rangeLabels,
25893
+ stepValue: types.number,
25894
+ componentStyle: types.style,
24032
25895
  componentId: types.stringRequired,
24033
- aggregationField: types.string,
24034
- aggregationSize: Q.number,
24035
- size: Q.number,
24036
- defaultQuery: types.func,
25896
+ includeNullValues: Q.bool,
25897
+ beforeValueChange: types.func,
24037
25898
  customQuery: types.func,
25899
+ data: types.data,
24038
25900
  filterLabel: types.string,
24039
25901
  react: types.react,
24040
25902
  showFilter: Q.bool.def(true),
25903
+ showCheckbox: Q.bool.def(true),
25904
+ title: types.title,
24041
25905
  URLParams: Q.bool.def(false),
24042
- distinctField: types.string,
24043
- distinctFieldConfig: types.props,
24044
- index: Q.string,
25906
+ sliderOptions: Q.object.def({}),
25907
+ nestedField: types.string,
24045
25908
  endpoint: types.endpointConfig
24046
25909
  },
24047
- created: function created() {
24048
- var _this = this;
24049
- var props = this.$props;
24050
- this.internalComponent = null;
24051
- this.$defaultQuery = null;
24052
- // Set custom query in store
24053
- updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.selectedValue);
24054
- var customQuery = props.customQuery,
24055
- componentId = props.componentId,
24056
- filterLabel = props.filterLabel,
24057
- showFilter = props.showFilter,
24058
- URLParams = props.URLParams;
24059
- if (customQuery) {
24060
- var calcCustomQuery = customQuery(this.selectedValue, props);
24061
- var query = extractQueryFromCustomQuery$6(calcCustomQuery);
24062
- var customQueryOptions = calcCustomQuery ? getOptionsForCustomQuery$6(calcCustomQuery) : null;
24063
- if (customQueryOptions) {
24064
- this.setQueryOptions(componentId, _extends({}, customQueryOptions, this.getAggsQuery()), false);
24065
- } else this.setQueryOptions(componentId, this.getAggsQuery(), false);
24066
- this.updateQuery({
24067
- componentId: componentId,
24068
- query: query,
24069
- value: this.selectedValue || null,
24070
- label: filterLabel,
24071
- showFilter: showFilter,
24072
- URLParams: URLParams
24073
- });
24074
- }
24075
- this.setQuery = function (_ref) {
24076
- var options = _ref.options,
24077
- obj = _objectWithoutPropertiesLoose(_ref, _excluded$1);
24078
- var queryToBeSet = obj.query;
24079
-
24080
- // when enableAppbase is true, Backend throws error because of repeated query in request body
24081
- if (queryToBeSet && queryToBeSet.query) {
24082
- queryToBeSet = queryToBeSet.query;
24083
- }
24084
- var customQueryCalc = _extends({}, options, {
24085
- query: queryToBeSet
24086
- });
24087
- var rsAPIQuery = customQueryCalc;
24088
- // handle stored queries
24089
- if (queryToBeSet && queryToBeSet.id) {
24090
- rsAPIQuery = queryToBeSet;
24091
- }
24092
- // Update customQuery field for RS API
24093
- _this.setCustomQuery(props.componentId, rsAPIQuery);
24094
- if (options) {
24095
- _this.setQueryOptions(props.componentId, _extends({}, _this.getAggsQuery(), options), false);
24096
- }
24097
- _this.updateQuery(_extends({}, obj, {
24098
- query: customQueryCalc.query,
24099
- componentId: props.componentId,
24100
- label: props.filterLabel,
24101
- showFilter: props.showFilter,
24102
- URLParams: props.URLParams
24103
- }));
24104
- };
24105
- if (props.defaultQuery) {
24106
- this.internalComponent = props.componentId + "__internal";
24107
- }
24108
- if (this.internalComponent && this.$props.defaultQuery) {
24109
- updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.selectedValue);
24110
- this.$defaultQuery = this.$props.defaultQuery(this.selectedValue, this.$props);
24111
- var _query = extractQueryFromCustomQuery$6(this.$defaultQuery);
24112
- var queryOptions = getOptionsForCustomQuery$6(this.$defaultQuery);
24113
- if (queryOptions) {
24114
- this.setQueryOptions(this.internalComponent, _extends({}, queryOptions, this.getAggsQuery()), false);
24115
- } else this.setQueryOptions(this.internalComponent, this.getAggsQuery(), false);
24116
- this.updateQuery({
24117
- componentId: this.internalComponent,
24118
- query: _query
24119
- });
24120
- }
24121
- },
24122
- watch: {
24123
- hits: function hits(newVal, oldVal) {
24124
- if (!isEqual$f(newVal, oldVal)) {
24125
- this.$emit('data', this.getData());
24126
- }
24127
- },
24128
- rawData: function rawData(newVal, oldVal) {
24129
- if (!isEqual$f(newVal, oldVal)) {
24130
- this.$emit('data', this.getData());
24131
- }
24132
- },
24133
- aggregations: function aggregations(newVal, oldVal) {
24134
- if (!isEqual$f(newVal, oldVal)) {
24135
- this.$emit('data', this.getData());
25910
+ methods: {
25911
+ shouldUpdate: function shouldUpdate(value) {
25912
+ var validateRange = this.$props.validateRange;
25913
+ if (validateRange && value) {
25914
+ return validateRange([value.start, value.end]);
24136
25915
  }
24137
- },
24138
- aggregationData: function aggregationData(newVal, oldVal) {
24139
- if (!isEqual$f(newVal, oldVal)) {
24140
- this.$emit('data', this.getData());
25916
+ if (value) {
25917
+ return value.start <= value.end;
24141
25918
  }
25919
+ return false;
24142
25920
  },
24143
- promotedResults: function promotedResults(newVal, oldVal) {
24144
- if (!isEqual$f(newVal, oldVal)) {
24145
- this.$emit('data', this.getData());
25921
+ isControlled: function isControlled() {
25922
+ if (this.$props.value && this.$attrs) {
25923
+ return true;
24146
25924
  }
25925
+ return false;
24147
25926
  },
24148
- hidden: function hidden(newVal, oldVal) {
24149
- if (!isEqual$f(newVal, oldVal)) {
24150
- this.$emit('data', this.getData());
25927
+ handleChange: function handleChange(value, event) {
25928
+ var currentValue = value;
25929
+ if (this.shouldUpdate(value) && !isEqual$f(value, this.currentValue)) {
25930
+ switch (event) {
25931
+ case 'change':
25932
+ if (!value) {
25933
+ currentValue = {
25934
+ start: this.$props.range ? this.$props.range.start : 0,
25935
+ end: this.$props.range ? this.$props.range.end : 10
25936
+ };
25937
+ }
25938
+ this.currentValue = currentValue;
25939
+ this.$emit('change', this.currentValue);
25940
+ break;
25941
+ case 'value-change':
25942
+ this.$emit('valueChange', this.currentValue);
25943
+ this.$emit('value-change', this.currentValue);
25944
+ break;
25945
+ default:
25946
+ this.currentValue = _extends({}, currentValue);
25947
+ break;
25948
+ }
24151
25949
  }
24152
25950
  },
24153
- total: function total(newVal, oldVal) {
24154
- if (!isEqual$f(newVal, oldVal)) {
24155
- this.$emit('data', this.getData());
24156
- }
25951
+ handleOnChange: function handleOnChange(value) {
25952
+ this.handleChange(value || this.$props.range, 'change');
24157
25953
  },
24158
- time: function time(newVal, oldVal) {
24159
- if (!isEqual$f(newVal, oldVal)) {
24160
- this.$emit('data', this.getData());
24161
- }
25954
+ handleValueChange: function handleValueChange(value) {
25955
+ this.handleChange(value, 'value-change');
24162
25956
  },
24163
- defaultQuery: function defaultQuery(newVal, oldVal) {
24164
- if (newVal && !isQueryIdentical(newVal, oldVal, this.selectedValue, this.$props)) {
24165
- this.$defaultQuery = newVal(this.selectedValue, this.$props);
24166
- var query = extractQueryFromCustomQuery$6(this.$defaultQuery);
24167
- var queryOptions = getOptionsForCustomQuery$6(this.$defaultQuery);
24168
- if (queryOptions) {
24169
- this.setQueryOptions(this.internalComponent, _extends({}, queryOptions, this.getAggsQuery()), false);
24170
- } else this.setQueryOptions(this.internalComponent, this.getAggsQuery(), false);
24171
- // Update default query for RS API
24172
- updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.selectedValue);
24173
- this.updateQuery({
24174
- componentId: this.internalComponent,
24175
- query: query
24176
- });
25957
+ handleInputChange: function handleInputChange(e) {
25958
+ var _e$target = e.target,
25959
+ name = _e$target.name,
25960
+ value = _e$target.value;
25961
+ if (Number.isNaN(value)) {
25962
+ if (name === 'start') {
25963
+ this.isStartValid = false;
25964
+ } else {
25965
+ this.isEndValid = false;
25966
+ }
25967
+ } else if (name === 'start' && !this.isStartValid) {
25968
+ this.isStartValid = true;
25969
+ } else if (name === 'end' && !this.isEndValid) {
25970
+ this.isEndValid = true;
24177
25971
  }
24178
- },
24179
- customQuery: function customQuery(newVal, oldVal) {
24180
- if (newVal && !isQueryIdentical(newVal, oldVal, this.selectedValue, this.$props)) {
24181
- var componentId = this.$props.componentId;
24182
- this.$customQuery = newVal(this.selectedValue, this.$props);
24183
- var query = extractQueryFromCustomQuery$6(this.$customQuery);
24184
- var queryOptions = getOptionsForCustomQuery$6(this.$customQuery);
24185
- if (queryOptions) {
24186
- this.setQueryOptions(componentId, _extends({}, queryOptions, this.getAggsQuery()), false);
24187
- } else this.setQueryOptions(componentId, this.getAggsQuery(), false);
24188
-
24189
- // Update custom query for RS API
24190
- updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.selectedValue);
24191
- this.updateQuery({
24192
- componentId: componentId,
24193
- query: query
24194
- });
25972
+ if (this.isStartValid && this.isEndValid) {
25973
+ if (name === 'start') {
25974
+ this.handleChange({
25975
+ start: Number(value),
25976
+ end: this.currentValue.end
25977
+ }, 'change');
25978
+ } else {
25979
+ this.handleChange({
25980
+ start: this.currentValue.start,
25981
+ end: Number(value)
25982
+ }, 'change');
25983
+ }
24195
25984
  }
24196
25985
  }
24197
25986
  },
24198
- render: function render() {
24199
- try {
24200
- var dom = this.$slots["default"];
24201
- var error = this.error,
24202
- isLoading = this.isLoading,
24203
- selectedValue = this.selectedValue;
24204
- var propsToBePassed = _extends({
24205
- error: error,
24206
- loading: isLoading
24207
- }, this.getData(), {
24208
- value: selectedValue,
24209
- setQuery: this.setQuery
24210
- });
24211
- return vue.createVNode("div", null, [dom(propsToBePassed)]);
24212
- } catch (e) {
24213
- return null;
24214
- }
24215
- },
24216
- methods: {
24217
- getAggsQuery: function getAggsQuery() {
24218
- if (this.aggregationField) {
24219
- return {
24220
- aggs: getCompositeAggsQuery$4({
24221
- props: this.$props,
24222
- showTopHits: true,
24223
- value: this.selectedValue
24224
- }).aggs
24225
- };
25987
+ watch: {
25988
+ defaultValue: function defaultValue(newVal, oldVal) {
25989
+ if (oldVal.start !== newVal.start || oldVal.end !== newVal.end) {
25990
+ this.handleChange(newVal);
24226
25991
  }
24227
- return {};
24228
25992
  },
24229
- getData: function getData() {
24230
- var hits = this.hits,
24231
- aggregations = this.aggregations,
24232
- aggregationData = this.aggregationData,
24233
- promotedResults = this.promotedResults,
24234
- rawData = this.rawData;
24235
- var filteredResults = parseHits$1(hits);
24236
- if (promotedResults.length) {
24237
- var ids = promotedResults.map(function (item) {
24238
- return item._id;
24239
- }).filter(Boolean);
24240
- if (ids) {
24241
- filteredResults = filteredResults.filter(function (item) {
24242
- return !ids.includes(item._id);
24243
- });
25993
+ value: function value(newVal, oldVal) {
25994
+ if (!isEqual$f(newVal, oldVal)) {
25995
+ if (this.isControlled()) {
25996
+ this.handleChange(newVal, 'change');
24244
25997
  }
24245
- filteredResults = [].concat(promotedResults, filteredResults);
24246
25998
  }
24247
- return {
24248
- data: filteredResults,
24249
- aggregationData: aggregationData,
24250
- rawData: rawData,
24251
- aggregations: aggregations,
24252
- promotedData: promotedResults,
24253
- resultStats: this.stats
24254
- };
24255
25999
  }
24256
26000
  },
24257
- computed: {
24258
- stats: function stats() {
24259
- return getResultStats$2(this);
26001
+ created: function created() {
26002
+ if (this.$props.defaultValue && this.$props.defaultValue.start && this.$props.defaultValue.end) {
26003
+ this.handleChange(this.$props.defaultValue);
26004
+ }
26005
+ if (this.isControlled()) {
26006
+ this.handleChange(this.$props.value, 'change');
24260
26007
  }
26008
+ },
26009
+ render: function render() {
26010
+ var _this = this;
26011
+ var _this$$props = this.$props,
26012
+ className = _this$$props.className,
26013
+ dataField = _this$$props.dataField,
26014
+ range = _this$$props.range,
26015
+ rangeLabels = _this$$props.rangeLabels,
26016
+ componentId = _this$$props.componentId,
26017
+ innerClass = _this$$props.innerClass,
26018
+ stepValue = _this$$props.stepValue,
26019
+ componentStyle = _this$$props.componentStyle,
26020
+ themePreset = _this$$props.themePreset,
26021
+ includeNullValues = _this$$props.includeNullValues,
26022
+ beforeValueChange = _this$$props.beforeValueChange,
26023
+ customQuery = _this$$props.customQuery,
26024
+ data = _this$$props.data,
26025
+ filterLabel = _this$$props.filterLabel,
26026
+ react = _this$$props.react,
26027
+ showFilter = _this$$props.showFilter,
26028
+ showCheckbox = _this$$props.showCheckbox,
26029
+ title = _this$$props.title,
26030
+ URLParams = _this$$props.URLParams,
26031
+ sliderOptions = _this$$props.sliderOptions,
26032
+ nestedField = _this$$props.nestedField;
26033
+ return vue.createVNode(Container, {
26034
+ "style": componentStyle,
26035
+ "class": className
26036
+ }, {
26037
+ "default": function _default() {
26038
+ return [vue.createVNode(RangeConnected$3, vue.mergeProps(babelHelperVueTransformOn({
26039
+ change: _this.handleOnChange,
26040
+ 'value-change': _this.handleValueChange
26041
+ }), {
26042
+ "componentId": componentId,
26043
+ "value": {
26044
+ start: _this.currentValue.start,
26045
+ end: _this.currentValue.end
26046
+ },
26047
+ "range": range,
26048
+ "dataField": dataField,
26049
+ "rangeLabels": rangeLabels,
26050
+ "includeNullValues": includeNullValues,
26051
+ "beforeValueChange": beforeValueChange,
26052
+ "customQuery": customQuery,
26053
+ "data": data,
26054
+ "filterLabel": filterLabel,
26055
+ "react": react,
26056
+ "showFilter": showFilter,
26057
+ "showCheckbox": showCheckbox,
26058
+ "title": title,
26059
+ "URLParams": URLParams,
26060
+ "sliderOptions": sliderOptions,
26061
+ "nestedField": nestedField
26062
+ }), null), vue.createVNode(Flex, {
26063
+ "class": getClassName$e(innerClass, 'input-container') || ''
26064
+ }, {
26065
+ "default": function _default() {
26066
+ return [vue.createVNode(Flex, {
26067
+ "direction": "column",
26068
+ "flex": 2
26069
+ }, {
26070
+ "default": function _default() {
26071
+ return [vue.createVNode(Input, vue.mergeProps(babelHelperVueTransformOn({
26072
+ change: _this.handleInputChange
26073
+ }), {
26074
+ "key": componentId + "-start-value",
26075
+ "name": "start",
26076
+ "type": "number",
26077
+ "step": stepValue,
26078
+ "themePreset": themePreset,
26079
+ "aria-label": componentId + "-start-input",
26080
+ "min": _this.$props.range ? _this.$props.range.start : 0,
26081
+ "class": getClassName$e(innerClass, 'input') || '',
26082
+ "alert": !_this.isStartValid,
26083
+ "value": _this.currentValue.start || 0
26084
+ }), null), !_this.isStartValid && vue.createVNode(Content, {
26085
+ "alert": true
26086
+ }, {
26087
+ "default": function _default() {
26088
+ return [vue.createTextVNode("Input range is invalid")];
26089
+ }
26090
+ })];
26091
+ }
26092
+ }), vue.createVNode(Flex, {
26093
+ "justifyContent": "center",
26094
+ "alignItems": "center",
26095
+ "flex": 1
26096
+ }, {
26097
+ "default": function _default() {
26098
+ return [vue.createTextVNode("-")];
26099
+ }
26100
+ }), vue.createVNode(Flex, {
26101
+ "direction": "column",
26102
+ "flex": 2
26103
+ }, {
26104
+ "default": function _default() {
26105
+ return [vue.createVNode(Input, vue.mergeProps(babelHelperVueTransformOn({
26106
+ change: _this.handleInputChange
26107
+ }), {
26108
+ "key": componentId + "-end-value",
26109
+ "name": "end",
26110
+ "type": "number",
26111
+ "step": stepValue,
26112
+ "themePreset": themePreset,
26113
+ "aria-label": componentId + "-end-input",
26114
+ "max": _this.$props.range ? _this.$props.range.end : 10,
26115
+ "class": getClassName$e(innerClass, 'input') || '',
26116
+ "alert": !_this.isEndValid,
26117
+ "value": _this.currentValue.end || 0
26118
+ }), null), !_this.isEndValid && vue.createVNode(Content, {
26119
+ "alert": true
26120
+ }, {
26121
+ "default": function _default() {
26122
+ return [vue.createTextVNode("Input range is invalid")];
26123
+ }
26124
+ })];
26125
+ }
26126
+ })];
26127
+ }
26128
+ })];
26129
+ }
26130
+ });
24261
26131
  }
24262
26132
  };
24263
- ReactiveComponent.hasInternalComponent = function (props) {
24264
- return !!props.defaultQuery;
24265
- };
24266
- var mapStateToProps$e = function mapStateToProps(state, props) {
26133
+ var mapStateToProps$f = function mapStateToProps(state) {
24267
26134
  return {
24268
- aggregations: state.aggregations[props.componentId] && state.aggregations[props.componentId] || null,
24269
- aggregationData: state.compositeAggregations[props.componentId] || [],
24270
- hits: state.hits[props.componentId] && state.hits[props.componentId].hits || [],
24271
- rawData: state.rawData[props.componentId],
24272
- error: state.error[props.componentId],
24273
- isLoading: state.isLoading[props.componentId],
24274
- selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || null,
24275
- promotedResults: state.promotedResults[props.componentId] || [],
24276
- time: state.hits[props.componentId] && state.hits[props.componentId].time || 0,
24277
- total: state.hits[props.componentId] && state.hits[props.componentId].total,
24278
- hidden: state.hits[props.componentId] && state.hits[props.componentId].hidden,
24279
- componentProps: state.props[props.componentId]
26135
+ themePreset: state.config.themePreset
24280
26136
  };
24281
26137
  };
24282
- var mapDispatchtoProps$b = {
24283
- setQueryOptions: setQueryOptions$a,
24284
- updateQuery: updateQuery$b,
24285
- setCustomQuery: setCustomQuery$a,
24286
- setDefaultQuery: setDefaultQuery$6
26138
+ var RangeConnected$4 = PreferencesConsumer(ComponentWrapper$1(connect(mapStateToProps$f, {})(RangeInput), {
26139
+ componentType: constants_1$1.rangeInput
26140
+ }));
26141
+ RangeConnected$4.name = RangeInput.name;
26142
+ RangeConnected$4.install = function (Vue) {
26143
+ Vue.component(RangeConnected$4.name, RangeConnected$4);
24287
26144
  };
24288
- var ConnectedComponent = ComponentWrapper$1(connect(mapStateToProps$e, mapDispatchtoProps$b)(ReactiveComponent), {
24289
- componentType: constants_1$1.reactiveComponent
24290
- });
24291
- var RcConnected = PreferencesConsumer({
26145
+
26146
+ // Add componentType for SSR
26147
+ RangeConnected$4.componentType = constants_1$1.rangeInput;
26148
+
26149
+ var RcConnected$1 = PreferencesConsumer({
24292
26150
  name: 'RcConnected',
24293
26151
  render: function render() {
24294
- var component = ConnectedComponent;
26152
+ var component = RcConnected;
24295
26153
  switch (this.$attrs.componentType) {
24296
26154
  case constants_1$1.reactiveList:
24297
26155
  component = RLConnected;
@@ -24336,12 +26194,12 @@
24336
26194
  return vue.h(component, null, this.$slots);
24337
26195
  }
24338
26196
  });
24339
- RcConnected.name = ReactiveComponent.name;
24340
- RcConnected.hasInternalComponent = ReactiveComponent.hasInternalComponent;
26197
+ RcConnected$1.name = RcConnected.name;
26198
+ RcConnected$1.hasInternalComponent = RcConnected.hasInternalComponent;
24341
26199
  // Add componentType for SSR
24342
- RcConnected.componentType = constants_1$1.reactiveComponent;
24343
- RcConnected.install = function (Vue) {
24344
- Vue.component(RcConnected.name, RcConnected);
26200
+ RcConnected$1.componentType = constants_1$1.reactiveComponent;
26201
+ RcConnected$1.install = function (Vue) {
26202
+ Vue.component(RcConnected$1.name, RcConnected$1);
24345
26203
  };
24346
26204
 
24347
26205
  var setValue$2 = lib_5.setValue,
@@ -24502,24 +26360,24 @@
24502
26360
  }
24503
26361
  }
24504
26362
  };
24505
- var mapStateToProps$f = function mapStateToProps(state) {
26363
+ var mapStateToProps$g = function mapStateToProps(state) {
24506
26364
  return {
24507
26365
  components: state.components,
24508
26366
  selectedValues: state.selectedValues
24509
26367
  };
24510
26368
  };
24511
- var mapDispatchtoProps$c = {
26369
+ var mapDispatchtoProps$d = {
24512
26370
  clearValuesAction: clearValues,
24513
26371
  setValue: setValue$2,
24514
26372
  resetValuesToDefault: resetValuesToDefault
24515
26373
  };
24516
- var RcConnected$1 = connect(mapStateToProps$f, mapDispatchtoProps$c)(SelectedFilters);
24517
- RcConnected$1.name = SelectedFilters.name;
24518
- RcConnected$1.install = function (Vue) {
24519
- Vue.component(RcConnected$1.name, RcConnected$1);
26374
+ var RcConnected$2 = connect(mapStateToProps$g, mapDispatchtoProps$d)(SelectedFilters);
26375
+ RcConnected$2.name = SelectedFilters.name;
26376
+ RcConnected$2.install = function (Vue) {
26377
+ Vue.component(RcConnected$2.name, RcConnected$2);
24520
26378
  };
24521
26379
 
24522
- function _isSlot$a(s) {
26380
+ function _isSlot$c(s) {
24523
26381
  return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
24524
26382
  }
24525
26383
  var ResultCardTitle = {
@@ -24527,7 +26385,7 @@
24527
26385
  render: function render() {
24528
26386
  var _slot;
24529
26387
  var children = this.$slots["default"];
24530
- return vue.createVNode(Title, this.$props, _isSlot$a(_slot = children()) ? _slot : {
26388
+ return vue.createVNode(Title, this.$props, _isSlot$c(_slot = children()) ? _slot : {
24531
26389
  "default": function _default() {
24532
26390
  return [_slot];
24533
26391
  }
@@ -24571,7 +26429,7 @@
24571
26429
  };
24572
26430
 
24573
26431
  var _excluded$3 = ["href", "target"];
24574
- function _isSlot$b(s) {
26432
+ function _isSlot$d(s) {
24575
26433
  return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
24576
26434
  }
24577
26435
  var ResultCard = {
@@ -24596,7 +26454,7 @@
24596
26454
  "href": href,
24597
26455
  "target": target,
24598
26456
  "rel": target === '_blank' ? 'noopener noreferrer' : null
24599
- }, rest), _isSlot$b(_slot = children()) ? _slot : {
26457
+ }, rest), _isSlot$d(_slot = children()) ? _slot : {
24600
26458
  "default": function _default() {
24601
26459
  return [_slot];
24602
26460
  }
@@ -24654,7 +26512,7 @@
24654
26512
  Vue.component(ResultListImage.name, ResultListImage);
24655
26513
  };
24656
26514
 
24657
- function _isSlot$c(s) {
26515
+ function _isSlot$e(s) {
24658
26516
  return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
24659
26517
  }
24660
26518
  var ResultListTitle = {
@@ -24662,7 +26520,7 @@
24662
26520
  render: function render() {
24663
26521
  var _slot;
24664
26522
  var children = this.$slots["default"];
24665
- return vue.createVNode(Title, this.$props, _isSlot$c(_slot = children()) ? _slot : {
26523
+ return vue.createVNode(Title, this.$props, _isSlot$e(_slot = children()) ? _slot : {
24666
26524
  "default": function _default() {
24667
26525
  return [_slot];
24668
26526
  }
@@ -24674,7 +26532,7 @@
24674
26532
  };
24675
26533
 
24676
26534
  var _excluded$5 = ["href", "target"];
24677
- function _isSlot$d(s) {
26535
+ function _isSlot$f(s) {
24678
26536
  return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
24679
26537
  }
24680
26538
  var ResultList = {
@@ -24723,7 +26581,7 @@
24723
26581
  "small": isSmall,
24724
26582
  "target": target,
24725
26583
  "rel": target === '_blank' ? 'noopener noreferrer' : null
24726
- }, props), _isSlot$d(_slot = children()) ? _slot : {
26584
+ }, props), _isSlot$f(_slot = children()) ? _slot : {
24727
26585
  "default": function _default() {
24728
26586
  return [_slot];
24729
26587
  }
@@ -24952,7 +26810,7 @@
24952
26810
  }) : null;
24953
26811
  }
24954
26812
  };
24955
- var mapStateToProps$g = function mapStateToProps(state, props) {
26813
+ var mapStateToProps$h = function mapStateToProps(state, props) {
24956
26814
  return {
24957
26815
  selectedValues: filterByComponentIds(state.selectedValues, props),
24958
26816
  queryLog: filterByComponentIds(state.queryLog, props),
@@ -24969,10 +26827,10 @@
24969
26827
  components: state.components
24970
26828
  };
24971
26829
  };
24972
- var mapDispatchtoProps$d = {
26830
+ var mapDispatchtoProps$e = {
24973
26831
  setSearchStateFn: setSearchState
24974
26832
  };
24975
- var StateProviderConnected = connect(mapStateToProps$g, mapDispatchtoProps$d)(StateProvider);
26833
+ var StateProviderConnected = connect(mapStateToProps$h, mapDispatchtoProps$e)(StateProvider);
24976
26834
  StateProviderConnected.name = StateProvider.name;
24977
26835
  StateProviderConnected.install = function (Vue) {
24978
26836
  Vue.component(StateProviderConnected.name, StateProviderConnected);
@@ -27984,7 +29842,7 @@
27984
29842
  var main = geohash;
27985
29843
 
27986
29844
  var setStreaming = lib_5.setStreaming,
27987
- setQueryOptions$b = lib_5.setQueryOptions,
29845
+ setQueryOptions$c = lib_5.setQueryOptions,
27988
29846
  updateQuery$c = lib_5.updateQuery,
27989
29847
  loadMore$1 = lib_5.loadMore,
27990
29848
  setValue$3 = lib_5.setValue,
@@ -28726,7 +30584,7 @@
28726
30584
  }, [this.renderErrorComponent(), this.isLoading && loader, this.hasCustomRender ? this.getComponent() : null, this.renderMap(this.getMapParams()), this.pagination ? this.renderPagination() : null]);
28727
30585
  }
28728
30586
  };
28729
- var mapStateToProps$h = function mapStateToProps(state, props) {
30587
+ var mapStateToProps$i = function mapStateToProps(state, props) {
28730
30588
  return {
28731
30589
  defaultPage: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value - 1 || -1,
28732
30590
  error: state.error[props.componentId],
@@ -28743,7 +30601,7 @@
28743
30601
  var mapDispatchToProps$3 = {
28744
30602
  loadMoreAction: loadMore$1,
28745
30603
  setPageURL: setValue$3,
28746
- setQueryOptions: setQueryOptions$b,
30604
+ setQueryOptions: setQueryOptions$c,
28747
30605
  setStreaming: setStreaming,
28748
30606
  updateQuery: updateQuery$c,
28749
30607
  updateComponentProps: updateComponentProps$3,
@@ -28751,7 +30609,7 @@
28751
30609
  recordResultClick: recordResultClick$1,
28752
30610
  setMapData: setMapData
28753
30611
  };
28754
- var RMConnected = PreferencesConsumer(ComponentWrapper$1(connect(mapStateToProps$h, mapDispatchToProps$3)(ReactiveMap), {
30612
+ var RMConnected = PreferencesConsumer(ComponentWrapper$1(connect(mapStateToProps$i, mapDispatchToProps$3)(ReactiveMap), {
28755
30613
  componentType: constants_1$1.reactiveMap,
28756
30614
  internalComponent: true
28757
30615
  }));
@@ -29586,9 +31444,9 @@
29586
31444
  }
29587
31445
  };
29588
31446
 
29589
- var _templateObject$q, _templateObject2$8, _templateObject3$5;
29590
- var MapPin = styled('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"])));
29591
- var MapPinArrow = styled('div')(_templateObject2$8 || (_templateObject2$8 = _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"])));
31447
+ var _templateObject$r, _templateObject2$9, _templateObject3$5;
31448
+ var MapPin = styled('div')(_templateObject$r || (_templateObject$r = _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"])));
31449
+ var MapPinArrow = styled('div')(_templateObject2$9 || (_templateObject2$9 = _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"])));
29592
31450
  var mapPinWrapper = css(_templateObject3$5 || (_templateObject3$5 = _taggedTemplateLiteralLoose(["\n\t&:hover,\n\t&:focus {\n\t\tz-index: 200;\n\t}\n"])));
29593
31451
 
29594
31452
  var recordResultClick$3 = lib_5.recordResultClick;
@@ -29917,7 +31775,7 @@
29917
31775
  }
29918
31776
  };
29919
31777
 
29920
- var _templateObject$r;
31778
+ var _templateObject$s;
29921
31779
  var ReactiveGoogleMap = {
29922
31780
  name: 'ReactiveGoogleMap',
29923
31781
  props: {
@@ -29992,7 +31850,7 @@
29992
31850
  "style": {
29993
31851
  height: '100%'
29994
31852
  },
29995
- "class": css(_templateObject$r || (_templateObject$r = _taggedTemplateLiteralLoose(["\n\t\t\t\t\t\t\theight: 100%;\n\t\t\t\t\t\t"]))),
31853
+ "class": css(_templateObject$s || (_templateObject$s = _taggedTemplateLiteralLoose(["\n\t\t\t\t\t\t\theight: 100%;\n\t\t\t\t\t\t"]))),
29996
31854
  "options": {
29997
31855
  zoomControl: true
29998
31856
  },
@@ -31163,9 +33021,9 @@
31163
33021
  }, queryString, renderFunction);
31164
33022
  }
31165
33023
 
31166
- var version = "3.0.0-alpha.7";
33024
+ var version = "3.0.0-rc.1";
31167
33025
 
31168
- var components = [RLConnected, ResultCard, ResultList, ReactiveBase, SBConnected, ListConnected, ListConnected$1, RangeConnected$1, RangeConnected$2, RangeConnected$3, RangeConnected, RcConnected, RcConnected$1, TBConnected, ListConnected$2, ListConnected$3, StateProviderConnected, RangeConnected$4];
33026
+ var components = [RLConnected, ResultCard, ResultList, ReactiveBase, SBConnected, ListConnected, ListConnected$1, RangeConnected$1, RangeConnected$2, RangeConnected$3, RangeConnected, RcConnected, RcConnected$1, RcConnected$2, TBConnected, ListConnected$2, ListConnected$3, StateProviderConnected, RangeConnected$4, TreeListConnected];
31169
33027
  function install$1 (Vue) {
31170
33028
  components.map(function (component) {
31171
33029
  Vue.use(component);
@@ -31190,17 +33048,19 @@
31190
33048
  exports.RangeSlider = RangeConnected$3;
31191
33049
  exports.ReactiveBase = ReactiveBase;
31192
33050
  exports.ReactiveComponent = RcConnected;
33051
+ exports.ReactiveComponentPrivate = RcConnected$1;
31193
33052
  exports.ReactiveGoogleMap = ReactiveGoogleMap;
31194
33053
  exports.ReactiveList = RLConnected;
31195
33054
  exports.ResultCard = ResultCard;
31196
33055
  exports.ResultList = ResultList;
31197
33056
  exports.SearchBox = SBConnected;
31198
- exports.SelectedFilters = RcConnected$1;
33057
+ exports.SelectedFilters = RcConnected$2;
31199
33058
  exports.SingleDropdownList = ListConnected$2;
31200
33059
  exports.SingleList = ListConnected;
31201
33060
  exports.SingleRange = RangeConnected$1;
31202
33061
  exports.StateProvider = StateProviderConnected;
31203
33062
  exports.ToggleButton = TBConnected;
33063
+ exports.TreeList = TreeListConnected;
31204
33064
  exports.componentTypes = constants_1$1;
31205
33065
  exports.default = index$1;
31206
33066
  exports.getServerState = getServerState;