@appbaseio/reactivesearch-vue 1.29.0 → 1.30.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/dist/@appbaseio/reactivesearch-vue.umd.js +1238 -545
  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/{Button-e0b7c1f6.js → Button-0e2e2c02.js} +1 -1
  6. package/dist/cjs/{CancelSvg-4aa35935.js → CancelSvg-c48c1085.js} +1 -1
  7. package/dist/cjs/{Card-fd94ef07.js → Card-4fa0f769.js} +2 -2
  8. package/dist/cjs/{ComponentWrapper-10bad289.js → ComponentWrapper-5cb08414.js} +2 -2
  9. package/dist/cjs/{Container-526efa6a.js → Container-cfd69a34.js} +1 -1
  10. package/dist/cjs/{DataSearch-eec21890.js → DataSearch-e550096e.js} +234 -83
  11. package/dist/cjs/DataSearch.js +9 -9
  12. package/dist/cjs/{DropDown-e4381fcc.js → DropDown-fc59f1ee.js} +4 -4
  13. package/dist/cjs/DynamicRangeSlider.js +5 -5
  14. package/dist/cjs/{Flex-f146cdad.js → Flex-63774e4d.js} +1 -1
  15. package/dist/cjs/{FormControlList-808dbcef.js → FormControlList-a9c64bb8.js} +1 -1
  16. package/dist/cjs/{Input-0d7b25ad.js → Input-43868594.js} +1 -1
  17. package/dist/cjs/{ListItem-b40adb04.js → ListItem-38962297.js} +2 -2
  18. package/dist/cjs/MultiDropdownList.js +10 -10
  19. package/dist/cjs/MultiList.js +8 -8
  20. package/dist/cjs/MultiRange.js +6 -6
  21. package/dist/cjs/RangeInput.js +8 -8
  22. package/dist/cjs/RangeSlider.js +6 -6
  23. package/dist/cjs/ReactiveBase.js +34 -24
  24. package/dist/cjs/ReactiveComponent.js +3 -3
  25. package/dist/cjs/ReactiveList.js +9 -8
  26. package/dist/cjs/ResultCard.js +3 -3
  27. package/dist/cjs/ResultList.js +3 -3
  28. package/dist/cjs/SelectedFilters.js +44 -27
  29. package/dist/cjs/SingleDropdownList.js +10 -10
  30. package/dist/cjs/SingleList.js +8 -8
  31. package/dist/cjs/SingleRange.js +7 -7
  32. package/dist/cjs/StateProvider.js +30 -5
  33. package/dist/cjs/{Title-584a8cc8.js → Title-26661936.js} +1 -1
  34. package/dist/cjs/ToggleButton.js +7 -6
  35. package/dist/cjs/{_rollupPluginBabelHelpers-f127c8b7.js → _rollupPluginBabelHelpers-91d4b5a6.js} +1 -2
  36. package/dist/cjs/{index-4509aa45.js → index-2cd3650b.js} +1 -1
  37. package/dist/cjs/index.js +18 -17
  38. package/dist/cjs/initReactivesearch.js +2 -2
  39. package/dist/cjs/{install-4886582d.js → install-250a14f1.js} +246 -83
  40. package/dist/cjs/install.js +18 -17
  41. package/dist/cjs/{ssr-0ee35a09.js → ssr-949cafb5.js} +1 -1
  42. package/dist/cjs/{utils-1219e1fe.js → utils-0df3cb93.js} +1 -1
  43. package/dist/cjs/version.js +1 -1
  44. package/dist/es/{Button-33de88e6.js → Button-e18ad90f.js} +1 -1
  45. package/dist/es/{CancelSvg-c2c03a35.js → CancelSvg-e3b33cdd.js} +1 -1
  46. package/dist/es/{Card-6446f1b7.js → Card-ad6ba09f.js} +2 -2
  47. package/dist/es/{ComponentWrapper-0f3431d1.js → ComponentWrapper-dc92772a.js} +2 -2
  48. package/dist/es/{Container-18b03fde.js → Container-421450dc.js} +1 -1
  49. package/dist/es/{DataSearch-42f547cd.js → DataSearch-8e5d0972.js} +234 -85
  50. package/dist/es/DataSearch.js +9 -9
  51. package/dist/es/{DropDown-ff6ad982.js → DropDown-565fad6f.js} +4 -4
  52. package/dist/es/DynamicRangeSlider.js +5 -5
  53. package/dist/es/{Flex-8770345d.js → Flex-09d40927.js} +1 -1
  54. package/dist/es/{FormControlList-704f8dee.js → FormControlList-38ffe3d3.js} +1 -1
  55. package/dist/es/{Input-e339e63a.js → Input-c9d757bc.js} +1 -1
  56. package/dist/es/{ListItem-8e8fb535.js → ListItem-41d6ddd7.js} +2 -2
  57. package/dist/es/MultiDropdownList.js +10 -10
  58. package/dist/es/MultiList.js +8 -8
  59. package/dist/es/MultiRange.js +6 -6
  60. package/dist/es/RangeInput.js +8 -8
  61. package/dist/es/RangeSlider.js +6 -6
  62. package/dist/es/ReactiveBase.js +34 -24
  63. package/dist/es/ReactiveComponent.js +3 -3
  64. package/dist/es/ReactiveList.js +9 -8
  65. package/dist/es/ResultCard.js +3 -3
  66. package/dist/es/ResultList.js +3 -3
  67. package/dist/es/SelectedFilters.js +44 -27
  68. package/dist/es/SingleDropdownList.js +10 -10
  69. package/dist/es/SingleList.js +8 -8
  70. package/dist/es/SingleRange.js +7 -7
  71. package/dist/es/StateProvider.js +30 -5
  72. package/dist/es/{Title-3522ff56.js → Title-35edd732.js} +1 -1
  73. package/dist/es/ToggleButton.js +7 -6
  74. package/dist/es/{_rollupPluginBabelHelpers-0f24d612.js → _rollupPluginBabelHelpers-51ce1182.js} +1 -2
  75. package/dist/es/{index-78920565.js → index-5371a13f.js} +1 -1
  76. package/dist/es/index.js +19 -18
  77. package/dist/es/initReactivesearch.js +2 -2
  78. package/dist/es/{install-54ebd72e.js → install-9faa87f1.js} +247 -84
  79. package/dist/es/install.js +18 -17
  80. package/dist/es/{ssr-a41dfea9.js → ssr-ad57b0ad.js} +1 -1
  81. package/dist/es/{utils-64a2e5f0.js → utils-9b45e0ab.js} +1 -1
  82. package/dist/es/version.js +1 -1
  83. package/package.json +3 -3
