@appbaseio/reactivesearch-vue 1.29.0 → 2.0.0-alpha

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 (89) hide show
  1. package/dist/@appbaseio/reactivesearch-vue.umd.js +11162 -762
  2. package/dist/@appbaseio/reactivesearch-vue.umd.js.map +1 -1
  3. package/dist/@appbaseio/reactivesearch-vue.umd.min.js +21 -5
  4. package/dist/@appbaseio/reactivesearch-vue.umd.min.js.map +1 -1
  5. package/dist/cjs/{Button-e0b7c1f6.js → Button-446f819e.js} +1 -1
  6. package/dist/cjs/{CancelSvg-4aa35935.js → CancelSvg-9f258f4f.js} +1 -1
  7. package/dist/cjs/{Card-fd94ef07.js → Card-642547a8.js} +2 -2
  8. package/dist/cjs/{ComponentWrapper-10bad289.js → ComponentWrapper-ad3dad02.js} +2 -2
  9. package/dist/cjs/{Container-526efa6a.js → Container-daf30918.js} +1 -1
  10. package/dist/cjs/{DataSearch-eec21890.js → DataSearch-6cf29cf0.js} +236 -84
  11. package/dist/cjs/DataSearch.js +10 -10
  12. package/dist/cjs/{DropDown-e4381fcc.js → DropDown-c479bbb0.js} +5 -5
  13. package/dist/cjs/DynamicRangeSlider.js +8 -7
  14. package/dist/cjs/{Flex-f146cdad.js → Flex-aa517a13.js} +1 -1
  15. package/dist/cjs/{FormControlList-808dbcef.js → FormControlList-c195a592.js} +1 -1
  16. package/dist/cjs/{Input-0d7b25ad.js → Input-e6603a7e.js} +1 -1
  17. package/dist/cjs/{ListItem-b40adb04.js → ListItem-8c9e0d68.js} +2 -2
  18. package/dist/cjs/MultiDropdownList.js +13 -12
  19. package/dist/cjs/MultiList.js +11 -10
  20. package/dist/cjs/MultiRange.js +9 -8
  21. package/dist/cjs/Pagination-71e85fa9.js +182 -0
  22. package/dist/cjs/RangeInput.js +11 -10
  23. package/dist/cjs/RangeSlider.js +9 -8
  24. package/dist/cjs/ReactiveBase.js +69 -35
  25. package/dist/cjs/ReactiveComponent.js +6 -5
  26. package/dist/cjs/ReactiveGoogleMap.js +2336 -0
  27. package/dist/cjs/ReactiveList.js +22 -185
  28. package/dist/cjs/ResultCard.js +4 -4
  29. package/dist/cjs/ResultList.js +4 -4
  30. package/dist/cjs/SelectedFilters.js +45 -28
  31. package/dist/cjs/SingleDropdownList.js +13 -12
  32. package/dist/cjs/SingleList.js +11 -10
  33. package/dist/cjs/SingleRange.js +10 -9
  34. package/dist/cjs/StateProvider.js +30 -5
  35. package/dist/cjs/{Title-584a8cc8.js → Title-1de7d0f4.js} +1 -1
  36. package/dist/cjs/ToggleButton.js +10 -8
  37. package/dist/cjs/{_rollupPluginBabelHelpers-f127c8b7.js → _rollupPluginBabelHelpers-c705cbe6.js} +17 -2
  38. package/dist/cjs/{index-4509aa45.js → index-6a167fe0.js} +13 -1
  39. package/dist/cjs/index.js +24 -18
  40. package/dist/cjs/initReactivesearch.js +40 -8
  41. package/dist/cjs/{install-4886582d.js → install-99716d95.js} +252 -87
  42. package/dist/cjs/install.js +20 -18
  43. package/dist/cjs/{ssr-0ee35a09.js → ssr-3027b848.js} +1 -1
  44. package/dist/cjs/{utils-1219e1fe.js → utils-d6a52588.js} +1 -1
  45. package/dist/cjs/version.js +1 -1
  46. package/dist/cjs/{vueTypes-57d01f18.js → vueTypes-727b7c63.js} +30 -13
  47. package/dist/es/{Button-33de88e6.js → Button-d8bc15ea.js} +1 -1
  48. package/dist/es/{CancelSvg-c2c03a35.js → CancelSvg-4cfae5fd.js} +1 -1
  49. package/dist/es/{Card-6446f1b7.js → Card-450683f1.js} +2 -2
  50. package/dist/es/{ComponentWrapper-0f3431d1.js → ComponentWrapper-424e86fd.js} +2 -2
  51. package/dist/es/{Container-18b03fde.js → Container-ba826e96.js} +1 -1
  52. package/dist/es/{DataSearch-42f547cd.js → DataSearch-4888aa43.js} +236 -86
  53. package/dist/es/DataSearch.js +10 -10
  54. package/dist/es/{DropDown-ff6ad982.js → DropDown-05a644a5.js} +5 -5
  55. package/dist/es/DynamicRangeSlider.js +8 -7
  56. package/dist/es/{Flex-8770345d.js → Flex-1f0795c3.js} +1 -1
  57. package/dist/es/{FormControlList-704f8dee.js → FormControlList-c22d64f6.js} +1 -1
  58. package/dist/es/{Input-e339e63a.js → Input-7a2a9fac.js} +1 -1
  59. package/dist/es/{ListItem-8e8fb535.js → ListItem-cad14c5e.js} +2 -2
  60. package/dist/es/MultiDropdownList.js +13 -12
  61. package/dist/es/MultiList.js +11 -10
  62. package/dist/es/MultiRange.js +9 -8
  63. package/dist/es/Pagination-784bf143.js +177 -0
  64. package/dist/es/RangeInput.js +11 -10
  65. package/dist/es/RangeSlider.js +9 -8
  66. package/dist/es/ReactiveBase.js +70 -36
  67. package/dist/es/ReactiveComponent.js +6 -5
  68. package/dist/es/ReactiveGoogleMap.js +2327 -0
  69. package/dist/es/ReactiveList.js +21 -184
  70. package/dist/es/ResultCard.js +4 -4
  71. package/dist/es/ResultList.js +4 -4
  72. package/dist/es/SelectedFilters.js +45 -28
  73. package/dist/es/SingleDropdownList.js +13 -12
  74. package/dist/es/SingleList.js +11 -10
  75. package/dist/es/SingleRange.js +10 -9
  76. package/dist/es/StateProvider.js +30 -5
  77. package/dist/es/{Title-3522ff56.js → Title-3342664a.js} +1 -1
  78. package/dist/es/ToggleButton.js +10 -8
  79. package/dist/es/{_rollupPluginBabelHelpers-0f24d612.js → _rollupPluginBabelHelpers-76660dab.js} +17 -3
  80. package/dist/es/{index-78920565.js → index-7788a843.js} +13 -2
  81. package/dist/es/index.js +24 -19
  82. package/dist/es/initReactivesearch.js +41 -9
  83. package/dist/es/{install-54ebd72e.js → install-87984085.js} +252 -87
  84. package/dist/es/install.js +20 -18
  85. package/dist/es/{ssr-a41dfea9.js → ssr-b2c0b401.js} +1 -1
  86. package/dist/es/{utils-64a2e5f0.js → utils-9e68acee.js} +1 -1
  87. package/dist/es/version.js +1 -1
  88. package/dist/es/{vueTypes-687b2304.js → vueTypes-b8146772.js} +30 -13
  89. package/package.json +11 -5
