@appbaseio/reactivesearch-vue 1.16.0-alpha.54 → 1.16.0-alpha.57

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