@@ -4,21 +4,21 @@ 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-91d4b5a6.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
13
  var vueTypes = require('./vueTypes-57d01f18.js');
14
- var index = require('./index-4509aa45.js');
15
- var ComponentWrapper = require('./ComponentWrapper-10bad289.js');
16
- var Title = require('./Title-584a8cc8.js');
17
- var Flex = require('./Flex-f146cdad.js');
14
+ var index = require('./index-2cd3650b.js');
15
+ var ComponentWrapper = require('./ComponentWrapper-5cb08414.js');
16
+ var Title = require('./Title-26661936.js');
17
+ var Flex = require('./Flex-63774e4d.js');
18
18
  var hotkeys = _interopDefault(require('hotkeys-js'));
19
- var CancelSvg = require('./CancelSvg-4aa35935.js');
20
- var Input = require('./Input-0d7b25ad.js');
21
- var Container = require('./Container-526efa6a.js');
19
+ var CancelSvg = require('./CancelSvg-c48c1085.js');
20
+ var Input = require('./Input-43868594.js');
21
+ var Container = require('./Container-cfd69a34.js');
22
22
  var Highlight = _interopDefault(require('vue-highlight-words'));
23
23
 
24
24
  var _templateObject;
@@ -904,6 +904,10 @@ var CustomSvg = {
904
904
  }
905
905
  };
906
906
 