@@ -4,24 +4,24 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'defau
4
4
 
5
5
  var configureStore = require('@appbaseio/reactivecore');
6
6
  var configureStore__default = _interopDefault(configureStore);
7
- var _rollupPluginBabelHelpers = require('./_rollupPluginBabelHelpers-f127c8b7.js');
7
+ var _rollupPluginBabelHelpers = require('./_rollupPluginBabelHelpers-c705cbe6.js');
8
8
  var VueTypes = _interopDefault(require('vue-types'));
9
9
  var constants = require('@appbaseio/reactivecore/lib/utils/constants');
10
10
  var helper = require('@appbaseio/reactivecore/lib/utils/helper');
11
11
  var styled = require('@appbaseio/vue-emotion');
12
12
  var styled__default = _interopDefault(styled);
13
- var Button = require('./Button-e0b7c1f6.js');
14
- var vueTypes = require('./vueTypes-57d01f18.js');
13
+ var Button = require('./Button-446f819e.js');
14
+ var vueTypes = require('./vueTypes-727b7c63.js');
15
15
  var ReactiveList = require('./ReactiveList.js');
16
- var index = require('./index-4509aa45.js');
17
- var ComponentWrapper = require('./ComponentWrapper-10bad289.js');
18
- var Title = require('./Title-584a8cc8.js');
16
+ var index = require('./index-6a167fe0.js');
17
+ var ComponentWrapper = require('./ComponentWrapper-ad3dad02.js');
18
+ var Title = require('./Title-1de7d0f4.js');
19
19
  var ReactiveBase = require('./ReactiveBase.js');
20
20
  var hotkeys = _interopDefault(require('hotkeys-js'));
21
- var DataSearch = require('./DataSearch-eec21890.js');
22
- var CancelSvg = require('./CancelSvg-4aa35935.js');
23
- var Input = require('./Input-0d7b25ad.js');
24
- var Container = require('./Container-526efa6a.js');
21
+ var DataSearch = require('./DataSearch-6cf29cf0.js');
22
+ var CancelSvg = require('./CancelSvg-9f258f4f.js');
23
+ var Input = require('./Input-e6603a7e.js');
24
+ var Container = require('./Container-daf30918.js');
25
25
  var SingleList = require('./SingleList.js');
26
26
  var MultiList = require('./MultiList.js');
27
27
  var SingleDropdownList = require('./SingleDropdownList.js');
@@ -80,10 +80,12 @@ var _debounce = configureStore.helper.debounce,
80
80
  normalizeDataField = configureStore.helper.normalizeDataField;
