@appbaseio/reactivesearch-vue 1.16.0-alpha.55 → 1.16.0-alpha.58

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 (87) hide show
  1. package/dist/@appbaseio/reactivesearch-vue.umd.js +7662 -5299
  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-10e5cf51.js → Button-446f819e.js} +1 -1
  6. package/dist/cjs/{CancelSvg-82021d23.js → CancelSvg-9f258f4f.js} +1 -1
  7. package/dist/cjs/{Card-4b915733.js → Card-642547a8.js} +2 -2
  8. package/dist/cjs/{ComponentWrapper-7302fe1a.js → ComponentWrapper-ca5f0cbd.js} +2 -2
  9. package/dist/cjs/{Container-8a08d663.js → Container-daf30918.js} +1 -1
  10. package/dist/cjs/{DataSearch-7fd1b95d.js → DataSearch-f63fcf44.js} +221 -80
  11. package/dist/cjs/DataSearch.js +9 -9
  12. package/dist/cjs/{DropDown-16a2a728.js → DropDown-c3f83a46.js} +4 -4
  13. package/dist/cjs/DynamicRangeSlider.js +5 -5
  14. package/dist/cjs/{Flex-699639d2.js → Flex-aa517a13.js} +1 -1
  15. package/dist/cjs/{FormControlList-73497794.js → FormControlList-c195a592.js} +1 -1
  16. package/dist/cjs/{Input-64087a69.js → Input-e6603a7e.js} +1 -1
  17. package/dist/cjs/{ListItem-933c27e4.js → ListItem-8c9e0d68.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/{Pagination-e0654529.js → Pagination-c01d1547.js} +1 -1
  22. package/dist/cjs/RangeInput.js +8 -8
  23. package/dist/cjs/RangeSlider.js +6 -6
  24. package/dist/cjs/ReactiveBase.js +2 -2
  25. package/dist/cjs/ReactiveComponent.js +3 -3
  26. package/dist/cjs/ReactiveGoogleMap.js +24 -24
  27. package/dist/cjs/ReactiveList.js +9 -9
  28. package/dist/cjs/ResultCard.js +3 -3
  29. package/dist/cjs/ResultList.js +3 -3
  30. package/dist/cjs/SelectedFilters.js +44 -27
  31. package/dist/cjs/SingleDropdownList.js +10 -10
  32. package/dist/cjs/SingleList.js +8 -8
  33. package/dist/cjs/SingleRange.js +6 -6
  34. package/dist/cjs/StateProvider.js +2 -2
  35. package/dist/cjs/{Title-39765ee6.js → Title-1de7d0f4.js} +1 -1
  36. package/dist/cjs/ToggleButton.js +6 -6
  37. package/dist/cjs/{_rollupPluginBabelHelpers-4abdbfff.js → _rollupPluginBabelHelpers-c705cbe6.js} +2 -4
  38. package/dist/cjs/{index-d44a0a21.js → index-c288153a.js} +1 -1
  39. package/dist/cjs/index.js +18 -23
  40. package/dist/cjs/initReactivesearch.js +1 -1
  41. package/dist/cjs/{install-ac3374ec.js → install-b494733c.js} +225 -65
  42. package/dist/cjs/install.js +18 -18
  43. package/dist/cjs/{ssr-c333c82c.js → ssr-3027b848.js} +1 -1
  44. package/dist/cjs/{utils-23afb20b.js → utils-d6a52588.js} +1 -1
  45. package/dist/cjs/version.js +1 -1
  46. package/dist/es/{Button-8b211174.js → Button-d8bc15ea.js} +1 -1
  47. package/dist/es/{CancelSvg-4d9e0857.js → CancelSvg-4cfae5fd.js} +1 -1
  48. package/dist/es/{Card-04b3c33e.js → Card-450683f1.js} +2 -2
  49. package/dist/es/{ComponentWrapper-bbb717bc.js → ComponentWrapper-6ad0997b.js} +2 -2
  50. package/dist/es/{Container-4383c6f0.js → Container-ba826e96.js} +1 -1
  51. package/dist/es/{DataSearch-a5aaa29e.js → DataSearch-1dba393f.js} +221 -82
  52. package/dist/es/DataSearch.js +9 -9
  53. package/dist/es/{DropDown-7639f223.js → DropDown-2ddad7ae.js} +4 -4
  54. package/dist/es/DynamicRangeSlider.js +5 -5
  55. package/dist/es/{Flex-aac91505.js → Flex-1f0795c3.js} +1 -1
  56. package/dist/es/{FormControlList-fe389a2e.js → FormControlList-c22d64f6.js} +1 -1
  57. package/dist/es/{Input-d1bb4868.js → Input-7a2a9fac.js} +1 -1
  58. package/dist/es/{ListItem-bdb6d53d.js → ListItem-cad14c5e.js} +2 -2
  59. package/dist/es/MultiDropdownList.js +10 -10
  60. package/dist/es/MultiList.js +8 -8
  61. package/dist/es/MultiRange.js +6 -6
  62. package/dist/es/{Pagination-3c50d4ba.js → Pagination-491c44ee.js} +1 -1
  63. package/dist/es/RangeInput.js +8 -8
  64. package/dist/es/RangeSlider.js +6 -6
  65. package/dist/es/ReactiveBase.js +2 -2
  66. package/dist/es/ReactiveComponent.js +3 -3
  67. package/dist/es/ReactiveGoogleMap.js +23 -24
  68. package/dist/es/ReactiveList.js +9 -9
  69. package/dist/es/ResultCard.js +3 -3
  70. package/dist/es/ResultList.js +3 -3
  71. package/dist/es/SelectedFilters.js +44 -27
  72. package/dist/es/SingleDropdownList.js +10 -10
  73. package/dist/es/SingleList.js +8 -8
  74. package/dist/es/SingleRange.js +6 -6
  75. package/dist/es/StateProvider.js +2 -2
  76. package/dist/es/{Title-579f8d6c.js → Title-3342664a.js} +1 -1
  77. package/dist/es/ToggleButton.js +6 -6
  78. package/dist/es/{_rollupPluginBabelHelpers-ecf6c03c.js → _rollupPluginBabelHelpers-76660dab.js} +2 -4
  79. package/dist/es/{index-5daa8276.js → index-3d98f51b.js} +1 -1
  80. package/dist/es/index.js +19 -24
  81. package/dist/es/initReactivesearch.js +1 -1
  82. package/dist/es/{install-cdccc63e.js → install-cde230d4.js} +226 -66
  83. package/dist/es/install.js +18 -18
  84. package/dist/es/{ssr-e3196de1.js → ssr-b2c0b401.js} +1 -1
  85. package/dist/es/{utils-3a32e13f.js → utils-9e68acee.js} +1 -1
  86. package/dist/es/version.js +1 -1
  87. package/package.json +4 -4
@@ -1,18 +1,18 @@
1
1
  import { helper, Actions, causes } from '@appbaseio/reactivecore';
2
- import { _ as _taggedTemplateLiteralLoose, a as _extends } from './_rollupPluginBabelHelpers-ecf6c03c.js';
2
+ import { _ as _taggedTemplateLiteralLoose, a as _extends } from './_rollupPluginBabelHelpers-76660dab.js';
3
3
  import VueTypes from 'vue-types';
4
- import { componentTypes } from '@appbaseio/reactivecore/lib/utils/constants';
4
+ import { SEARCH_COMPONENTS_MODES, componentTypes } from '@appbaseio/reactivecore/lib/utils/constants';
5
5
  import { getQueryOptions } from '@appbaseio/reactivecore/lib/utils/helper';
6
6
  import styled, { css, cx, injectGlobal } from '@appbaseio/vue-emotion';
7
7
  import { t as types } from './vueTypes-9326e0be.js';
8
- import { g as getComponent, h as hasCustomRenderer, f as updateCustomQuery, u as updateDefaultQuery, i as isQueryIdentical, j as getQuerySuggestionsComponent, a as isFunction, k as isEmpty, p as parseFocusShortcuts, l as extractModifierKeysFromFocusShortcuts, m as hasQuerySuggestionsRenderer, c as connect } from './index-5daa8276.js';
9
- import { C as ComponentWrapper } from './ComponentWrapper-bbb717bc.js';
10
- import { T as Title } from './Title-579f8d6c.js';
11
- import { F as Flex } from './Flex-aac91505.js';
8
+ import { g as getComponent, h as hasCustomRenderer, f as updateCustomQuery, u as updateDefaultQuery, i as isQueryIdentical, j as getQuerySuggestionsComponent, a as isFunction, k as isEmpty, p as parseFocusShortcuts, l as extractModifierKeysFromFocusShortcuts, m as hasQuerySuggestionsRenderer, c as connect } from './index-3d98f51b.js';
9
+ import { C as ComponentWrapper } from './ComponentWrapper-6ad0997b.js';
10
+ import { T as Title } from './Title-3342664a.js';
11
+ import { F as Flex } from './Flex-1f0795c3.js';
12
12
  import hotkeys from 'hotkeys-js';
13
- import { I as IconWrapper, C as CancelSvg, a as IconGroup, D as Downshift, b as InputWrapper } from './CancelSvg-4d9e0857.js';
14
- import { n as noSuggestions, s as suggestionsContainer, I as Input, a as suggestions } from './Input-d1bb4868.js';
15
- import { C as Container } from './Container-4383c6f0.js';
13
+ import { I as IconWrapper, C as CancelSvg, a as IconGroup, D as Downshift, b as InputWrapper } from './CancelSvg-4cfae5fd.js';
14
+ import { n as noSuggestions, s as suggestionsContainer, I as Input, a as suggestions } from './Input-7a2a9fac.js';
15
+ import { C as Container } from './Container-ba826e96.js';
16
16
  import Highlight from 'vue-highlight-words';
17
17
 
18
18
  var _templateObject;
@@ -898,6 +898,10 @@ var CustomSvg = {
898
898
  }
899
899
  };