907
+ var _templateObject$6, _templateObject2;
908
+ var TagsContainer = styled__default('div')(_templateObject$6 || (_templateObject$6 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tmargin-top: 10px;\n\twidth: 100%;\n"])));
909
+ var TagItem = styled__default('span')(_templateObject2 || (_templateObject2 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tcursor: default;\n\tbox-sizing: border-box;\n\tmargin: 0 4px 4px 0;\n\tcolor: #000000d9;\n\tfont-size: 14px;\n\tfont-variant: tabular-nums;\n\tline-height: 1.5715;\n\tlist-style: none;\n\tfont-feature-settings: 'tnum';\n\tdisplay: inline-block;\n\theight: auto;\n\tpadding: 0 2px 0 7px;\n\tfont-size: 12px;\n\tline-height: 22px;\n\twhite-space: nowrap;\n\tbackground: #fafafa;\n\tborder: 1px solid #d9d9d9;\n\tborder-radius: 2px;\n\topacity: 1;\n\ttransition: all 0.3s;\n\n\tspan.close-icon {\n\t\tsvg {\n\t\t\tcursor: pointer;\n\t\t\theight: 15px;\n\t\t\tposition: relative;\n\t\t\ttop: 4px;\n\t\t\tfill: #262626;\n\t\t}\n\t}\n"])));
910
+
907
911
  var updateQuery = configureStore.Actions.updateQuery,
908
912
  setQueryOptions = configureStore.Actions.setQueryOptions,
909
913
  setCustomQuery = configureStore.Actions.setCustomQuery,
@@ -911,7 +915,8 @@ var updateQuery = configureStore.Actions.updateQuery,
911
915
  setCustomHighlightOptions = configureStore.Actions.setCustomHighlightOptions,
912
916
  recordSuggestionClick = configureStore.Actions.recordSuggestionClick,
913
917
  loadPopularSuggestions = configureStore.Actions.loadPopularSuggestions,
914
- getRecentSearches = configureStore.Actions.getRecentSearches;
918
+ getRecentSearches = configureStore.Actions.getRecentSearches,
919
+ resetStoreForComponent = configureStore.Actions.resetStoreForComponent;
915
920
  var debounce = configureStore.helper.debounce,
916
921
  checkValueChange = configureStore.helper.checkValueChange,
917
922
  getClassName$1 = configureStore.helper.getClassName,
@@ -926,10 +931,12 @@ var debounce = configureStore.helper.debounce,
926
931
  normalizeDataField = configureStore.helper.normalizeDataField;
927
932
  var DataSearch = {
928
933
  name: 'DataSearch',
934
+ isTagsMode: false,
929
935
  data: function data() {
930
936
  var props = this.$props;
931
937
  this.__state = {
932
938
  currentValue: '',
939
+ selectedTags: [],
933
940
  isOpen: false,
934
941
  normalizedSuggestions: [],
935
942
  isPending: false
@@ -949,7 +956,13 @@ var DataSearch = {
949
956
  enableRecentSearches = _this$$props.enableRecentSearches,
950
957
  distinctField = _this$$props.distinctField,
951
958
  distinctFieldConfig = _this$$props.distinctFieldConfig,
952
- index$1 = _this$$props.index; // TODO: Remove in 2.0
959
+ index$1 = _this$$props.index,
960
+ mode = _this$$props.mode;
961
+
962
+ if (mode === constants.SEARCH_COMPONENTS_MODES.TAG) {
963
+ this.$options.isTagsMode = true;
964
+ } // TODO: Remove in 2.0
965
+
953
966
 
954
967
  if (enableQuerySuggestions) {
955
968
  console.warn('Warning(ReactiveSearch): The `enableQuerySuggestions` prop has been marked as deprecated, please use the `enablePopularSuggestions` prop instead.');
@@ -972,7 +985,12 @@ var DataSearch = {
972
985
  console.warn('Warning(ReactiveSearch): In order to use the `index` prop, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
973
986
  }
974
987
 
975
- this.currentValue = this.selectedValue || '';
988
+ this.currentValue = '';
989
+
990
+ if (this.$options.isTagsMode) {
991
+ this.currentValue = '';
992
+ }
993
+
976
994
  var shouldFetchInitialSuggestions = this.$props.enableDefaultSuggestions || this.currentValue;
977
995
 
978
996
  if (shouldFetchInitialSuggestions) {
@@ -1066,7 +1084,7 @@ var DataSearch = {
1066
1084
  debounce: VueTypes.number.def(0),
1067
1085
  defaultValue: vueTypes.types.string,
1068
1086
  excludeFields: vueTypes.types.excludeFields,
1069
- value: vueTypes.types.value,
1087
+ value: VueTypes.oneOfType([VueTypes.arrayOf(VueTypes.string), vueTypes.types.value]),
1070
1088
  defaultSuggestions: vueTypes.types.suggestions,
1071
1089
  enableSynonyms: VueTypes.bool.def(true),
1072
1090
  enableQuerySuggestions: VueTypes.bool.def(false),
@@ -1115,7 +1133,9 @@ var DataSearch = {
1115
1133
  addonAfter: VueTypes.any,
1116
1134
  expandSuggestionsContainer: VueTypes.bool.def(true),
1117
1135
  index: VueTypes.string,
1118
- enableDefaultSuggestions: VueTypes.bool.def(true)
1136
+ enableDefaultSuggestions: VueTypes.bool.def(true),
1137
+ mode: VueTypes.oneOf(['select', 'tag']).def('select'),
1138
+ renderSelectedTags: VueTypes.any
1119
1139
  },
1120
1140
  beforeMount: function beforeMount() {
1121
1141
  if (this.$props.highlight) {
@@ -1132,11 +1152,11 @@ var DataSearch = {
1132
1152
  }
1133
1153
 
1134
1154
  if (this.selectedValue) {
1135
- this.setValue(this.selectedValue, true);
1155
+ this.setValue(this.selectedValue, true, this.$props, this.$options.isTagsMode ? configureStore.causes.SUGGESTION_SELECT : undefined);
1136
1156
  } else if (this.$props.value) {
1137
- this.setValue(this.$props.value, true);
1157
+ this.setValue(this.$props.value, true, this.$props, this.$options.isTagsMode ? configureStore.causes.SUGGESTION_SELECT : undefined);
1138
1158
  } else if (this.$props.defaultValue) {
1139
- this.setValue(this.$props.defaultValue, true);
1159
+ this.setValue(this.$props.defaultValue, true, this.$props, this.$options.isTagsMode ? configureStore.causes.SUGGESTION_SELECT : undefined);
1140
1160
  }
1141
1161
  },
1142
1162
  mounted: function mounted() {
@@ -1148,19 +1168,19 @@ var DataSearch = {
1148
1168
  },
1149
1169
  dataField: function dataField() {
1150
1170
  this.updateQueryOptions();
1151
- this.updateQueryHandler(this.$props.componentId, this.$data.currentValue, this.$props);
1171
+ this.updateQueryHandler(this.$props.componentId, this.$options.isTagsMode ? this.$data.selectedTags : this.$data.currentValue, this.$props);
1152
1172
  },
1153
1173
  highlightField: function highlightField() {
1154
1174
  this.updateQueryOptions();
1155
1175
  },
1156
1176
  fieldWeights: function fieldWeights() {
1157
- this.updateQueryHandler(this.$props.componentId, this.$data.currentValue, this.$props);
1177
+ this.updateQueryHandler(this.$props.componentId, this.$options.isTagsMode ? this.$data.selectedTags : this.$data.currentValue, this.$props);
1158
1178
  },
1159
1179
  fuzziness: function fuzziness() {
1160
- this.updateQueryHandler(this.$props.componentId, this.$data.currentValue, this.$props);
1180
+ this.updateQueryHandler(this.$props.componentId, this.$options.isTagsMode ? this.$data.selectedTags : this.$data.currentValue, this.$props);
1161
1181
  },
1162
1182
  queryFormat: function queryFormat() {
1163
- this.updateQueryHandler(this.$props.componentId, this.$data.currentValue, this.$props);
1183
+ this.updateQueryHandler(this.$props.componentId, this.$options.isTagsMode ? this.$data.selectedTags : this.$data.currentValue, this.$props);
1164
1184
  },
1165
1185
  defaultValue: function defaultValue(newVal) {
1166
1186
  this.setValue(newVal, true, this.$props);
@@ -1189,13 +1209,18 @@ var DataSearch = {
1189
1209
  }
1190
1210
  },
1191
1211
  selectedValue: function selectedValue(newVal, oldVal) {
1192
- if (oldVal !== newVal && this.$data.currentValue !== newVal) {
1212
+ if (!isEqual(newVal, oldVal) && (this.$options.isTagsMode ? !isEqual(this.$data.selectedTags, newVal) : this.$data.currentValue !== newVal)) {
1193
1213
  if (!newVal && this.$data.currentValue) {
1194
1214
  // selected value is cleared, call onValueSelected
1195
1215
  this.onValueSelectedHandler('', configureStore.causes.CLEAR_VALUE);
1196
1216
  }
1197
1217
 
1198
- this.setValue(newVal || '', true, this.$props);
1218
+ if (this.$options.isTagsMode) {
1219
+ // handling reset of tags through SelectedFilters or URL
1220
+ this.selectedTags = [];
1221
+ }
1222
+
1223
+ this.setValue(newVal || '', true, this.$props, this.$options.isTagsMode ? configureStore.causes.SUGGESTION_SELECT : undefined);
1199
1224
  }
1200
1225
  },
1201
1226
  focusShortcuts: function focusShortcuts() {
@@ -1322,12 +1347,47 @@ var DataSearch = {
1322
1347
  }
1323
1348
 
1324
1349
  var performUpdate = function performUpdate() {
1325
- // Refresh recent searches when value becomes empty
1326
- if (!value && _this.currentValue && _this.enableRecentSearches) {
1350
+ if (_this.$options.isTagsMode && isEqual(value, _this.selectedTags)) {
1351
+ return;
1352
+ } // Refresh recent searches when value becomes empty
1353
+
1354
+
1355
+ if (!value && props.enableDefaultSuggestions === false) {
1356
+ _this.resetStoreForComponent(props.componentId);
1357
+ } else if (!value && _this.currentValue && _this.enableRecentSearches) {
1327
1358
  _this.getRecentSearches();
1328
1359
  }
1329
1360
 
1330
- _this.currentValue = value;
1361
+ if (_this.$options.isTagsMode && cause === configureStore.causes.SUGGESTION_SELECT) {
1362
+ if (Array.isArray(_this.selectedTags) && _this.selectedTags.length) {
1363
+ // check if value already present in selectedTags
1364
+ if (typeof value === 'string' && _this.selectedTags.includes(value)) {
1365
+ _this.isOpen = false;
1366
+ return;
1367
+ }
1368
+
1369
+ _this.selectedTags = [].concat(_this.selectedTags);
1370
+
1371
+ if (typeof value === 'string' && !!value) {
1372
+ _this.selectedTags.push(value);
1373
+ } else if (Array.isArray(value) && !isEqual(_this.selectedTags, value)) {
1374
+ var mergedArray = Array.from(new Set([].concat(_this.selectedTags, value)));
1375
+ _this.selectedTags = mergedArray;
1376
+ }
1377
+ } else if (value) {
1378
+ _this.selectedTags = typeof value !== 'string' ? value : [].concat(value);
1379
+ }
1380
+
1381
+ _this.currentValue = '';
1382
+ } else {
1383
+ _this.currentValue = value;
1384
+ }
1385
+
1386
+ var queryHandlerValue = value;
1387
+
1388
+ if (_this.$options.isTagsMode && cause === configureStore.causes.SUGGESTION_SELECT) {
1389
+ queryHandlerValue = Array.isArray(_this.selectedTags) && _this.selectedTags.length ? _this.selectedTags : undefined;
1390
+ }
1331
1391
 
1332
1392
  if (isDefaultValue) {
1333
1393
  if (_this.$props.autosuggest) {
@@ -1335,19 +1395,19 @@ var DataSearch = {
1335
1395
  _this.isOpen = false;
1336
1396
  }
1337
1397
 
1338
- _this.updateDefaultQueryHandler(value, _this.$props);
1398
+ if (typeof value === 'string') _this.updateDefaultQueryHandler(value, _this.$props);
1339
1399
  } // in case of strict selection only SUGGESTION_SELECT should be able
1340
1400
  // to set the query otherwise the value should reset
1341
1401
 
1342
1402
 
1343
1403
  if (props.strictSelection) {
1344
- if (cause === configureStore.causes.SUGGESTION_SELECT || value === '') {
1345
- _this.updateQueryHandler(props.componentId, value, props);
1404
+ if (cause === configureStore.causes.SUGGESTION_SELECT || (_this.$options.isTagsMode ? _this.selectedTags.length === 0 : value === '')) {
1405
+ _this.updateQueryHandler(props.componentId, queryHandlerValue, props);
1346
1406
  } else {
1347
1407
  _this.setValue('', true);
1348
1408
  }
1349
1409
  } else {
1350
- _this.updateQueryHandler(props.componentId, value, props);
1410
+ _this.updateQueryHandler(props.componentId, queryHandlerValue, props);
1351
1411
  }
1352
1412
  } else {
1353
1413
  // debounce for handling text while typing
@@ -1374,6 +1434,12 @@ var DataSearch = {
1374
1434
  checkValueChange(props.componentId, value, props.beforeValueChange, performUpdate);
1375
1435
  },
1376
1436
  updateDefaultQueryHandler: function updateDefaultQueryHandler(value, props) {
1437
+ if (!value && props.enableDefaultSuggestions === false) {
1438
+ // clear Component data from store
1439
+ this.resetStoreForComponent(props.componentId);
1440
+ return;
1441
+ }
1442
+
1377
1443
  var defaultQueryOptions;
1378
1444
  var query = DataSearch.defaultQuery(value, props);
1379
1445
 
@@ -1487,7 +1553,8 @@ var DataSearch = {
1487
1553
 
1488
1554
 
1489
1555
  if (event.key === 'Enter' && highlightedIndex === null) {
1490
- this.setValue(event.target.value, true);
1556
+ this.setValue(event.target.value, true, this.$props, this.$options.isTagsMode ? configureStore.causes.SUGGESTION_SELECT : undefined // to handle tags
1557
+ );
1491
1558
  this.onValueSelectedHandler(event.target.value, configureStore.causes.ENTER_PRESS);
1492
1559
  } // Need to review
1493
1560
 
@@ -1518,11 +1585,23 @@ var DataSearch = {
1518
1585
 
1519
1586
  if (value === undefined) {
1520
1587
  this.setValue(suggestion.value, true, this.$props, configureStore.causes.SUGGESTION_SELECT);
1588
+ } else if (this.$options.isTagsMode) {
1589
+ var emitValue = Array.isArray(this.selectedTags) ? [].concat(this.selectedTags) : [];
1590
+
1591
+ if (this.selectedTags.includes(suggestion.value)) {
1592
+ // avoid duplicates in tags array
1593
+ this.isOpen = false;
1594
+ return;
1595
+ }
1596
+
1597
+ emitValue.push(suggestion.value);
1598
+ this.setValue(emitValue, true, this.$props, configureStore.causes.SUGGESTION_SELECT, true);
1599
+ this.$emit('change', emitValue, this.triggerQuery);
1521
1600
  } else {
1522
- this.isPending = false;
1523
1601
  this.$emit('change', suggestion.value, this.triggerQuery);
1524
1602
  }
1525
1603
 
1604
+ this.isPending = false;
1526
1605
  this.onValueSelectedHandler(suggestion.value, configureStore.causes.SUGGESTION_SELECT, suggestion.source);
1527
1606
  },
1528
1607
  onValueSelectedHandler: function onValueSelectedHandler(currentValue) {
@@ -1628,6 +1707,75 @@ var DataSearch = {
1628
1707
 
1629
1708
  return null;
1630
1709
  },
1710
+ renderTag: function renderTag(item) {
1711
+ var _this2 = this;
1712
+
1713
+ var h = this.$createElement;
1714
+ var innerClass = this.$props.innerClass;
1715
+ return h(TagItem, {
1716
+ "class": getClassName$1(innerClass, 'selected-tag') || ''
1717
+ }, [h("span", [item]), h("span", {
1718
+ "attrs": {
1719
+ "role": "img",
1720
+ "aria-label": "delete-tag"
1721
+ },
1722
+ "class": "close-icon",
1723
+ "on": {
1724
+ "click": function click() {
1725
+ return _this2.clearTag(item);
1726
+ }
1727
+ }
1728
+ }, [h(CancelSvg.CancelSvg)])]);
1729
+ },
1730
+ clearAllTags: function clearAllTags() {
1731
+ this.selectedTags = [];
1732
+ this.setValue('', true, this.$props, configureStore.causes.SUGGESTION_SELECT);
1733
+
1734
+ if (this.$props.value !== undefined) {
1735
+ this.$emit('change', this.selectedTags, this.triggerQuery);
1736
+ }
1737
+ },
1738
+ clearTag: function clearTag(tagValue) {
1739
+ this.selectedTags = [].concat(this.selectedTags.filter(function (tag) {
1740
+ return tag !== tagValue;
1741
+ }));
1742
+ this.setValue('', true, this.$props, configureStore.causes.SUGGESTION_SELECT);
1743
+
1744
+ if (this.$props.value !== undefined) {
1745
+ this.$emit('change', this.selectedTags, this.triggerQuery);
1746
+ }
1747
+ },
1748
+ renderTags: function renderTags() {
1749
+ var _this3 = this;
1750
+
1751
+ var h = this.$createElement;
1752
+
1753
+ if (!Array.isArray(this.selectedTags)) {
1754
+ return null;
1755
+ }
1756
+
1757
+ var tagsList = [].concat(this.selectedTags);
1758
+ var shouldRenderClearAllTag = tagsList.length > 1;
1759
+ var renderSelectedTags = this.$scopedSlots.renderSelectedTags || this.$props.renderSelectedTags;
1760
+ return renderSelectedTags ? renderSelectedTags({
1761
+ values: this.selectedTags,
1762
+ handleClear: this.clearTag,
1763
+ handleClearAll: this.clearAllTags
1764
+ }) : h(TagsContainer, [tagsList.map(function (item) {
1765
+ return _this3.renderTag(item);
1766
+ }), shouldRenderClearAllTag && h(TagItem, {
1767
+ "class": getClassName$1(this.$props.innerClass, 'selected-tag') || ''
1768
+ }, [h("span", ["Clear All"]), h("span", {
1769
+ "attrs": {
1770
+ "role": "img",
1771
+ "aria-label": "delete-tag"
1772
+ },
1773
+ "class": "close-icon",
1774
+ "on": {
1775
+ "click": this.clearAllTags
1776
+ }
1777
+ }, [h(CancelSvg.CancelSvg)])])]);
1778
+ },
1631
1779
  renderInputAddonAfter: function renderInputAddonAfter() {
1632
1780
  var h = this.$createElement;
1633
1781
  var addonAfter = this.$scopedSlots.addonAfter;
@@ -1698,7 +1846,7 @@ var DataSearch = {
1698
1846
  (_this$$refs = this.$refs) == null ? void 0 : (_this$$refs$this$$pro = _this$$refs[this.$props.innerRef]) == null ? void 0 : _this$$refs$this$$pro.focus(); // eslint-disable-line
1699
1847
  },
1700
1848
  listenForFocusShortcuts: function listenForFocusShortcuts() {
1701
- var _this2 = this;
1849
+ var _this4 = this;
1702
1850
 
1703
1851
  var _this$$props$focusSho = this.$props.focusShortcuts,
1704
1852
  focusShortcuts = _this$$props$focusSho === void 0 ? ['/'] : _this$$props$focusSho;
@@ -1716,7 +1864,7 @@ var DataSearch = {
1716
1864
  // Prevent the default refresh event under WINDOWS system
1717
1865
  event.preventDefault();
1718
1866
 
1719
- _this2.focusSearchBox(event);
1867
+ _this4.focusSearchBox(event);
1720
1868
  }); // if one of modifier keys are used, they are handled below
1721
1869
 
1722
1870
  hotkeys('*', function (event) {
@@ -1727,7 +1875,7 @@ var DataSearch = {
1727
1875
  var element = modifierKeys[index$1];
1728
1876
 
1729
1877
  if (hotkeys[element]) {
1730
- _this2.focusSearchBox(event);
1878
+ _this4.focusSearchBox(event);
1731
1879
 
1732
1880
  break;
1733
1881
  }
@@ -1736,7 +1884,7 @@ var DataSearch = {
1736
1884
  }
1737
1885
  },
1738
1886
  render: function render() {
1739
- var _this3 = this;
1887
+ var _this5 = this;
1740
1888
 
1741
1889
  var h = arguments[0];
1742
1890
  var _this$$props4 = this.$props,
@@ -1775,14 +1923,14 @@ var DataSearch = {
1775
1923
  setHighlightedIndex = _ref3.setHighlightedIndex;
1776
1924
 
1777
1925
  var renderSuggestionsContainer = function renderSuggestionsContainer() {
1778
- return h("div", [_this3.hasCustomRenderer && _this3.getComponent({
1926
+ return h("div", [_this5.hasCustomRenderer && _this5.getComponent({
1779
1927
  isOpen: isOpen,
1780
1928
  getItemProps: getItemProps,
1781
1929
  getItemEvents: getItemEvents,
1782
1930
  highlightedIndex: highlightedIndex
1783
- }), _this3.renderErrorComponent(), !_this3.hasCustomRenderer && isOpen && hasSuggestions ? h("ul", {
1784
- "class": Input.suggestions(_this3.themePreset, theme) + " " + getClassName$1(_this3.$props.innerClass, 'list')
1785
- }, [_this3.suggestionsList.slice(0, size || 10).map(function (item, index) {
1931
+ }), _this5.renderErrorComponent(), !_this5.hasCustomRenderer && isOpen && hasSuggestions ? h("ul", {
1932
+ "class": Input.suggestions(_this5.themePreset, theme) + " " + getClassName$1(_this5.$props.innerClass, 'list')
1933
+ }, [_this5.suggestionsList.slice(0, size || 10).map(function (item, index) {
1786
1934
  return h("li", {
1787
1935
  "domProps": _rollupPluginBabelHelpers._extends({}, getItemProps({
1788
1936
  item: item
@@ -1792,15 +1940,15 @@ var DataSearch = {
1792
1940
  })),
1793
1941
  "key": index + 1 + "-" + item.value,
1794
1942
  "style": {
1795
- backgroundColor: _this3.getBackgroundColor(highlightedIndex, index)
1943
+ backgroundColor: _this5.getBackgroundColor(highlightedIndex, index)
1796
1944
  }
1797
1945
  }, [h(SuggestionItem, {
1798
1946
  "attrs": {
1799
- "currentValue": _this3.currentValue,
1947
+ "currentValue": _this5.currentValue,
1800
1948
  "suggestion": item
1801
1949
  }
1802
1950
  })]);
1803
- }), _this3.defaultSearchSuggestions.map(function (sugg, index) {
1951
+ }), _this5.defaultSearchSuggestions.map(function (sugg, index) {
1804
1952
  return h("li", {
1805
1953
  "domProps": _rollupPluginBabelHelpers._extends({}, getItemProps({
1806
1954
  item: sugg
@@ -1808,9 +1956,9 @@ var DataSearch = {
1808
1956
  "on": _rollupPluginBabelHelpers._extends({}, getItemEvents({
1809
1957
  item: sugg
1810
1958
  })),
1811
- "key": _this3.suggestionsList.length + index + 1 + "-" + sugg.value,
1959
+ "key": _this5.suggestionsList.length + index + 1 + "-" + sugg.value,
1812
1960
  "style": {
1813
- backgroundColor: _this3.getBackgroundColor(highlightedIndex, _this3.suggestionsList.length + index),
1961
+ backgroundColor: _this5.getBackgroundColor(highlightedIndex, _this5.suggestionsList.length + index),
1814
1962
  justifyContent: 'flex-start'
1815
1963
  }
1816
1964
  }, [h("div", {
@@ -1819,28 +1967,28 @@ var DataSearch = {
1819
1967
  }
1820
1968
  }, [sugg.source && sugg.source._recent_search && h(CustomSvg, {
1821
1969
  "attrs": {
1822
- "className": getClassName$1(_this3.$props.innerClass, 'recent-search-icon') || null,
1970
+ "className": getClassName$1(_this5.$props.innerClass, 'recent-search-icon') || null,
1823
1971
  "icon": recentSearchesIcon,
1824
1972
  "type": "recent-search-icon"
1825
1973
  }
1826
1974
  }), sugg.source && sugg.source._popular_suggestion && h(CustomSvg, {
1827
1975
  "attrs": {
1828
- "className": getClassName$1(_this3.$props.innerClass, 'popular-search-icon') || null,
1976
+ "className": getClassName$1(_this5.$props.innerClass, 'popular-search-icon') || null,
1829
1977
  "icon": popularSearchesIcon,
1830
1978
  "type": "popular-search-icon"
1831
1979
  }
1832
1980
  })]), h(SuggestionItem, {
1833
1981
  "attrs": {
1834
- "currentValue": _this3.currentValue,
1982
+ "currentValue": _this5.currentValue,
1835
1983
  "suggestion": sugg
1836
1984
  }
1837
1985
  })]);
1838
- }), index.hasQuerySuggestionsRenderer(_this3) ? _this3.getComponent({
1986
+ }), index.hasQuerySuggestionsRenderer(_this5) ? _this5.getComponent({
1839
1987
  isOpen: isOpen,
1840
1988
  getItemProps: getItemProps,
1841
1989
  getItemEvents: getItemEvents,
1842
1990
  highlightedIndex: highlightedIndex
1843
- }, true) : _this3.topSuggestions.map(function (sugg, index) {
1991
+ }, true) : _this5.topSuggestions.map(function (sugg, index) {
1844
1992
  return h("li", {
1845
1993
  "domProps": _rollupPluginBabelHelpers._extends({}, getItemProps({
1846
1994
  item: sugg
@@ -1848,9 +1996,9 @@ var DataSearch = {
1848
1996
  "on": _rollupPluginBabelHelpers._extends({}, getItemEvents({
1849
1997
  item: sugg
1850
1998
  })),
1851
- "key": _this3.suggestionsList.length + index + 1 + "-" + sugg.value,
1999
+ "key": _this5.suggestionsList.length + index + 1 + "-" + sugg.value,
1852
2000
  "style": {
1853
- backgroundColor: _this3.getBackgroundColor(highlightedIndex, _this3.suggestionsList.length + index),
2001
+ backgroundColor: _this5.getBackgroundColor(highlightedIndex, _this5.suggestionsList.length + index),
1854
2002
  justifyContent: 'flex-start'
1855
2003
  }
1856
2004
  }, [h("div", {
@@ -1859,61 +2007,61 @@ var DataSearch = {
1859
2007
  }
1860
2008
  }, [h(CustomSvg, {
1861
2009
  "attrs": {
1862
- "className": getClassName$1(_this3.$props.innerClass, 'popular-search-icon') || null,
2010
+ "className": getClassName$1(_this5.$props.innerClass, 'popular-search-icon') || null,
1863
2011
  "icon": popularSearchesIcon,
1864
2012
  "type": "popular-search-icon"
1865
2013
  }
1866
2014
  })]), h(SuggestionItem, {
1867
2015
  "attrs": {
1868
- "currentValue": _this3.currentValue,
2016
+ "currentValue": _this5.currentValue,
1869
2017
  "suggestion": sugg
1870
2018
  }
1871
2019
  })]);
1872
- })]) : _this3.renderNoSuggestions(_this3.suggestionsList)]);
2020
+ })]) : _this5.renderNoSuggestions(_this5.suggestionsList)]);
1873
2021
  };
1874
2022
 
1875
2023
  return h("div", {
1876
2024
  "class": Input.suggestionsContainer
1877
- }, [h(InputGroup, [_this3.renderInputAddonBefore(), h(CancelSvg.InputWrapper, [h(Input.Input, {
2025
+ }, [h(InputGroup, [_this5.renderInputAddonBefore(), h(CancelSvg.InputWrapper, [h(Input.Input, {
1878
2026
  "attrs": {
1879
- "id": _this3.$props.componentId + "-input",
1880
- "showIcon": _this3.$props.showIcon,
1881
- "showClear": _this3.$props.showClear,
1882
- "iconPosition": _this3.$props.iconPosition,
1883
- "placeholder": _this3.$props.placeholder,
1884
- "autoFocus": _this3.$props.autoFocus,
1885
- "themePreset": _this3.themePreset,
2027
+ "id": _this5.$props.componentId + "-input",
2028
+ "showIcon": _this5.$props.showIcon,
2029
+ "showClear": _this5.$props.showClear,
2030
+ "iconPosition": _this5.$props.iconPosition,
2031
+ "placeholder": _this5.$props.placeholder,
2032
+ "autoFocus": _this5.$props.autoFocus,
2033
+ "themePreset": _this5.themePreset,
1886
2034
  "autocomplete": "off"
1887
2035
  },
1888
- "ref": _this3.$props.innerRef,
1889
- "class": getClassName$1(_this3.$props.innerClass, 'input'),
2036
+ "ref": _this5.$props.innerRef,
2037
+ "class": getClassName$1(_this5.$props.innerClass, 'input'),
1890
2038
  "on": _rollupPluginBabelHelpers._extends({}, getInputEvents({
1891
- onInput: _this3.onInputChange,
2039
+ onInput: _this5.onInputChange,
1892
2040
  onBlur: function onBlur(e) {
1893
- _this3.$emit('blur', e, _this3.triggerQuery);
2041
+ _this5.$emit('blur', e, _this5.triggerQuery);
1894
2042
  },
1895
- onFocus: _this3.handleFocus,
2043
+ onFocus: _this5.handleFocus,
1896
2044
  onKeyPress: function onKeyPress(e) {
1897
- _this3.$emit('keyPress', e, _this3.triggerQuery);
2045
+ _this5.$emit('keyPress', e, _this5.triggerQuery);
1898
2046
 
1899
- _this3.$emit('key-press', e, _this3.triggerQuery);
2047
+ _this5.$emit('key-press', e, _this5.triggerQuery);
1900
2048
  },
1901
2049
  onKeyDown: function onKeyDown(e) {
1902
- return _this3.handleKeyDown(e, highlightedIndex);
2050
+ return _this5.handleKeyDown(e, highlightedIndex);
1903
2051
  },
1904
2052
  onKeyUp: function onKeyUp(e) {
1905
- _this3.$emit('keyUp', e, _this3.triggerQuery);
2053
+ _this5.$emit('keyUp', e, _this5.triggerQuery);
1906
2054
 
1907
- _this3.$emit('key-up', e, _this3.triggerQuery);
2055
+ _this5.$emit('key-up', e, _this5.triggerQuery);
1908
2056
  },
1909
2057
  onClick: function onClick() {
1910
2058
  setHighlightedIndex(null);
1911
2059
  }
1912
2060
  })),
1913
2061
  "domProps": _rollupPluginBabelHelpers._extends({}, getInputProps({
1914
- value: _this3.$data.currentValue === null ? '' : _this3.$data.currentValue
2062
+ value: _this5.$data.currentValue === null ? '' : _this5.$data.currentValue
1915
2063
  }))
1916
- }), _this3.renderIcons(), !expandSuggestionsContainer && renderSuggestionsContainer()]), ' ', _this3.renderInputAddonAfter()]), expandSuggestionsContainer && renderSuggestionsContainer()]);
2064
+ }), _this5.renderIcons(), !expandSuggestionsContainer && renderSuggestionsContainer()]), ' ', _this5.renderInputAddonAfter()]), expandSuggestionsContainer && renderSuggestionsContainer(), _this5.renderTags()]);
1917
2065
  }
1918
2066
  }
1919
2067
  }) : h("div", {
@@ -1929,26 +2077,26 @@ var DataSearch = {
1929
2077
  },
1930
2078
  "on": _rollupPluginBabelHelpers._extends({}, {
1931
2079
  blur: function blur(e) {
1932
- _this3.$emit('blur', e, _this3.triggerQuery);
2080
+ _this5.$emit('blur', e, _this5.triggerQuery);
1933
2081
  },
1934
2082
  keypress: function keypress(e) {
1935
- _this3.$emit('keyPress', e, _this3.triggerQuery);
2083
+ _this5.$emit('keyPress', e, _this5.triggerQuery);
1936
2084
 
1937
- _this3.$emit('key-press', e, _this3.triggerQuery);
2085
+ _this5.$emit('key-press', e, _this5.triggerQuery);
1938
2086
  },
1939
2087
  input: this.onInputChange,
1940
2088
  focus: function focus(e) {
1941
- _this3.$emit('focus', e, _this3.triggerQuery);
2089
+ _this5.$emit('focus', e, _this5.triggerQuery);
1942
2090
  },
1943
2091
  keydown: function keydown(e) {
1944
- _this3.$emit('keyDown', e, _this3.triggerQuery);
2092
+ _this5.$emit('keyDown', e, _this5.triggerQuery);
1945
2093
 
1946
- _this3.$emit('key-down', e, _this3.triggerQuery);
2094
+ _this5.$emit('key-down', e, _this5.triggerQuery);
1947
2095
  },
1948
2096
  keyup: function keyup(e) {
1949
- _this3.$emit('keyUp', e, _this3.triggerQuery);
2097
+ _this5.$emit('keyUp', e, _this5.triggerQuery);
1950
2098
 
1951
- _this3.$emit('key-up', e, _this3.triggerQuery);
2099
+ _this5.$emit('key-up', e, _this5.triggerQuery);
1952
2100
  }
1953
2101
  }),
1954
2102
  "domProps": _rollupPluginBabelHelpers._extends({}, {
@@ -2147,7 +2295,8 @@ var mapDispatchToProps = {
2147
2295
  setCustomHighlightOptions: setCustomHighlightOptions,
2148
2296
  recordSuggestionClick: recordSuggestionClick,
2149
2297
  loadPopularSuggestions: loadPopularSuggestions,
2150
- getRecentSearches: getRecentSearches
2298
+ getRecentSearches: getRecentSearches,
2299
+ resetStoreForComponent: resetStoreForComponent
2151
2300
  };
2152
2301
  var DSConnected = ComponentWrapper.ComponentWrapper(index.connect(mapStateToProps, mapDispatchToProps)(DataSearch), {
2153
2302
  componentType: constants.componentTypes.dataSearch,
@@ -2169,3 +2318,5 @@ exports.Mic = Mic;
2169
2318
  exports.SearchSvg = SearchSvg;
2170
2319
  exports.SuggestionItem = SuggestionItem;
2171
2320
  exports.SuggestionWrapper = SuggestionWrapper;
2321
+ exports.TagItem = TagItem;
2322
+ exports.TagsContainer = TagsContainer;
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  require('@appbaseio/reactivecore');
6
- require('./_rollupPluginBabelHelpers-f127c8b7.js');
6
+ require('./_rollupPluginBabelHelpers-91d4b5a6.js');
7
7
  require('vue-types');
8
8
  require('@appbaseio/reactivecore/lib/utils/constants');
9
9
  require('@appbaseio/reactivecore/lib/utils/helper');
@@ -13,16 +13,16 @@ require('polished');
13
13
  require('./vueTypes-57d01f18.js');
14
14
  require('@appbaseio/reactivecore/lib/utils/transform');
15
15
  require('redux');
16
- require('./index-4509aa45.js');
17
- require('./ComponentWrapper-10bad289.js');
18
- require('./Title-584a8cc8.js');
19
- require('./Flex-f146cdad.js');
16
+ require('./index-2cd3650b.js');
17
+ require('./ComponentWrapper-5cb08414.js');
18
+ require('./Title-26661936.js');
19
+ require('./Flex-63774e4d.js');
20
20
  require('hotkeys-js');
21
- var DataSearch = require('./DataSearch-eec21890.js');
22
- require('./CancelSvg-4aa35935.js');
23
- require('./Input-0d7b25ad.js');
21
+ var DataSearch = require('./DataSearch-e550096e.js');
22
+ require('./CancelSvg-c48c1085.js');
23
+ require('./Input-43868594.js');
24
24
  require('compute-scroll-into-view');
25
- require('./Container-526efa6a.js');
25
+ require('./Container-cfd69a34.js');
26
26
  require('vue-highlight-words');
27
27
 
28
28