81
81
  var SearchBox = {
82
82
  name: 'SearchBox',
83
+ isTagsMode: false,
83
84
  data: function data() {
84
85
  var props = this.$props;
85
86
  this.__state = {
86
87
  currentValue: '',
88
+ selectedTags: [],
87
89
  isOpen: false,
88
90
  normalizedSuggestions: []
89
91
  };
@@ -99,7 +101,16 @@ var SearchBox = {
99
101
  var _this$$props = this.$props,
100
102
  distinctField = _this$$props.distinctField,
101
103
  distinctFieldConfig = _this$$props.distinctFieldConfig,
102
- index = _this$$props.index;
104
+ index$1 = _this$$props.index,
105
+ mode = _this$$props.mode;
106
+
107
+ if (mode === constants.SEARCH_COMPONENTS_MODES.TAG) {
108
+ this.$options.isTagsMode = true;
109
+ }
110
+
111
+ if (this.$options.isTagsMode) {
112
+ console.warn('Warning(ReactiveSearch): The `categoryField` prop is not supported when `mode` prop is set to `tag`');
113
+ }
103
114
 
104
115
  if (this.enableAppbase && this.aggregationField && this.aggregationField !== '') {
105
116
  console.warn('Warning(ReactiveSearch): The `aggregationField` prop has been marked as deprecated, please use the `distinctField` prop instead.');
@@ -109,13 +120,17 @@ var SearchBox = {
109
120
  console.warn('Warning(ReactiveSearch): In order to use the `distinctField` and `distinctFieldConfig` props, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
110
121
  }
111
122
 
112
- if (!this.enableAppbase && index) {
123
+ if (!this.enableAppbase && index$1) {
113
124
  console.warn('Warning(ReactiveSearch): In order to use the `index` prop, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
114
125
  }
115
126
 
116
- this.currentValue = this.selectedValue || this.value || this.defaultValue || '';
117
- this.handleTextChange = _debounce(this.handleText, this.$props.debounce);
118
- this.setValue(this.currentValue, true, this.$props, undefined, false, this.selectedCategory); // Set custom and default queries in store
127
+ this.currentValue = index.decodeHtml(this.selectedValue || this.value || this.defaultValue || '');
128
+
129
+ if (this.$options.isTagsMode) {
130
+ this.currentValue = '';
131
+ }
132
+
133
+ this.handleTextChange = _debounce(this.handleText, this.$props.debounce); // Set custom and default queries in store
119
134
 
120
135
  this.triggerCustomQuery(this.currentValue, this.selectedCategory);
121
136
  this.triggerDefaultQuery(this.currentValue);
@@ -151,7 +166,7 @@ var SearchBox = {
151
166
  debounce: VueTypes.number.def(0),
152
167
  defaultValue: vueTypes.types.string,
153
168
  excludeFields: vueTypes.types.excludeFields,
154
- value: vueTypes.types.value,
169
+ value: VueTypes.oneOfType([VueTypes.arrayOf(VueTypes.string), vueTypes.types.value]),
155
170
  defaultSuggestions: vueTypes.types.suggestions,
156
171
  enableSynonyms: VueTypes.bool.def(true),
157
172
  enableQuerySuggestions: VueTypes.bool.def(false),
@@ -204,7 +219,20 @@ var SearchBox = {
204
219
  onData: vueTypes.types.func,
205
220
  renderItem: vueTypes.types.func,
206
221
  enterButton: VueTypes.bool.def(false),
207
- renderEnterButton: VueTypes.any
222
+ renderEnterButton: VueTypes.any,
223
+ mode: VueTypes.oneOf(['select', 'tag']).def('select'),
224
+ renderSelectedTags: VueTypes.any,
225
+ searchboxId: VueTypes.string,
226
+ endpoint: vueTypes.types.endpointConfig
227
+ },
228
+ beforeMount: function beforeMount() {
229
+ if (this.selectedValue) {
230
+ this.setValue(this.selectedValue, true, this.$props, this.$options.isTagsMode ? configureStore.causes.SUGGESTION_SELECT : undefined);
231
+ } else if (this.$props.value) {
232
+ this.setValue(this.$props.value, true, this.$props, this.$options.isTagsMode ? configureStore.causes.SUGGESTION_SELECT : undefined);
233
+ } else if (this.$props.defaultValue) {
234
+ this.setValue(this.$props.defaultValue, true, this.$props, this.$options.isTagsMode ? configureStore.causes.SUGGESTION_SELECT : undefined);
235
+ }
208
236
  },
209
237
  mounted: function mounted() {
210
238
  this.listenForFocusShortcuts();
@@ -254,15 +282,25 @@ var SearchBox = {
254
282
  this.normalizedSuggestions = suggestionsList;
255
283
  },
256
284
  selectedValue: function selectedValue(newVal, oldVal) {
257
- if (oldVal !== newVal && this.$data.currentValue !== newVal) {
285
+ if (!isEqual(newVal, oldVal) && (this.$options.isTagsMode ? !isEqual(this.$data.selectedTags, newVal) : this.$data.currentValue !== newVal)) {
258
286
  if (!newVal && this.$data.currentValue) {
259
287
  // selected value is cleared, call onValueSelected
260
288
  this.onValueSelectedHandler('', configureStore.causes.CLEAR_VALUE);
289
+ } // if (this.$props.value === undefined) {
290
+
291
+
292
+ if (this.$options.isTagsMode) {
293
+ // handling reset of tags through SelectedFilters or URL
294
+ this.selectedTags = [];
261
295
  }
262
296
 
263
- if (this.$props.value === undefined) {
264
- this.setValue(newVal || '', true, this.$props);
297
+ var cause = !newVal ? configureStore.causes.CLEAR_VALUE : undefined;
298
+
299
+ if (this.$options.isTagsMode) {
300
+ cause = configureStore.causes.SUGGESTION_SELECT;
265
301
  }
302
+
303
+ this.setValue(newVal || '', true, this.$props, cause); // }
266
304
  }
267
305
  },
268
306
  focusShortcuts: function focusShortcuts() {
@@ -403,7 +441,40 @@ var SearchBox = {
403
441
  }
404
442
 
405
443
  var performUpdate = function performUpdate() {
406
- _this.currentValue = value;
444
+ if (_this.$options.isTagsMode && isEqual(value, _this.selectedTags)) {
445
+ return;
446
+ }
447
+
448
+ if (_this.$options.isTagsMode && cause === configureStore.causes.SUGGESTION_SELECT) {
449
+ if (Array.isArray(_this.selectedTags) && _this.selectedTags.length) {
450
+ // check if value already present in selectedTags
451
+ if (typeof value === 'string' && _this.selectedTags.includes(value)) {
452
+ _this.isOpen = false;
453
+ return;
454
+ }
455
+
456
+ _this.selectedTags = [].concat(_this.selectedTags);
457
+
458
+ if (typeof value === 'string' && !!value) {
459
+ _this.selectedTags.push(value);
460
+ } else if (Array.isArray(value) && !isEqual(_this.selectedTags, value)) {
461
+ var mergedArray = Array.from(new Set([].concat(_this.selectedTags, value)));
462
+ _this.selectedTags = mergedArray;
463
+ }
464
+ } else if (value) {
465
+ _this.selectedTags = typeof value !== 'string' ? value : [].concat(value);
466
+ }
467
+
468
+ _this.currentValue = '';
469
+ } else {
470
+ _this.currentValue = index.decodeHtml(value);
471
+ }
472
+
473
+ var queryHandlerValue = value;
474
+
475
+ if (_this.$options.isTagsMode && cause === configureStore.causes.SUGGESTION_SELECT) {
476
+ queryHandlerValue = Array.isArray(_this.selectedTags) && _this.selectedTags.length ? _this.selectedTags : undefined;
477
+ }
407
478
 
408
479
  if (isDefaultValue) {
409
480
  if (_this.$props.autosuggest) {
@@ -411,19 +482,19 @@ var SearchBox = {
411
482
  _this.isOpen = false;
412
483
  }
413
484
 
414
- _this.triggerDefaultQuery(value);
485
+ if (typeof _this.currentValue === 'string') _this.triggerDefaultQuery(_this.currentValue);
415
486
  } // in case of strict selection only SUGGESTION_SELECT should be able
416
487
  // to set the query otherwise the value should reset
417
488
 
418
489
 
419
490
  if (props.strictSelection) {
420
- if (cause === configureStore.causes.SUGGESTION_SELECT || value === '') {
421
- _this.triggerCustomQuery(value, categoryValue);
491
+ if (cause === configureStore.causes.SUGGESTION_SELECT || (_this.$options.isTagsMode ? _this.selectedTags.length === 0 : value === '')) {
492
+ _this.triggerCustomQuery(queryHandlerValue, _this.$options.isTagsMode ? undefined : categoryValue);
422
493
  } else {
423
494
  _this.setValue('', true);
424
495
  }
425
- } else if (props.value === undefined) {
426
- _this.triggerCustomQuery(value, categoryValue);
496
+ } else if (props.value === undefined || cause === configureStore.causes.SUGGESTION_SELECT || cause === configureStore.causes.CLEAR_VALUE) {
497
+ _this.triggerCustomQuery(queryHandlerValue, _this.$options.isTagsMode ? undefined : categoryValue);
427
498
  }
428
499
  } else {
429
500
  // debounce for handling text while typing
@@ -474,6 +545,11 @@ var SearchBox = {
474
545
  showFilter = _this$$props2.showFilter,
475
546
  URLParams = _this$$props2.URLParams;
476
547
  var value = typeof paramValue !== 'string' ? this.$data.currentValue : paramValue;
548
+
549
+ if (this.$options.isTagsMode) {
550
+ value = paramValue;
551
+ }
552
+
477
553
  var defaultQueryTobeSet = SearchBox.defaultQuery("" + value + (categoryValue ? " in " + categoryValue : ''), this.$props);
478
554
  var query = defaultQueryTobeSet;
479
555
 
@@ -558,10 +634,19 @@ var SearchBox = {
558
634
  this.onValueSelectedHandler('', configureStore.causes.CLEAR_VALUE);
559
635
  },
560
636
  handleKeyDown: function handleKeyDown(event, highlightedIndex) {
637
+ if (highlightedIndex === void 0) {
638
+ highlightedIndex = null;
639
+ }
640
+
561
641
  // if a suggestion was selected, delegate the handling to suggestion handler
562
- if (event.key === 'Enter' && highlightedIndex === null) {
563
- this.setValue(event.target.value, true);
564
- this.onValueSelectedHandler(event.target.value, configureStore.causes.ENTER_PRESS);
642
+ if (event.key === 'Enter') {
643
+ if (this.$props.autosuggest === false) {
644
+ this.enterButtonOnClick();
645
+ } else if (highlightedIndex === null) {
646
+ this.setValue(event.target.value, true, this.$props, this.$options.isTagsMode ? configureStore.causes.SUGGESTION_SELECT : undefined // to handle tags
647
+ );
648
+ this.onValueSelectedHandler(event.target.value, configureStore.causes.ENTER_PRESS);
649
+ }
565
650
  } // Need to review
566
651
 
567
652
 
@@ -604,13 +689,29 @@ var SearchBox = {
604
689
  if (value === undefined) {
605
690
  this.setValue(suggestion.value, true, this.$props, configureStore.causes.SUGGESTION_SELECT, false, suggestion._category);
606
691
  } else {
607
- this.$emit('change', suggestion.value, function (_ref4) {
692
+ var emitValue = suggestion.value;
693
+
694
+ if (this.$options.isTagsMode) {
695
+ emitValue = Array.isArray(this.selectedTags) ? [].concat(this.selectedTags) : [];
696
+
697
+ if (this.selectedTags.includes(suggestion.value)) {
698
+ // avoid duplicates in tags array
699
+ this.isOpen = false;
700
+ return;
701
+ }
702
+
703
+ emitValue.push(suggestion.value);
704
+ }
705
+
706
+ this.setValue(emitValue, true, this.$props, configureStore.causes.SUGGESTION_SELECT, false, suggestion._category);
707
+ this.$emit('change', emitValue, function (_ref4) {
608
708
  var isOpen = _ref4.isOpen;
609
- return _this3.triggerQuery({
709
+ return _this3.triggerQuery(_rollupPluginBabelHelpers._extends({
610
710
  isOpen: isOpen,
611
- value: suggestion.value,
711
+ value: emitValue
712
+ }, !_this3.$options.isTagsMode && {
612
713
  categoryValue: suggestion._category
613
- });
714
+ }));
614
715
  });
615
716
  }
616
717
 
@@ -733,6 +834,13 @@ var SearchBox = {
733
834
 
734
835
  return null;
735
836
  },
837
+ enterButtonOnClick: function enterButtonOnClick() {
838
+ this.triggerQuery({
839
+ isOpen: false,
840
+ value: this.currentValue,
841
+ customQuery: true
842
+ });
843
+ },
736
844
  renderEnterButtonElement: function renderEnterButtonElement() {
737
845
  var _this4 = this;
738
846
 
@@ -742,27 +850,19 @@ var SearchBox = {
742
850
  innerClass = _this$$props4.innerClass;
743
851
  var renderEnterButton = this.$scopedSlots.renderEnterButton;
744
852
 
745
- var enterButtonOnClick = function enterButtonOnClick() {
746
- return _this4.triggerQuery({
747
- isOpen: false,
748
- value: _this4.currentValue,
749
- customQuery: true
750
- });
751
- };
752
-
753
853
  if (enterButton) {
754
854
  var getEnterButtonMarkup = function getEnterButtonMarkup() {
755
855
  if (renderEnterButton) {
756
- return renderEnterButton(enterButtonOnClick);
856
+ return renderEnterButton(_this4.enterButtonOnClick);
757
857
  }
758
858
 
759
859
  return h(Button.Button, {
760
- "class": "enter-btn " + getClassName(innerClass, 'enterButton'),
860
+ "class": "enter-btn " + getClassName(innerClass, 'enter-button'),
761
861
  "attrs": {
762
862
  "primary": true
763
863
  },
764
864
  "on": {
765
- "click": enterButtonOnClick
865
+ "click": _this4.enterButtonOnClick
766
866
  }
767
867
  }, ["Search"]);
768
868
  };
@@ -873,7 +973,7 @@ var SearchBox = {
873
973
  onAutofillClick: function onAutofillClick(suggestion) {
874
974
  var value = suggestion.value;
875
975
  this.isOpen = true;
876
- this.currentValue = value;
976
+ this.currentValue = index.decodeHtml(value);
877
977
  this.triggerDefaultQuery(value);
878
978
  },
879
979
  renderAutoFill: function renderAutoFill(suggestion) {
@@ -894,10 +994,79 @@ var SearchBox = {
894
994
  "click": handleAutoFillClick
895
995
  }
896
996
  });
997
+ },
998
+ renderTag: function renderTag(item) {
999
+ var _this7 = this;
1000
+
1001
+ var h = this.$createElement;
1002
+ var innerClass = this.$props.innerClass;
1003
+ return h(DataSearch.TagItem, {
1004
+ "class": getClassName(innerClass, 'selected-tag') || ''
1005
+ }, [h("span", [item]), h("span", {
1006
+ "attrs": {
1007
+ "role": "img",
1008
+ "aria-label": "delete-tag"
1009
+ },
1010
+ "class": "close-icon",
1011
+ "on": {
1012
+ "click": function click() {
1013
+ return _this7.clearTag(item);
1014
+ }
1015
+ }
1016
+ }, [h(CancelSvg.CancelSvg)])]);
1017
+ },
1018
+ clearAllTags: function clearAllTags() {
1019
+ this.selectedTags = [];
1020
+ this.setValue('', true, this.$props, configureStore.causes.SUGGESTION_SELECT);
1021
+
1022
+ if (this.$props.value !== undefined) {
1023
+ this.$emit('change', this.selectedTags, this.triggerQuery);
1024
+ }
1025
+ },
1026
+ clearTag: function clearTag(tagValue) {
1027
+ this.selectedTags = [].concat(this.selectedTags.filter(function (tag) {
1028
+ return tag !== tagValue;
1029
+ }));
1030
+ this.setValue('', true, this.$props, configureStore.causes.SUGGESTION_SELECT);
1031
+
1032
+ if (this.$props.value !== undefined) {
1033
+ this.$emit('change', this.selectedTags, this.triggerQuery);
1034
+ }
1035
+ },
1036
+ renderTags: function renderTags() {
1037
+ var _this8 = this;
1038
+
1039
+ var h = this.$createElement;
1040
+
1041
+ if (!Array.isArray(this.selectedTags)) {
1042
+ return null;
1043
+ }
1044
+
1045
+ var tagsList = [].concat(this.selectedTags);
1046
+ var shouldRenderClearAllTag = tagsList.length > 1;
1047
+ var renderSelectedTags = this.$scopedSlots.renderSelectedTags || this.$props.renderSelectedTags;
1048
+ return renderSelectedTags ? renderSelectedTags({
1049
+ values: this.selectedTags,
1050
+ handleClear: this.clearTag,
1051
+ handleClearAll: this.clearAllTags
1052
+ }) : h(DataSearch.TagsContainer, [tagsList.map(function (item) {
1053
+ return _this8.renderTag(item);
1054
+ }), shouldRenderClearAllTag && h(DataSearch.TagItem, {
1055
+ "class": getClassName(this.$props.innerClass, 'selected-tag') || ''
1056
+ }, [h("span", ["Clear All"]), h("span", {
1057
+ "attrs": {
1058
+ "role": "img",
1059
+ "aria-label": "delete-tag"
1060
+ },
1061
+ "class": "close-icon",
1062
+ "on": {
1063
+ "click": this.clearAllTags
1064
+ }
1065
+ }, [h(CancelSvg.CancelSvg)])])]);
897
1066
  }
898
1067
  },
899
1068
  render: function render() {
900
- var _this7 = this;
1069
+ var _this9 = this;
901
1070
 
902
1071
  var h = arguments[0];
903
1072
  var _this$$props6 = this.$props,
@@ -943,14 +1112,14 @@ var SearchBox = {
943
1112
  }
944
1113
  };
945
1114
 
946
- return h("div", [_this7.hasCustomRenderer && _this7.getComponent({
1115
+ return h("div", [_this9.hasCustomRenderer && _this9.getComponent({
947
1116
  isOpen: isOpen,
948
1117
  getItemProps: getItemProps,
949
1118
  getItemEvents: getItemEvents,
950
1119
  highlightedIndex: highlightedIndex
951
- }), _this7.renderErrorComponent(), !_this7.hasCustomRenderer && isOpen && hasSuggestions ? h("ul", {
952
- "class": Input.suggestions(_this7.themePreset, theme) + " " + getClassName(_this7.$props.innerClass, 'list')
953
- }, [_this7.normalizedSuggestions.map(function (item, index) {
1120
+ }), _this9.renderErrorComponent(), !_this9.hasCustomRenderer && isOpen && hasSuggestions ? h("ul", {
1121
+ "class": Input.suggestions(_this9.themePreset, theme) + " " + getClassName(_this9.$props.innerClass, 'list')
1122
+ }, [_this9.normalizedSuggestions.map(function (item, index) {
954
1123
  return renderItem ? h("li", {
955
1124
  "domProps": _rollupPluginBabelHelpers._extends({}, getItemProps({
956
1125
  item: item
@@ -960,7 +1129,7 @@ var SearchBox = {
960
1129
  })),
961
1130
  "key": index + 1 + "-" + item.value,
962
1131
  "style": {
963
- backgroundColor: _this7.getBackgroundColor(highlightedIndex, index),
1132
+ backgroundColor: _this9.getBackgroundColor(highlightedIndex, index),
964
1133
  justifyContent: 'flex-start',
965
1134
  alignItems: 'center'
966
1135
  }
@@ -973,7 +1142,7 @@ var SearchBox = {
973
1142
  })),
974
1143
  "key": index + 1 + "-" + item.value,
975
1144
  "style": {
976
- backgroundColor: _this7.getBackgroundColor(highlightedIndex, index),
1145
+ backgroundColor: _this9.getBackgroundColor(highlightedIndex, index),
977
1146
  justifyContent: 'flex-start',
978
1147
  alignItems: 'center'
979
1148
  }
@@ -984,61 +1153,61 @@ var SearchBox = {
984
1153
  }
985
1154
  }, [h(DataSearch.CustomSvg, {
986
1155
  "attrs": {
987
- "className": getClassName(_this7.$props.innerClass, item._suggestion_type + "-search-icon") || null,
1156
+ "className": getClassName(_this9.$props.innerClass, item._suggestion_type + "-search-icon") || null,
988
1157
  "icon": getIcon(item._suggestion_type),
989
1158
  "type": item._suggestion_type + "-search-icon"
990
1159
  }
991
1160
  })]), h(DataSearch.SuggestionItem, {
992
1161
  "attrs": {
993
- "currentValue": _this7.currentValue,
1162
+ "currentValue": _this9.currentValue,
994
1163
  "suggestion": item
995
1164
  }
996
- }), _this7.renderAutoFill(item)]);
997
- })]) : _this7.renderNoSuggestions(_this7.normalizedSuggestions)]);
1165
+ }), _this9.renderAutoFill(item)]);
1166
+ })]) : _this9.renderNoSuggestions(_this9.normalizedSuggestions)]);
998
1167
  };
999
1168
 
1000
1169
  return h("div", {
1001
1170
  "class": Input.suggestionsContainer
1002
- }, [h(DataSearch.InputGroup, [_this7.renderInputAddonBefore(), h(CancelSvg.InputWrapper, [h(Input.Input, {
1171
+ }, [h(DataSearch.InputGroup, [_this9.renderInputAddonBefore(), h(CancelSvg.InputWrapper, [h(Input.Input, {
1003
1172
  "attrs": {
1004
- "id": _this7.$props.componentId + "-input",
1005
- "showIcon": _this7.$props.showIcon,
1006
- "showClear": _this7.$props.showClear,
1007
- "iconPosition": _this7.$props.iconPosition,
1008
- "placeholder": _this7.$props.placeholder,
1009
- "autoFocus": _this7.$props.autoFocus,
1010
- "themePreset": _this7.themePreset,
1173
+ "id": _this9.$props.componentId + "-input",
1174
+ "showIcon": _this9.$props.showIcon,
1175
+ "showClear": _this9.$props.showClear,
1176
+ "iconPosition": _this9.$props.iconPosition,
1177
+ "placeholder": _this9.$props.placeholder,
1178
+ "autoFocus": _this9.$props.autoFocus,
1179
+ "themePreset": _this9.themePreset,
1011
1180
  "autocomplete": "off"
1012
1181
  },
1013
- "ref": _this7.$props.innerRef,
1014
- "class": getClassName(_this7.$props.innerClass, 'input'),
1182
+ "ref": _this9.$props.innerRef,
1183
+ "class": getClassName(_this9.$props.innerClass, 'input'),
1015
1184
  "on": _rollupPluginBabelHelpers._extends({}, getInputEvents({
1016
- onInput: _this7.onInputChange,
1185
+ onInput: _this9.onInputChange,
1017
1186
  onBlur: function onBlur(e) {
1018
- _this7.$emit('blur', e, _this7.triggerQuery);
1187
+ _this9.$emit('blur', e, _this9.triggerQuery);
1019
1188
  },
1020
- onFocus: _this7.handleFocus,
1189
+ onFocus: _this9.handleFocus,
1021
1190
  onKeyPress: function onKeyPress(e) {
1022
- _this7.$emit('keyPress', e, _this7.triggerQuery);
1191
+ _this9.$emit('keyPress', e, _this9.triggerQuery);
1023
1192
 
1024
- _this7.$emit('key-press', e, _this7.triggerQuery);
1193
+ _this9.$emit('key-press', e, _this9.triggerQuery);
1025
1194
  },
1026
1195
  onKeyDown: function onKeyDown(e) {
1027
- return _this7.handleKeyDown(e, highlightedIndex);
1196
+ return _this9.handleKeyDown(e, highlightedIndex);
1028
1197
  },
1029
1198
  onKeyUp: function onKeyUp(e) {
1030
- _this7.$emit('keyUp', e, _this7.triggerQuery);
1199
+ _this9.$emit('keyUp', e, _this9.triggerQuery);
1031
1200
 
1032
- _this7.$emit('key-up', e, _this7.triggerQuery);
1201
+ _this9.$emit('key-up', e, _this9.triggerQuery);
1033
1202
  },
1034
1203
  onClick: function onClick() {
1035
1204
  setHighlightedIndex(null);
1036
1205
  }
1037
1206
  })),
1038
1207
  "domProps": _rollupPluginBabelHelpers._extends({}, getInputProps({
1039
- value: _this7.$data.currentValue === null ? '' : _this7.$data.currentValue
1208
+ value: _this9.$data.currentValue === null ? '' : _this9.$data.currentValue
1040
1209
  }))
1041
- }), _this7.renderIcons(), !expandSuggestionsContainer && renderSuggestionsDropdown()]), _this7.renderInputAddonAfter(), _this7.renderEnterButtonElement()]), expandSuggestionsContainer && renderSuggestionsDropdown()]);
1210
+ }), _this9.renderIcons(), !expandSuggestionsContainer && renderSuggestionsDropdown()]), _this9.renderInputAddonAfter(), _this9.renderEnterButtonElement()]), expandSuggestionsContainer && renderSuggestionsDropdown(), _this9.renderTags()]);
1042
1211
  }
1043
1212
  }
1044
1213
  }) : h("div", {
@@ -1054,26 +1223,22 @@ var SearchBox = {
1054
1223
  },
1055
1224
  "on": _rollupPluginBabelHelpers._extends({}, {
1056
1225
  blur: function blur(e) {
1057
- _this7.$emit('blur', e, _this7.triggerQuery);
1226
+ _this9.$emit('blur', e, _this9.triggerQuery);
1058
1227
  },
1059
1228
  keypress: function keypress(e) {
1060
- _this7.$emit('keyPress', e, _this7.triggerQuery);
1229
+ _this9.$emit('keyPress', e, _this9.triggerQuery);
1061
1230
 
1062
- _this7.$emit('key-press', e, _this7.triggerQuery);
1231
+ _this9.$emit('key-press', e, _this9.triggerQuery);
1063
1232
  },
1064
1233
  input: this.onInputChange,
1065
1234
  focus: function focus(e) {
1066
- _this7.$emit('focus', e, _this7.triggerQuery);
1067
- },
1068
- keydown: function keydown(e) {
1069
- _this7.$emit('keyDown', e, _this7.triggerQuery);
1070
-
1071
- _this7.$emit('key-down', e, _this7.triggerQuery);
1235
+ _this9.$emit('focus', e, _this9.triggerQuery);
1072
1236
  },
1237
+ keydown: this.handleKeyDown,
1073
1238
  keyup: function keyup(e) {
1074
- _this7.$emit('keyUp', e, _this7.triggerQuery);
1239
+ _this9.$emit('keyUp', e, _this9.triggerQuery);
1075
1240
 
1076
- _this7.$emit('key-up', e, _this7.triggerQuery);
1241
+ _this9.$emit('key-up', e, _this9.triggerQuery);
1077
1242
  }
1078
1243
  }),
1079
1244
  "domProps": _rollupPluginBabelHelpers._extends({}, {
@@ -3,43 +3,44 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  require('@appbaseio/reactivecore');
6
- require('./_rollupPluginBabelHelpers-f127c8b7.js');
6
+ require('./_rollupPluginBabelHelpers-c705cbe6.js');
7
7
  require('vue-types');
8
8
  require('@appbaseio/reactivecore/lib/utils/constants');
9
9
  require('@appbaseio/reactivecore/lib/utils/helper');
10
10
  require('emotion');
11
11
  require('@appbaseio/vue-emotion');
12
12
  require('polished');
13
- require('./Button-e0b7c1f6.js');
14
- require('./vueTypes-57d01f18.js');
13
+ require('./Button-446f819e.js');
14
+ require('./vueTypes-727b7c63.js');
15
+ require('./Pagination-71e85fa9.js');
15
16
  require('./ReactiveList.js');
16
17
  require('@appbaseio/reactivecore/lib/utils/transform');
17
18
  require('redux');
18
- require('./index-4509aa45.js');
19
- require('./ComponentWrapper-10bad289.js');
19
+ require('./index-6a167fe0.js');
20
+ require('./ComponentWrapper-ad3dad02.js');
20
21
  require('@vue/babel-helper-vue-jsx-merge-props');
21
- require('./Title-584a8cc8.js');
22
- require('./ListItem-b40adb04.js');
23
- require('./Card-fd94ef07.js');
24
- require('./Flex-f146cdad.js');
22
+ require('./Title-1de7d0f4.js');
23
+ require('./ListItem-8c9e0d68.js');
24
+ require('./Card-642547a8.js');
25
+ require('./Flex-aa517a13.js');
25
26
  require('@appbaseio/reactivecore/lib/actions/analytics');
26
27
  require('appbase-js');
27
28
  require('url-search-params-polyfill');
28
29
  require('./ReactiveBase.js');
29
30
  require('hotkeys-js');
30
- require('./DataSearch-eec21890.js');
31
- require('./CancelSvg-4aa35935.js');
32
- require('./Input-0d7b25ad.js');
31
+ require('./DataSearch-6cf29cf0.js');
32
+ require('./CancelSvg-9f258f4f.js');
33
+ require('./Input-e6603a7e.js');
33
34
  require('compute-scroll-into-view');
34
- require('./Container-526efa6a.js');
35
+ require('./Container-daf30918.js');
35
36
  require('vue-highlight-words');
36
- var install = require('./install-4886582d.js');
37
+ var install = require('./install-99716d95.js');
37
38
  require('@appbaseio/reactivecore/lib/utils/suggestions');
38
- require('./FormControlList-808dbcef.js');
39
- require('./utils-1219e1fe.js');
39
+ require('./FormControlList-c195a592.js');
40
+ require('./utils-d6a52588.js');
40
41
  require('./SingleList.js');
41
42
  require('./MultiList.js');
42
- require('./DropDown-e4381fcc.js');
43
+ require('./DropDown-c479bbb0.js');
43
44
  require('./SingleDropdownList.js');
44
45
  require('./MultiDropdownList.js');
45
46
  require('./ToggleButton.js');
@@ -50,9 +51,10 @@ require('./MultiRange.js');
50
51
  require('./ResultCard.js');
51
52
  require('./ResultList.js');
52
53
  require('vue-no-ssr');
53
- require('./ssr-0ee35a09.js');
54
+ require('./ssr-3027b848.js');
54
55
  require('./RangeSlider.js');
55
56
  require('./DynamicRangeSlider.js');
57
+ require('@appbaseio/reactivecore/lib/actions/value');
56
58
  require('./StateProvider.js');
57
59
  require('./RangeInput.js');
58
60
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
4
4
 
5
- var _rollupPluginBabelHelpers = require('./_rollupPluginBabelHelpers-f127c8b7.js');
5
+ var _rollupPluginBabelHelpers = require('./_rollupPluginBabelHelpers-c705cbe6.js');
6
6
  var styled = require('@appbaseio/vue-emotion');
7
7
  var styled__default = _interopDefault(styled);
8
8
  var NoSSR = _interopDefault(require('vue-no-ssr'));
@@ -4,7 +4,7 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'defau
4
4
 
5
5
  var configureStore = require('@appbaseio/reactivecore');
6
6
  var configureStore__default = _interopDefault(configureStore);
7
- var _rollupPluginBabelHelpers = require('./_rollupPluginBabelHelpers-f127c8b7.js');
7
+ var _rollupPluginBabelHelpers = require('./_rollupPluginBabelHelpers-c705cbe6.js');
8
8
 
9
9
  var getAggsOrder = configureStore.helper.getAggsOrder;
10
10