900
900
 
901
+ var _templateObject$6, _templateObject2;
902
+ var TagsContainer = styled('div')(_templateObject$6 || (_templateObject$6 = _taggedTemplateLiteralLoose(["\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tmargin-top: 10px;\n\twidth: 100%;\n"])));
903
+ var TagItem = styled('span')(_templateObject2 || (_templateObject2 = _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"])));
904
+
901
905
  var updateQuery = Actions.updateQuery,
902
906
  setQueryOptions = Actions.setQueryOptions,
903
907
  setCustomQuery = Actions.setCustomQuery,
@@ -921,10 +925,12 @@ var debounce = helper.debounce,
921
925
  normalizeDataField = helper.normalizeDataField;
922
926
  var DataSearch = {
923
927
  name: 'DataSearch',
928
+ isTagsMode: false,
924
929
  data: function data() {
925
930
  var props = this.$props;
926
931
  this.__state = {
927
932
  currentValue: '',
933
+ selectedTags: [],
928
934
  isOpen: false,
929
935
  normalizedSuggestions: [],
930
936
  isPending: false
@@ -944,7 +950,13 @@ var DataSearch = {
944
950
  enableRecentSearches = _this$$props.enableRecentSearches,
945
951
  distinctField = _this$$props.distinctField,
946
952
  distinctFieldConfig = _this$$props.distinctFieldConfig,
947
- index = _this$$props.index; // TODO: Remove in 2.0
953
+ index = _this$$props.index,
954
+ mode = _this$$props.mode;
955
+
956
+ if (mode === SEARCH_COMPONENTS_MODES.TAG) {
957
+ this.$options.isTagsMode = true;
958
+ } // TODO: Remove in 2.0
959
+
948
960
 
949
961
  if (enableQuerySuggestions) {
950
962
  console.warn('Warning(ReactiveSearch): The `enableQuerySuggestions` prop has been marked as deprecated, please use the `enablePopularSuggestions` prop instead.');
@@ -967,7 +979,12 @@ var DataSearch = {
967
979
  console.warn('Warning(ReactiveSearch): In order to use the `index` prop, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
968
980
  }
969
981
 
970
- this.currentValue = this.selectedValue || '';
982
+ this.currentValue = '';
983
+
984
+ if (this.$options.isTagsMode) {
985
+ this.currentValue = '';
986
+ }
987
+
971
988
  var shouldFetchInitialSuggestions = this.$props.enableDefaultSuggestions || this.currentValue;
972
989
 
973
990
  if (shouldFetchInitialSuggestions) {
@@ -1061,7 +1078,7 @@ var DataSearch = {
1061
1078
  debounce: VueTypes.number.def(0),
1062
1079
  defaultValue: types.string,
1063
1080
  excludeFields: types.excludeFields,
1064
- value: types.value,
1081
+ value: VueTypes.oneOfType([VueTypes.arrayOf(VueTypes.string), types.value]),
1065
1082
  defaultSuggestions: types.suggestions,
1066
1083
  enableSynonyms: VueTypes.bool.def(true),
1067
1084
  enableQuerySuggestions: VueTypes.bool.def(false),
@@ -1110,7 +1127,9 @@ var DataSearch = {
1110
1127
  addonAfter: VueTypes.any,
1111
1128
  expandSuggestionsContainer: VueTypes.bool.def(true),
1112
1129
  index: VueTypes.string,
1113
- enableDefaultSuggestions: VueTypes.bool.def(true)
1130
+ enableDefaultSuggestions: VueTypes.bool.def(true),
1131
+ mode: VueTypes.oneOf(['select', 'tag']).def('select'),
1132
+ renderSelectedTags: VueTypes.any
1114
1133
  },
1115
1134
  beforeMount: function beforeMount() {
1116
1135
  if (this.$props.highlight) {
@@ -1127,11 +1146,11 @@ var DataSearch = {
1127
1146
  }
1128
1147
 
1129
1148
  if (this.selectedValue) {
1130
- this.setValue(this.selectedValue, true);
1149
+ this.setValue(this.selectedValue, true, this.$props, this.$options.isTagsMode ? causes.SUGGESTION_SELECT : undefined);
1131
1150
  } else if (this.$props.value) {
1132
- this.setValue(this.$props.value, true);
1151
+ this.setValue(this.$props.value, true, this.$props, this.$options.isTagsMode ? causes.SUGGESTION_SELECT : undefined);
1133
1152
  } else if (this.$props.defaultValue) {
1134
- this.setValue(this.$props.defaultValue, true);
1153
+ this.setValue(this.$props.defaultValue, true, this.$props, this.$options.isTagsMode ? causes.SUGGESTION_SELECT : undefined);
1135
1154
  }
1136
1155
  },
1137
1156
  mounted: function mounted() {
@@ -1143,19 +1162,19 @@ var DataSearch = {
1143
1162
  },
1144
1163
  dataField: function dataField() {
1145
1164
  this.updateQueryOptions();
1146
- this.updateQueryHandler(this.$props.componentId, this.$data.currentValue, this.$props);
1165
+ this.updateQueryHandler(this.$props.componentId, this.$options.isTagsMode ? this.$data.selectedTags : this.$data.currentValue, this.$props);
1147
1166
  },
1148
1167
  highlightField: function highlightField() {
1149
1168
  this.updateQueryOptions();
1150
1169
  },
1151
1170
  fieldWeights: function fieldWeights() {
1152
- 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);
1153
1172
  },
1154
1173
  fuzziness: function fuzziness() {
1155
- this.updateQueryHandler(this.$props.componentId, this.$data.currentValue, this.$props);
1174
+ this.updateQueryHandler(this.$props.componentId, this.$options.isTagsMode ? this.$data.selectedTags : this.$data.currentValue, this.$props);
1156
1175
  },
1157
1176
  queryFormat: function queryFormat() {
1158
- 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);
1159
1178
  },
1160
1179
  defaultValue: function defaultValue(newVal) {
1161
1180
  this.setValue(newVal, true, this.$props);
@@ -1184,13 +1203,18 @@ var DataSearch = {
1184
1203
  }
1185
1204
  },
1186
1205
  selectedValue: function selectedValue(newVal, oldVal) {
1187
- if (oldVal !== newVal && this.$data.currentValue !== newVal) {
1206
+ if (!isEqual(newVal, oldVal) && (this.$options.isTagsMode ? !isEqual(this.$data.selectedTags, newVal) : this.$data.currentValue !== newVal)) {
1188
1207
  if (!newVal && this.$data.currentValue) {
1189
1208
  // selected value is cleared, call onValueSelected
1190
1209
  this.onValueSelectedHandler('', causes.CLEAR_VALUE);
1191
1210
  }
1192
1211
 
1193
- this.setValue(newVal || '', true, this.$props);
1212
+ if (this.$options.isTagsMode) {
1213
+ // handling reset of tags through SelectedFilters or URL
1214
+ this.selectedTags = [];
1215
+ }
1216
+
1217
+ this.setValue(newVal || '', true, this.$props, this.$options.isTagsMode ? causes.SUGGESTION_SELECT : undefined);
1194
1218
  }
1195
1219
  },
1196
1220
  focusShortcuts: function focusShortcuts() {
@@ -1317,14 +1341,47 @@ var DataSearch = {
1317
1341
  }
1318
1342
 
1319
1343
  var performUpdate = function performUpdate() {
1320
- // Refresh recent searches when value becomes empty
1344
+ if (_this.$options.isTagsMode && isEqual(value, _this.selectedTags)) {
1345
+ return;
1346
+ } // Refresh recent searches when value becomes empty
1347
+
1348
+
1321
1349
  if (!value && props.enableDefaultSuggestions === false) {
1322
1350
  _this.resetStoreForComponent(props.componentId);
1323
1351
  } else if (!value && _this.currentValue && _this.enableRecentSearches) {
1324
1352
  _this.getRecentSearches();
1325
1353
  }
1326
1354
 
1327
- _this.currentValue = value;
1355
+ if (_this.$options.isTagsMode && cause === causes.SUGGESTION_SELECT) {
1356
+ if (Array.isArray(_this.selectedTags) && _this.selectedTags.length) {
1357
+ // check if value already present in selectedTags
1358
+ if (typeof value === 'string' && _this.selectedTags.includes(value)) {
1359
+ _this.isOpen = false;
1360
+ return;
1361
+ }
1362
+
1363
+ _this.selectedTags = [].concat(_this.selectedTags);
1364
+
1365
+ if (typeof value === 'string' && !!value) {
1366
+ _this.selectedTags.push(value);
1367
+ } else if (Array.isArray(value) && !isEqual(_this.selectedTags, value)) {
1368
+ var mergedArray = Array.from(new Set([].concat(_this.selectedTags, value)));
1369
+ _this.selectedTags = mergedArray;
1370
+ }
1371
+ } else if (value) {
1372
+ _this.selectedTags = typeof value !== 'string' ? value : [].concat(value);
1373
+ }
1374
+
1375
+ _this.currentValue = '';
1376
+ } else {
1377
+ _this.currentValue = value;
1378
+ }
1379
+
1380
+ var queryHandlerValue = value;
1381
+
1382
+ if (_this.$options.isTagsMode && cause === causes.SUGGESTION_SELECT) {
1383
+ queryHandlerValue = Array.isArray(_this.selectedTags) && _this.selectedTags.length ? _this.selectedTags : undefined;
1384
+ }
1328
1385
 
1329
1386
  if (isDefaultValue) {
1330
1387
  if (_this.$props.autosuggest) {
@@ -1332,19 +1389,19 @@ var DataSearch = {
1332
1389
  _this.isOpen = false;
1333
1390
  }
1334
1391
 
1335
- _this.updateDefaultQueryHandler(value, _this.$props);
1392
+ if (typeof value === 'string') _this.updateDefaultQueryHandler(value, _this.$props);
1336
1393
  } // in case of strict selection only SUGGESTION_SELECT should be able
1337
1394
  // to set the query otherwise the value should reset
1338
1395
 
1339
1396
 
1340
1397
  if (props.strictSelection) {
1341
- if (cause === causes.SUGGESTION_SELECT || value === '') {
1342
- _this.updateQueryHandler(props.componentId, value, props);
1398
+ if (cause === causes.SUGGESTION_SELECT || (_this.$options.isTagsMode ? _this.selectedTags.length === 0 : value === '')) {
1399
+ _this.updateQueryHandler(props.componentId, queryHandlerValue, props);
1343
1400
  } else {
1344
1401
  _this.setValue('', true);
1345
1402
  }
1346
1403
  } else {
1347
- _this.updateQueryHandler(props.componentId, value, props);
1404
+ _this.updateQueryHandler(props.componentId, queryHandlerValue, props);
1348
1405
  }
1349
1406
  } else {
1350
1407
  // debounce for handling text while typing
@@ -1490,7 +1547,8 @@ var DataSearch = {
1490
1547
 
1491
1548
 
1492
1549
  if (event.key === 'Enter' && highlightedIndex === null) {
1493
- this.setValue(event.target.value, true);
1550
+ this.setValue(event.target.value, true, this.$props, this.$options.isTagsMode ? causes.SUGGESTION_SELECT : undefined // to handle tags
1551
+ );
1494
1552
  this.onValueSelectedHandler(event.target.value, causes.ENTER_PRESS);
1495
1553
  } // Need to review
1496
1554
 
@@ -1521,11 +1579,23 @@ var DataSearch = {
1521
1579
 
1522
1580
  if (value === undefined) {
1523
1581
  this.setValue(suggestion.value, true, this.$props, causes.SUGGESTION_SELECT);
1582
+ } else if (this.$options.isTagsMode) {
1583
+ var emitValue = Array.isArray(this.selectedTags) ? [].concat(this.selectedTags) : [];
1584
+
1585
+ if (this.selectedTags.includes(suggestion.value)) {
1586
+ // avoid duplicates in tags array
1587
+ this.isOpen = false;
1588
+ return;
1589
+ }
1590
+
1591
+ emitValue.push(suggestion.value);
1592
+ this.setValue(emitValue, true, this.$props, causes.SUGGESTION_SELECT, true);
1593
+ this.$emit('change', emitValue, this.triggerQuery);
1524
1594
  } else {
1525
- this.isPending = false;
1526
1595
  this.$emit('change', suggestion.value, this.triggerQuery);
1527
1596
  }
1528
1597
 
1598
+ this.isPending = false;
1529
1599
  this.onValueSelectedHandler(suggestion.value, causes.SUGGESTION_SELECT, suggestion.source);
1530
1600
  },
1531
1601
  onValueSelectedHandler: function onValueSelectedHandler(currentValue) {
@@ -1631,6 +1701,75 @@ var DataSearch = {
1631
1701
 
1632
1702
  return null;
1633
1703
  },
1704
+ renderTag: function renderTag(item) {
1705
+ var _this2 = this;
1706
+
1707
+ var h = this.$createElement;
1708
+ var innerClass = this.$props.innerClass;
1709
+ return h(TagItem, {
1710
+ "class": getClassName$1(innerClass, 'selected-tag') || ''
1711
+ }, [h("span", [item]), h("span", {
1712
+ "attrs": {
1713
+ "role": "img",
1714
+ "aria-label": "delete-tag"
1715
+ },
1716
+ "class": "close-icon",
1717
+ "on": {
1718
+ "click": function click() {
1719
+ return _this2.clearTag(item);
1720
+ }
1721
+ }
1722
+ }, [h(CancelSvg)])]);
1723
+ },
1724
+ clearAllTags: function clearAllTags() {
1725
+ this.selectedTags = [];
1726
+ this.setValue('', true, this.$props, causes.SUGGESTION_SELECT);
1727
+
1728
+ if (this.$props.value !== undefined) {
1729
+ this.$emit('change', this.selectedTags, this.triggerQuery);
1730
+ }
1731
+ },
1732
+ clearTag: function clearTag(tagValue) {
1733
+ this.selectedTags = [].concat(this.selectedTags.filter(function (tag) {
1734
+ return tag !== tagValue;
1735
+ }));
1736
+ this.setValue('', true, this.$props, causes.SUGGESTION_SELECT);
1737
+
1738
+ if (this.$props.value !== undefined) {
1739
+ this.$emit('change', this.selectedTags, this.triggerQuery);
1740
+ }
1741
+ },
1742
+ renderTags: function renderTags() {
1743
+ var _this3 = this;
1744
+
1745
+ var h = this.$createElement;
1746
+
1747
+ if (!Array.isArray(this.selectedTags)) {
1748
+ return null;
1749
+ }
1750
+
1751
+ var tagsList = [].concat(this.selectedTags);
1752
+ var shouldRenderClearAllTag = tagsList.length > 1;
1753
+ var renderSelectedTags = this.$scopedSlots.renderSelectedTags || this.$props.renderSelectedTags;
1754
+ return renderSelectedTags ? renderSelectedTags({
1755
+ values: this.selectedTags,
1756
+ handleClear: this.clearTag,
1757
+ handleClearAll: this.clearAllTags
1758
+ }) : h(TagsContainer, [tagsList.map(function (item) {
1759
+ return _this3.renderTag(item);
1760
+ }), shouldRenderClearAllTag && h(TagItem, {
1761
+ "class": getClassName$1(this.$props.innerClass, 'selected-tag') || ''
1762
+ }, [h("span", ["Clear All"]), h("span", {
1763
+ "attrs": {
1764
+ "role": "img",
1765
+ "aria-label": "delete-tag"
1766
+ },
1767
+ "class": "close-icon",
1768
+ "on": {
1769
+ "click": this.clearAllTags
1770
+ }
1771
+ }, [h(CancelSvg)])])]);
1772
+ },
1634
1773
  renderInputAddonAfter: function renderInputAddonAfter() {
1635
1774
  var h = this.$createElement;
1636
1775
  var addonAfter = this.$scopedSlots.addonAfter;
@@ -1701,7 +1840,7 @@ var DataSearch = {
1701
1840
  (_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
1702
1841
  },
1703
1842
  listenForFocusShortcuts: function listenForFocusShortcuts() {
1704
- var _this2 = this;
1843
+ var _this4 = this;
1705
1844
 
1706
1845
  var _this$$props$focusSho = this.$props.focusShortcuts,
1707
1846
  focusShortcuts = _this$$props$focusSho === void 0 ? ['/'] : _this$$props$focusSho;
@@ -1719,7 +1858,7 @@ var DataSearch = {
1719
1858
  // Prevent the default refresh event under WINDOWS system
1720
1859
  event.preventDefault();
1721
1860
 
1722
- _this2.focusSearchBox(event);
1861
+ _this4.focusSearchBox(event);
1723
1862
  }); // if one of modifier keys are used, they are handled below
1724
1863
 
1725
1864
  hotkeys('*', function (event) {
@@ -1730,7 +1869,7 @@ var DataSearch = {
1730
1869
  var element = modifierKeys[index];
1731
1870
 
1732
1871
  if (hotkeys[element]) {
1733
- _this2.focusSearchBox(event);
1872
+ _this4.focusSearchBox(event);
1734
1873
 
1735
1874
  break;
1736
1875
  }
@@ -1739,7 +1878,7 @@ var DataSearch = {
1739
1878
  }
1740
1879
  },
1741
1880
  render: function render() {
1742
- var _this3 = this;
1881
+ var _this5 = this;
1743
1882
 
1744
1883
  var h = arguments[0];
1745
1884
  var _this$$props4 = this.$props,
@@ -1778,14 +1917,14 @@ var DataSearch = {
1778
1917
  setHighlightedIndex = _ref3.setHighlightedIndex;
1779
1918
 
1780
1919
  var renderSuggestionsContainer = function renderSuggestionsContainer() {
1781
- return h("div", [_this3.hasCustomRenderer && _this3.getComponent({
1920
+ return h("div", [_this5.hasCustomRenderer && _this5.getComponent({
1782
1921
  isOpen: isOpen,
1783
1922
  getItemProps: getItemProps,
1784
1923
  getItemEvents: getItemEvents,
1785
1924
  highlightedIndex: highlightedIndex
1786
- }), _this3.renderErrorComponent(), !_this3.hasCustomRenderer && isOpen && hasSuggestions ? h("ul", {
1787
- "class": suggestions(_this3.themePreset, theme) + " " + getClassName$1(_this3.$props.innerClass, 'list')
1788
- }, [_this3.suggestionsList.slice(0, size || 10).map(function (item, index) {
1925
+ }), _this5.renderErrorComponent(), !_this5.hasCustomRenderer && isOpen && hasSuggestions ? h("ul", {
1926
+ "class": suggestions(_this5.themePreset, theme) + " " + getClassName$1(_this5.$props.innerClass, 'list')
1927
+ }, [_this5.suggestionsList.slice(0, size || 10).map(function (item, index) {
1789
1928
  return h("li", {
1790
1929
  "domProps": _extends({}, getItemProps({
1791
1930
  item: item
@@ -1795,15 +1934,15 @@ var DataSearch = {
1795
1934
  })),
1796
1935
  "key": index + 1 + "-" + item.value,
1797
1936
  "style": {
1798
- backgroundColor: _this3.getBackgroundColor(highlightedIndex, index)
1937
+ backgroundColor: _this5.getBackgroundColor(highlightedIndex, index)
1799
1938
  }
1800
1939
  }, [h(SuggestionItem, {
1801
1940
  "attrs": {
1802
- "currentValue": _this3.currentValue,
1941
+ "currentValue": _this5.currentValue,
1803
1942
  "suggestion": item
1804
1943
  }
1805
1944
  })]);
1806
- }), _this3.defaultSearchSuggestions.map(function (sugg, index) {
1945
+ }), _this5.defaultSearchSuggestions.map(function (sugg, index) {
1807
1946
  return h("li", {
1808
1947
  "domProps": _extends({}, getItemProps({
1809
1948
  item: sugg
@@ -1811,9 +1950,9 @@ var DataSearch = {
1811
1950
  "on": _extends({}, getItemEvents({
1812
1951
  item: sugg
1813
1952
  })),
1814
- "key": _this3.suggestionsList.length + index + 1 + "-" + sugg.value,
1953
+ "key": _this5.suggestionsList.length + index + 1 + "-" + sugg.value,
1815
1954
  "style": {
1816
- backgroundColor: _this3.getBackgroundColor(highlightedIndex, _this3.suggestionsList.length + index),
1955
+ backgroundColor: _this5.getBackgroundColor(highlightedIndex, _this5.suggestionsList.length + index),
1817
1956
  justifyContent: 'flex-start'
1818
1957
  }
1819
1958
  }, [h("div", {
@@ -1822,28 +1961,28 @@ var DataSearch = {
1822
1961
  }
1823
1962
  }, [sugg.source && sugg.source._recent_search && h(CustomSvg, {
1824
1963
  "attrs": {
1825
- "className": getClassName$1(_this3.$props.innerClass, 'recent-search-icon') || null,
1964
+ "className": getClassName$1(_this5.$props.innerClass, 'recent-search-icon') || null,
1826
1965
  "icon": recentSearchesIcon,
1827
1966
  "type": "recent-search-icon"
1828
1967
  }
1829
1968
  }), sugg.source && sugg.source._popular_suggestion && h(CustomSvg, {
1830
1969
  "attrs": {
1831
- "className": getClassName$1(_this3.$props.innerClass, 'popular-search-icon') || null,
1970
+ "className": getClassName$1(_this5.$props.innerClass, 'popular-search-icon') || null,
1832
1971
  "icon": popularSearchesIcon,
1833
1972
  "type": "popular-search-icon"
1834
1973
  }
1835
1974
  })]), h(SuggestionItem, {
1836
1975
  "attrs": {
1837
- "currentValue": _this3.currentValue,
1976
+ "currentValue": _this5.currentValue,
1838
1977
  "suggestion": sugg
1839
1978
  }
1840
1979
  })]);
1841
- }), hasQuerySuggestionsRenderer(_this3) ? _this3.getComponent({
1980
+ }), hasQuerySuggestionsRenderer(_this5) ? _this5.getComponent({
1842
1981
  isOpen: isOpen,
1843
1982
  getItemProps: getItemProps,
1844
1983
  getItemEvents: getItemEvents,
1845
1984
  highlightedIndex: highlightedIndex
1846
- }, true) : _this3.topSuggestions.map(function (sugg, index) {
1985
+ }, true) : _this5.topSuggestions.map(function (sugg, index) {
1847
1986
  return h("li", {
1848
1987
  "domProps": _extends({}, getItemProps({
1849
1988
  item: sugg
@@ -1851,9 +1990,9 @@ var DataSearch = {
1851
1990
  "on": _extends({}, getItemEvents({
1852
1991
  item: sugg
1853
1992
  })),
1854
- "key": _this3.suggestionsList.length + index + 1 + "-" + sugg.value,
1993
+ "key": _this5.suggestionsList.length + index + 1 + "-" + sugg.value,
1855
1994
  "style": {
1856
- backgroundColor: _this3.getBackgroundColor(highlightedIndex, _this3.suggestionsList.length + index),
1995
+ backgroundColor: _this5.getBackgroundColor(highlightedIndex, _this5.suggestionsList.length + index),
1857
1996
  justifyContent: 'flex-start'
1858
1997
  }
1859
1998
  }, [h("div", {
@@ -1862,61 +2001,61 @@ var DataSearch = {
1862
2001
  }
1863
2002
  }, [h(CustomSvg, {
1864
2003
  "attrs": {
1865
- "className": getClassName$1(_this3.$props.innerClass, 'popular-search-icon') || null,
2004
+ "className": getClassName$1(_this5.$props.innerClass, 'popular-search-icon') || null,
1866
2005
  "icon": popularSearchesIcon,
1867
2006
  "type": "popular-search-icon"
1868
2007
  }
1869
2008
  })]), h(SuggestionItem, {
1870
2009
  "attrs": {
1871
- "currentValue": _this3.currentValue,
2010
+ "currentValue": _this5.currentValue,
1872
2011
  "suggestion": sugg
1873
2012
  }
1874
2013
  })]);
1875
- })]) : _this3.renderNoSuggestions(_this3.suggestionsList)]);
2014
+ })]) : _this5.renderNoSuggestions(_this5.suggestionsList)]);
1876
2015
  };
1877
2016
 
1878
2017
  return h("div", {
1879
2018
  "class": suggestionsContainer
1880
- }, [h(InputGroup, [_this3.renderInputAddonBefore(), h(InputWrapper, [h(Input, {
2019
+ }, [h(InputGroup, [_this5.renderInputAddonBefore(), h(InputWrapper, [h(Input, {
1881
2020
  "attrs": {
1882
- "id": _this3.$props.componentId + "-input",
1883
- "showIcon": _this3.$props.showIcon,
1884
- "showClear": _this3.$props.showClear,
1885
- "iconPosition": _this3.$props.iconPosition,
1886
- "placeholder": _this3.$props.placeholder,
1887
- "autoFocus": _this3.$props.autoFocus,
1888
- "themePreset": _this3.themePreset,
2021
+ "id": _this5.$props.componentId + "-input",
2022
+ "showIcon": _this5.$props.showIcon,
2023
+ "showClear": _this5.$props.showClear,
2024
+ "iconPosition": _this5.$props.iconPosition,
2025
+ "placeholder": _this5.$props.placeholder,
2026
+ "autoFocus": _this5.$props.autoFocus,
2027
+ "themePreset": _this5.themePreset,
1889
2028
  "autocomplete": "off"
1890
2029
  },
1891
- "ref": _this3.$props.innerRef,
1892
- "class": getClassName$1(_this3.$props.innerClass, 'input'),
2030
+ "ref": _this5.$props.innerRef,
2031
+ "class": getClassName$1(_this5.$props.innerClass, 'input'),
1893
2032
  "on": _extends({}, getInputEvents({
1894
- onInput: _this3.onInputChange,
2033
+ onInput: _this5.onInputChange,
1895
2034
  onBlur: function onBlur(e) {
1896
- _this3.$emit('blur', e, _this3.triggerQuery);
2035
+ _this5.$emit('blur', e, _this5.triggerQuery);
1897
2036
  },
1898
- onFocus: _this3.handleFocus,
2037
+ onFocus: _this5.handleFocus,
1899
2038
  onKeyPress: function onKeyPress(e) {
1900
- _this3.$emit('keyPress', e, _this3.triggerQuery);
2039
+ _this5.$emit('keyPress', e, _this5.triggerQuery);
1901
2040
 
1902
- _this3.$emit('key-press', e, _this3.triggerQuery);
2041
+ _this5.$emit('key-press', e, _this5.triggerQuery);
1903
2042
  },
1904
2043
  onKeyDown: function onKeyDown(e) {
1905
- return _this3.handleKeyDown(e, highlightedIndex);
2044
+ return _this5.handleKeyDown(e, highlightedIndex);
1906
2045
  },
1907
2046
  onKeyUp: function onKeyUp(e) {
1908
- _this3.$emit('keyUp', e, _this3.triggerQuery);
2047
+ _this5.$emit('keyUp', e, _this5.triggerQuery);
1909
2048
 
1910
- _this3.$emit('key-up', e, _this3.triggerQuery);
2049
+ _this5.$emit('key-up', e, _this5.triggerQuery);
1911
2050
  },
1912
2051
  onClick: function onClick() {
1913
2052
  setHighlightedIndex(null);
1914
2053
  }
1915
2054
  })),
1916
2055
  "domProps": _extends({}, getInputProps({
1917
- value: _this3.$data.currentValue === null ? '' : _this3.$data.currentValue
2056
+ value: _this5.$data.currentValue === null ? '' : _this5.$data.currentValue
1918
2057
  }))
1919
- }), _this3.renderIcons(), !expandSuggestionsContainer && renderSuggestionsContainer()]), ' ', _this3.renderInputAddonAfter()]), expandSuggestionsContainer && renderSuggestionsContainer()]);
2058
+ }), _this5.renderIcons(), !expandSuggestionsContainer && renderSuggestionsContainer()]), ' ', _this5.renderInputAddonAfter()]), expandSuggestionsContainer && renderSuggestionsContainer(), _this5.renderTags()]);
1920
2059
  }
1921
2060
  }
1922
2061
  }) : h("div", {
@@ -1932,26 +2071,26 @@ var DataSearch = {
1932
2071
  },
1933
2072
  "on": _extends({}, {
1934
2073
  blur: function blur(e) {
1935
- _this3.$emit('blur', e, _this3.triggerQuery);
2074
+ _this5.$emit('blur', e, _this5.triggerQuery);
1936
2075
  },
1937
2076
  keypress: function keypress(e) {
1938
- _this3.$emit('keyPress', e, _this3.triggerQuery);
2077
+ _this5.$emit('keyPress', e, _this5.triggerQuery);
1939
2078
 
1940
- _this3.$emit('key-press', e, _this3.triggerQuery);
2079
+ _this5.$emit('key-press', e, _this5.triggerQuery);
1941
2080
  },
1942
2081
  input: this.onInputChange,
1943
2082
  focus: function focus(e) {
1944
- _this3.$emit('focus', e, _this3.triggerQuery);
2083
+ _this5.$emit('focus', e, _this5.triggerQuery);
1945
2084
  },
1946
2085
  keydown: function keydown(e) {
1947
- _this3.$emit('keyDown', e, _this3.triggerQuery);
2086
+ _this5.$emit('keyDown', e, _this5.triggerQuery);
1948
2087
 
1949
- _this3.$emit('key-down', e, _this3.triggerQuery);
2088
+ _this5.$emit('key-down', e, _this5.triggerQuery);
1950
2089
  },
1951
2090
  keyup: function keyup(e) {
1952
- _this3.$emit('keyUp', e, _this3.triggerQuery);
2091
+ _this5.$emit('keyUp', e, _this5.triggerQuery);
1953
2092
 
1954
- _this3.$emit('key-up', e, _this3.triggerQuery);
2093
+ _this5.$emit('key-up', e, _this5.triggerQuery);
1955
2094
  }
1956
2095
  }),
1957
2096
  "domProps": _extends({}, {
@@ -2165,4 +2304,4 @@ DataSearch.install = function (Vue) {
2165
2304
 
2166
2305
  DataSearch.componentType = componentTypes.dataSearch;
2167
2306
 
2168
- export { CustomSvg as C, DataSearch as D, InputAddon as I, Mic as M, SearchSvg as S, SuggestionWrapper as a, InputGroup as b, SuggestionItem as c };
2307
+ export { CustomSvg as C, DataSearch as D, InputAddon as I, Mic as M, SearchSvg as S, TagItem as T, SuggestionWrapper as a, TagsContainer as b, InputGroup as c, SuggestionItem as d };
@@ -1,5 +1,5 @@
1
1
  import '@appbaseio/reactivecore';
2
- import './_rollupPluginBabelHelpers-ecf6c03c.js';
2
+ import './_rollupPluginBabelHelpers-76660dab.js';
3
3
  import 'vue-types';
4
4
  import '@appbaseio/reactivecore/lib/utils/constants';
5
5
  import '@appbaseio/reactivecore/lib/utils/helper';
@@ -9,14 +9,14 @@ import 'polished';
9
9
  import './vueTypes-9326e0be.js';
10
10
  import '@appbaseio/reactivecore/lib/utils/transform';
11
11
  import 'redux';
12
- import './index-5daa8276.js';
13
- import './ComponentWrapper-bbb717bc.js';
14
- import './Title-579f8d6c.js';
15
- import './Flex-aac91505.js';
12
+ import './index-3d98f51b.js';
13
+ import './ComponentWrapper-6ad0997b.js';
14
+ import './Title-3342664a.js';
15
+ import './Flex-1f0795c3.js';
16
16
  import 'hotkeys-js';
17
- export { D as default } from './DataSearch-a5aaa29e.js';
18
- import './CancelSvg-4d9e0857.js';
19
- import './Input-d1bb4868.js';
17
+ export { D as default } from './DataSearch-1dba393f.js';
18
+ import './CancelSvg-4cfae5fd.js';
19
+ import './Input-7a2a9fac.js';
20
20
  import 'compute-scroll-into-view';
21
- import './Container-4383c6f0.js';
21
+ import './Container-ba826e96.js';
22
22
  import 'vue-highlight-words';
@@ -1,13 +1,13 @@
1
1
  import { helper } from '@appbaseio/reactivecore';
2
- import { _ as _taggedTemplateLiteralLoose, a as _extends } from './_rollupPluginBabelHelpers-ecf6c03c.js';
2
+ import { _ as _taggedTemplateLiteralLoose, a as _extends } from './_rollupPluginBabelHelpers-76660dab.js';
3
3
  import VueTypes from 'vue-types';
4
4
  import { css } from 'emotion';
5
5
  import styled from '@appbaseio/vue-emotion';
6
6
  import { t as types } from './vueTypes-9326e0be.js';
7
- import { a as isFunction } from './index-5daa8276.js';
7
+ import { a as isFunction } from './index-3d98f51b.js';
8
8
  import _mergeJSXProps from '@vue/babel-helper-vue-jsx-merge-props';
9
- import { D as Downshift, b as InputWrapper, a as IconGroup, I as IconWrapper, C as CancelSvg } from './CancelSvg-4d9e0857.js';
10
- import { s as suggestionsContainer, a as suggestions, I as Input } from './Input-d1bb4868.js';
9
+ import { D as Downshift, b as InputWrapper, a as IconGroup, I as IconWrapper, C as CancelSvg } from './CancelSvg-4cfae5fd.js';
10
+ import { s as suggestionsContainer, a as suggestions, I as Input } from './Input-7a2a9fac.js';
11
11
  import { replaceDiacritics } from '@appbaseio/reactivecore/lib/utils/suggestions';
12
12
 
13
13
  var _templateObject, _templateObject2, _templateObject3, _templateObject4;