@appbaseio/reactivesearch-vue 3.0.4 → 3.0.5

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.
@@ -27,8 +27,8 @@ var ReactiveBase = require('./ReactiveBase.js');
27
27
  var hotkeys = _interopDefault(require('hotkeys-js'));
28
28
  var xss = _interopDefault(require('xss'));
29
29
  var remarkable = require('remarkable');
30
- var DropDown = require('./DropDown-989facb5.js');
31
- var Input = require('./Input-c11e13af.js');
30
+ var DropDown = require('./DropDown-1532353d.js');
31
+ var Input = require('./Input-4279b088.js');
32
32
  var Container = require('./Container-29f049b2.js');
33
33
  var Highlight = _interopDefault(require('vue-highlight-words'));
34
34
  var query = require('@appbaseio/reactivecore/lib/actions/query');
@@ -1305,7 +1305,23 @@ var SearchBox = vue.defineComponent({
1305
1305
  AIUIConfig: vueTypes.types.AIUIConfig
1306
1306
  },
1307
1307
  mounted: function mounted() {
1308
+ var _this = this;
1308
1309
  this.listenForFocusShortcuts();
1310
+ var dropdownEle = this.$refs[_dropdownULRef];
1311
+ if (dropdownEle) {
1312
+ var handleScroll = function handleScroll() {
1313
+ var scrollTop = dropdownEle.scrollTop;
1314
+ _this.lastScrollTop = scrollTop;
1315
+ if (scrollTop < _this.lastScrollTop) {
1316
+ // User is scrolling up
1317
+ clearInterval(_this.scrollTimerRef);
1318
+ _this.isUserScrolling = true;
1319
+ }
1320
+ // Update lastScrollTop with the current scroll position
1321
+ _this.lastScrollTop = scrollTop;
1322
+ };
1323
+ dropdownEle.addEventListener('scroll', handleScroll);
1324
+ }
1309
1325
  },
1310
1326
  updated: function updated() {
1311
1327
  if (this.$props.mode === constants.SEARCH_COMPONENTS_MODES.SELECT && this.$options.isTagsMode === true) {
@@ -1441,9 +1457,10 @@ var SearchBox = vue.defineComponent({
1441
1457
  }
1442
1458
  },
1443
1459
  isAITyping: function isAITyping(newVal, oldVal) {
1444
- var _this = this;
1460
+ var _this2 = this;
1445
1461
  var scrollAIContainer = function scrollAIContainer() {
1446
- var dropdownEle = _this.$refs[_dropdownULRef];
1462
+ if (_this2.isUserScrolling) return;
1463
+ var dropdownEle = _this2.$refs[_dropdownULRef];
1447
1464
  if (dropdownEle) {
1448
1465
  dropdownEle.scrollTo({
1449
1466
  top: dropdownEle.scrollHeight,
@@ -1452,6 +1469,7 @@ var SearchBox = vue.defineComponent({
1452
1469
  }
1453
1470
  };
1454
1471
  if (!newVal && oldVal) {
1472
+ clearInterval(this.scrollTimerRef);
1455
1473
  this.showAIScreenFooter = true;
1456
1474
  if (this.$props.AIUIConfig && typeof this.$props.AIUIConfig.showFeedback === 'boolean' ? this.$props.AIUIConfig.showFeedback : true) {
1457
1475
  this.showFeedbackComponent = true;
@@ -1460,7 +1478,7 @@ var SearchBox = vue.defineComponent({
1460
1478
  scrollAIContainer();
1461
1479
  }, 500);
1462
1480
  } else if (newVal) {
1463
- this.scrollTimerRef = setTimeout(function () {
1481
+ this.scrollTimerRef = setInterval(function () {
1464
1482
  scrollAIContainer();
1465
1483
  }, 2000);
1466
1484
  }
@@ -1552,7 +1570,7 @@ var SearchBox = vue.defineComponent({
1552
1570
  }
1553
1571
  },
1554
1572
  setValue: function setValue(value, isDefaultValue, props, cause, toggleIsOpen, categoryValue, shouldExecuteQuery) {
1555
- var _this2 = this;
1573
+ var _this3 = this;
1556
1574
  if (isDefaultValue === void 0) {
1557
1575
  isDefaultValue = false;
1558
1576
  }
@@ -1569,65 +1587,65 @@ var SearchBox = vue.defineComponent({
1569
1587
  shouldExecuteQuery = true;
1570
1588
  }
1571
1589
  var performUpdate = function performUpdate() {
1572
- if (_this2.$options.isTagsMode && isEqual(value, _this2.selectedTags)) {
1590
+ if (_this3.$options.isTagsMode && isEqual(value, _this3.selectedTags)) {
1573
1591
  return;
1574
1592
  }
1575
- if (_this2.$options.isTagsMode && cause === reactivecore.causes.SUGGESTION_SELECT) {
1576
- if (Array.isArray(_this2.selectedTags) && _this2.selectedTags.length) {
1593
+ if (_this3.$options.isTagsMode && cause === reactivecore.causes.SUGGESTION_SELECT) {
1594
+ if (Array.isArray(_this3.selectedTags) && _this3.selectedTags.length) {
1577
1595
  // check if value already present in selectedTags
1578
- if (typeof value === 'string' && _this2.selectedTags.includes(value)) {
1579
- _this2.isOpen = false;
1596
+ if (typeof value === 'string' && _this3.selectedTags.includes(value)) {
1597
+ _this3.isOpen = false;
1580
1598
  return;
1581
1599
  }
1582
- _this2.selectedTags = [].concat(_this2.selectedTags);
1600
+ _this3.selectedTags = [].concat(_this3.selectedTags);
1583
1601
  if (typeof value === 'string' && !!value) {
1584
- _this2.selectedTags.push(value);
1585
- } else if (Array.isArray(value) && !isEqual(_this2.selectedTags, value)) {
1586
- _this2.selectedTags = value;
1602
+ _this3.selectedTags.push(value);
1603
+ } else if (Array.isArray(value) && !isEqual(_this3.selectedTags, value)) {
1604
+ _this3.selectedTags = value;
1587
1605
  }
1588
1606
  } else if (value) {
1589
- _this2.selectedTags = typeof value !== 'string' ? value : [].concat(value);
1607
+ _this3.selectedTags = typeof value !== 'string' ? value : [].concat(value);
1590
1608
  }
1591
- _this2.currentValue = '';
1609
+ _this3.currentValue = '';
1592
1610
  } else {
1593
- _this2.currentValue = index.decodeHtml(value);
1611
+ _this3.currentValue = index.decodeHtml(value);
1594
1612
  }
1595
1613
  var queryHandlerValue = value;
1596
- if (_this2.$options.isTagsMode && cause === reactivecore.causes.SUGGESTION_SELECT) {
1597
- queryHandlerValue = Array.isArray(_this2.selectedTags) && _this2.selectedTags.length ? _this2.selectedTags : undefined;
1614
+ if (_this3.$options.isTagsMode && cause === reactivecore.causes.SUGGESTION_SELECT) {
1615
+ queryHandlerValue = Array.isArray(_this3.selectedTags) && _this3.selectedTags.length ? _this3.selectedTags : undefined;
1598
1616
  }
1599
- if ((_this2.faqAnswer || _this2.faqQuestion) && value === '') {
1617
+ if ((_this3.faqAnswer || _this3.faqQuestion) && value === '') {
1600
1618
  // Empty the previous state
1601
- _this2.faqAnswer = '';
1602
- _this2.faqQuestion = '';
1603
- _this2.showAIScreen = false;
1619
+ _this3.faqAnswer = '';
1620
+ _this3.faqQuestion = '';
1621
+ _this3.showAIScreen = false;
1604
1622
  }
1605
1623
  if (isDefaultValue) {
1606
- if (_this2.$props.autosuggest) {
1624
+ if (_this3.$props.autosuggest) {
1607
1625
  if (toggleIsOpen) {
1608
- _this2.isOpen = false;
1626
+ _this3.isOpen = false;
1609
1627
  }
1610
- if (typeof _this2.currentValue === 'string') _this2.triggerDefaultQuery(_this2.currentValue, props.enableAI && _this2.currentTriggerMode === constants.AI_TRIGGER_MODES.QUESTION && _this2.currentValue.endsWith('?') ? {
1628
+ if (typeof _this3.currentValue === 'string') _this3.triggerDefaultQuery(_this3.currentValue, props.enableAI && _this3.currentTriggerMode === constants.AI_TRIGGER_MODES.QUESTION && _this3.currentValue.endsWith('?') ? {
1611
1629
  enableAI: true
1612
1630
  } : {}, shouldExecuteQuery);
1613
1631
  } // in case of strict selection only SUGGESTION_SELECT should be able
1614
1632
  // to set the query otherwise the value should reset
1615
1633
  if (props.strictSelection) {
1616
- if (cause === reactivecore.causes.SUGGESTION_SELECT || (_this2.$options.isTagsMode ? _this2.selectedTags.length === 0 : value === '')) {
1617
- _this2.triggerCustomQuery(queryHandlerValue, _this2.$options.isTagsMode ? undefined : categoryValue, shouldExecuteQuery);
1634
+ if (cause === reactivecore.causes.SUGGESTION_SELECT || (_this3.$options.isTagsMode ? _this3.selectedTags.length === 0 : value === '')) {
1635
+ _this3.triggerCustomQuery(queryHandlerValue, _this3.$options.isTagsMode ? undefined : categoryValue, shouldExecuteQuery);
1618
1636
  } else {
1619
- _this2.setValue('', true);
1637
+ _this3.setValue('', true);
1620
1638
  }
1621
1639
  } else if (props.value === undefined || cause === reactivecore.causes.SUGGESTION_SELECT || cause === reactivecore.causes.CLEAR_VALUE) {
1622
- _this2.showAIScreen = false;
1623
- _this2.triggerCustomQuery(queryHandlerValue, _this2.$options.isTagsMode ? undefined : categoryValue, shouldExecuteQuery);
1640
+ _this3.showAIScreen = false;
1641
+ _this3.triggerCustomQuery(queryHandlerValue, _this3.$options.isTagsMode ? undefined : categoryValue, shouldExecuteQuery);
1624
1642
  }
1625
1643
  } else {
1626
1644
  // debounce for handling text while typing
1627
- _this2.handleTextChange(value, cause);
1645
+ _this3.handleTextChange(value, cause);
1628
1646
  }
1629
- _this2.$emit('valueChange', value);
1630
- _this2.$emit('value-change', value);
1647
+ _this3.$emit('valueChange', value);
1648
+ _this3.$emit('value-change', value);
1631
1649
  };
1632
1650
  checkValueChange(props.componentId, value, props.beforeValueChange, performUpdate);
1633
1651
  },
@@ -1776,7 +1794,7 @@ var SearchBox = vue.defineComponent({
1776
1794
  this.$emit('key-down', event, this.triggerQuery);
1777
1795
  },
1778
1796
  onInputChange: function onInputChange(e) {
1779
- var _this3 = this;
1797
+ var _this4 = this;
1780
1798
  var inputValue = e.target.value;
1781
1799
  if (!this.$data.isOpen && this.$props.autosuggest) {
1782
1800
  this.isOpen = true;
@@ -1790,7 +1808,7 @@ var SearchBox = vue.defineComponent({
1790
1808
  } else {
1791
1809
  this.$emit('change', inputValue, function (_ref3) {
1792
1810
  var isOpen = _ref3.isOpen;
1793
- return _this3.triggerQuery({
1811
+ return _this4.triggerQuery({
1794
1812
  defaultQuery: true,
1795
1813
  customQuery: true,
1796
1814
  value: inputValue,
@@ -1834,7 +1852,7 @@ var SearchBox = vue.defineComponent({
1834
1852
  }
1835
1853
  },
1836
1854
  onSuggestionSelected: function onSuggestionSelected(suggestion) {
1837
- var _this4 = this;
1855
+ var _this5 = this;
1838
1856
  var value = this.$props.value;
1839
1857
  // The state of the suggestion is open by the time it reaches here. i.e. isOpen = true
1840
1858
  // handle when FAQ suggestion is clicked
@@ -1883,10 +1901,10 @@ var SearchBox = vue.defineComponent({
1883
1901
  this.setValue(emitValue, true, this.$props, reactivecore.causes.SUGGESTION_SELECT, false, suggestion._category);
1884
1902
  this.$emit('change', emitValue, function (_ref4) {
1885
1903
  var isOpen = _ref4.isOpen;
1886
- return _this4.triggerQuery(_rollupPluginBabelHelpers._extends({
1904
+ return _this5.triggerQuery(_rollupPluginBabelHelpers._extends({
1887
1905
  isOpen: isOpen,
1888
1906
  value: emitValue
1889
- }, !_this4.$options.isTagsMode && {
1907
+ }, !_this5.$options.isTagsMode && {
1890
1908
  categoryValue: suggestion._category
1891
1909
  }));
1892
1910
  });
@@ -1926,7 +1944,7 @@ var SearchBox = vue.defineComponent({
1926
1944
  return null;
1927
1945
  },
1928
1946
  renderErrorComponent: function renderErrorComponent(isAIError) {
1929
- var _this5 = this;
1947
+ var _this6 = this;
1930
1948
  if (isAIError === void 0) {
1931
1949
  isAIError = false;
1932
1950
  }
@@ -1953,7 +1971,7 @@ var SearchBox = vue.defineComponent({
1953
1971
  "themePreset": this.themePreset
1954
1972
  }, {
1955
1973
  "default": function _default() {
1956
- return [index.isFunction(renderError) ? renderError(_this5.error) : renderError];
1974
+ return [index.isFunction(renderError) ? renderError(_this6.error) : renderError];
1957
1975
  }
1958
1976
  });
1959
1977
  }
@@ -2033,7 +2051,7 @@ var SearchBox = vue.defineComponent({
2033
2051
  });
2034
2052
  },
2035
2053
  renderEnterButtonElement: function renderEnterButtonElement() {
2036
- var _this6 = this;
2054
+ var _this7 = this;
2037
2055
  var _this$$props2 = this.$props,
2038
2056
  enterButton = _this$$props2.enterButton,
2039
2057
  innerClass = _this$$props2.innerClass;
@@ -2041,12 +2059,12 @@ var SearchBox = vue.defineComponent({
2041
2059
  if (enterButton) {
2042
2060
  var getEnterButtonMarkup = function getEnterButtonMarkup() {
2043
2061
  if (renderEnterButton) {
2044
- return renderEnterButton(_this6.enterButtonOnClick);
2062
+ return renderEnterButton(_this7.enterButtonOnClick);
2045
2063
  }
2046
2064
  return vue.createVNode(Button.Button, {
2047
2065
  "class": "enter-btn " + getClassName$1(innerClass, 'enter-button'),
2048
2066
  "primary": true,
2049
- "onClick": _this6.enterButtonOnClick
2067
+ "onClick": _this7.enterButtonOnClick
2050
2068
  }, {
2051
2069
  "default": function _default() {
2052
2070
  return [vue.createTextVNode("Search")];
@@ -2072,7 +2090,7 @@ var SearchBox = vue.defineComponent({
2072
2090
  return '/';
2073
2091
  },
2074
2092
  renderLeftIcons: function renderLeftIcons() {
2075
- var _this7 = this;
2093
+ var _this8 = this;
2076
2094
  var _slot3;
2077
2095
  var _this$$props3 = this.$props,
2078
2096
  iconPosition = _this$$props3.iconPosition,
@@ -2082,8 +2100,8 @@ var SearchBox = vue.defineComponent({
2082
2100
  }, {
2083
2101
  "default": function _default() {
2084
2102
  return [iconPosition === 'left' && showIcon && vue.createVNode(DropDown.IconWrapper, {
2085
- "onClick": _this7.handleSearchIconClick
2086
- }, _isSlot(_slot3 = _this7.renderIcon()) ? _slot3 : {
2103
+ "onClick": _this8.handleSearchIconClick
2104
+ }, _isSlot(_slot3 = _this8.renderIcon()) ? _slot3 : {
2087
2105
  "default": function _default() {
2088
2106
  return [_slot3];
2089
2107
  }
@@ -2092,7 +2110,7 @@ var SearchBox = vue.defineComponent({
2092
2110
  })]);
2093
2111
  },
2094
2112
  renderRightIcons: function renderRightIcons() {
2095
- var _this8 = this;
2113
+ var _this9 = this;
2096
2114
  var _slot4, _slot5, _slot6;
2097
2115
  var _this$$props4 = this.$props,
2098
2116
  iconPosition = _this$$props4.iconPosition,
@@ -2109,29 +2127,29 @@ var SearchBox = vue.defineComponent({
2109
2127
  }, {
2110
2128
  "default": function _default() {
2111
2129
  return [currentValue && showClear && vue.createVNode(DropDown.IconWrapper, {
2112
- "onClick": _this8.clearValue,
2130
+ "onClick": _this9.clearValue,
2113
2131
  "showIcon": showIcon,
2114
2132
  "isClearIcon": true
2115
- }, _isSlot(_slot4 = _this8.renderCancelIcon()) ? _slot4 : {
2133
+ }, _isSlot(_slot4 = _this9.renderCancelIcon()) ? _slot4 : {
2116
2134
  "default": function _default() {
2117
2135
  return [_slot4];
2118
2136
  }
2119
2137
  }), showFocusShortcutsIcon && vue.createVNode(DropDown.ButtonIconWrapper, {
2120
2138
  "onClick": function onClick(e) {
2121
- return _this8.focusSearchBox(e);
2139
+ return _this9.focusSearchBox(e);
2122
2140
  }
2123
- }, _isSlot(_slot5 = _this8.renderShortcut()) ? _slot5 : {
2141
+ }, _isSlot(_slot5 = _this9.renderShortcut()) ? _slot5 : {
2124
2142
  "default": function _default() {
2125
2143
  return [_slot5];
2126
2144
  }
2127
2145
  }), showVoiceSearch && vue.createVNode(Mic, {
2128
2146
  "getInstance": getMicInstance,
2129
2147
  "render": renderMic,
2130
- "handleResult": _this8.handleVoiceResults,
2148
+ "handleResult": _this9.handleVoiceResults,
2131
2149
  "className": getClassName$1(innerClass, 'mic') || null
2132
2150
  }, null), iconPosition === 'right' && showIcon && vue.createVNode(DropDown.IconWrapper, {
2133
- "onClick": _this8.handleSearchIconClick
2134
- }, _isSlot(_slot6 = _this8.renderIcon()) ? _slot6 : {
2151
+ "onClick": _this9.handleSearchIconClick
2152
+ }, _isSlot(_slot6 = _this9.renderIcon()) ? _slot6 : {
2135
2153
  "default": function _default() {
2136
2154
  return [_slot6];
2137
2155
  }
@@ -2150,7 +2168,7 @@ var SearchBox = vue.defineComponent({
2150
2168
  (_this$$refs4 = this.$refs) == null || (_this$$refs4 = _this$$refs4[this.$props.innerRef]) == null || (_this$$refs4 = _this$$refs4.$el) == null ? void 0 : _this$$refs4.focus(); // eslint-disable-line
2151
2169
  },
2152
2170
  listenForFocusShortcuts: function listenForFocusShortcuts() {
2153
- var _this9 = this;
2171
+ var _this10 = this;
2154
2172
  var _this$$props$focusSho = this.$props.focusShortcuts,
2155
2173
  focusShortcuts = _this$$props$focusSho === void 0 ? ['/'] : _this$$props$focusSho;
2156
2174
  if (index.isEmpty(focusShortcuts)) {
@@ -2165,7 +2183,7 @@ var SearchBox = vue.defineComponent({
2165
2183
  function (event, handler) {
2166
2184
  // Prevent the default refresh event under WINDOWS system
2167
2185
  event.preventDefault();
2168
- _this9.focusSearchBox(event);
2186
+ _this10.focusSearchBox(event);
2169
2187
  });
2170
2188
 
2171
2189
  // if one of modifier keys are used, they are handled below
@@ -2175,7 +2193,7 @@ var SearchBox = vue.defineComponent({
2175
2193
  for (var index$1 = 0; index$1 < modifierKeys.length; index$1 += 1) {
2176
2194
  var element = modifierKeys[index$1];
2177
2195
  if (hotkeys[element]) {
2178
- _this9.focusSearchBox(event);
2196
+ _this10.focusSearchBox(event);
2179
2197
  break;
2180
2198
  }
2181
2199
  }
@@ -2188,10 +2206,10 @@ var SearchBox = vue.defineComponent({
2188
2206
  this.triggerDefaultQuery(value);
2189
2207
  },
2190
2208
  renderActionIcon: function renderActionIcon(suggestion) {
2191
- var _this10 = this;
2209
+ var _this11 = this;
2192
2210
  var handleAutoFillClick = function handleAutoFillClick(e) {
2193
2211
  e.stopPropagation();
2194
- _this10.onAutofillClick(suggestion);
2212
+ _this11.onAutofillClick(suggestion);
2195
2213
  };
2196
2214
  if (suggestion._suggestion_type === helper.suggestionTypes.Featured) {
2197
2215
  if (suggestion.action === helper.featuredSuggestionsActionTypes.FUNCTION) {
@@ -2214,7 +2232,7 @@ var SearchBox = vue.defineComponent({
2214
2232
  return null;
2215
2233
  },
2216
2234
  renderTag: function renderTag(item) {
2217
- var _this11 = this;
2235
+ var _this12 = this;
2218
2236
  var innerClass = this.$props.innerClass;
2219
2237
  return vue.createVNode(TagItem, {
2220
2238
  "class": getClassName$1(innerClass, 'selected-tag') || ''
@@ -2225,7 +2243,7 @@ var SearchBox = vue.defineComponent({
2225
2243
  "aria-label": "delete-tag",
2226
2244
  "class": "close-icon",
2227
2245
  "onClick": function onClick() {
2228
- return _this11.clearTag(item);
2246
+ return _this12.clearTag(item);
2229
2247
  }
2230
2248
  }, [vue.createVNode(DropDown.CancelSvg, null, null)])];
2231
2249
  }
@@ -2248,7 +2266,7 @@ var SearchBox = vue.defineComponent({
2248
2266
  }
2249
2267
  },
2250
2268
  renderTags: function renderTags() {
2251
- var _this12 = this;
2269
+ var _this13 = this;
2252
2270
  if (!Array.isArray(this.selectedTags)) {
2253
2271
  return null;
2254
2272
  }
@@ -2262,16 +2280,16 @@ var SearchBox = vue.defineComponent({
2262
2280
  }) : vue.createVNode(TagsContainer, null, {
2263
2281
  "default": function _default() {
2264
2282
  return [tagsList.map(function (item) {
2265
- return _this12.renderTag(item);
2283
+ return _this13.renderTag(item);
2266
2284
  }), shouldRenderClearAllTag && vue.createVNode(TagItem, {
2267
- "class": getClassName$1(_this12.$props.innerClass, 'selected-tag') || ''
2285
+ "class": getClassName$1(_this13.$props.innerClass, 'selected-tag') || ''
2268
2286
  }, {
2269
2287
  "default": function _default() {
2270
2288
  return [vue.createVNode("span", null, [vue.createTextVNode("Clear All")]), vue.createVNode("span", {
2271
2289
  "role": "img",
2272
2290
  "aria-label": "delete-tag",
2273
2291
  "class": "close-icon",
2274
- "onClick": _this12.clearAllTags
2292
+ "onClick": _this13.clearAllTags
2275
2293
  }, [vue.createVNode(DropDown.CancelSvg, null, null)])];
2276
2294
  }
2277
2295
  })];
@@ -2279,13 +2297,13 @@ var SearchBox = vue.defineComponent({
2279
2297
  });
2280
2298
  },
2281
2299
  getAISourceObjects: function getAISourceObjects() {
2282
- var _this13 = this;
2300
+ var _this14 = this;
2283
2301
  var sourceObjects = [];
2284
2302
  if (!this.AIResponse) return sourceObjects;
2285
2303
  var docIds = this.AIResponse && this.AIResponse.response && this.AIResponse.response.answer && this.AIResponse.response.answer.documentIds || [];
2286
2304
  if (this.initialHits) {
2287
2305
  docIds.forEach(function (id) {
2288
- var foundSourceObj = _this13.initialHits.find(function (hit) {
2306
+ var foundSourceObj = _this14.initialHits.find(function (hit) {
2289
2307
  return hit._id === id;
2290
2308
  }) || {};
2291
2309
  if (foundSourceObj) {
@@ -2319,7 +2337,7 @@ var SearchBox = vue.defineComponent({
2319
2337
  },
2320
2338
  renderAIScreenFooter: function renderAIScreenFooter() {
2321
2339
  var _slot8;
2322
- var _this14 = this;
2340
+ var _this15 = this;
2323
2341
  var _this$$props$AIUIConf2 = this.$props.AIUIConfig,
2324
2342
  AIUIConfig = _this$$props$AIUIConf2 === void 0 ? {} : _this$$props$AIUIConf2;
2325
2343
  var _ref6 = AIUIConfig || {},
@@ -2328,11 +2346,11 @@ var SearchBox = vue.defineComponent({
2328
2346
  _ref6$onSourceClick = _ref6.onSourceClick,
2329
2347
  onSourceClick = _ref6$onSourceClick === void 0 ? function () {} : _ref6$onSourceClick;
2330
2348
  var renderSourceDocumentLabel = function renderSourceDocumentLabel(sourceObj) {
2331
- if (_this14.$props.AIUIConfig && _this14.$props.AIUIConfig.renderSourceDocument) {
2332
- return _this14.$props.AIUIConfig.renderSourceDocument(sourceObj);
2349
+ if (_this15.$props.AIUIConfig && _this15.$props.AIUIConfig.renderSourceDocument) {
2350
+ return _this15.$props.AIUIConfig.renderSourceDocument(sourceObj);
2333
2351
  }
2334
- if (_this14.$slots.renderSourceDocument) {
2335
- return _this14.$slots.renderSourceDocument(sourceObj);
2352
+ if (_this15.$slots.renderSourceDocument) {
2353
+ return _this15.$slots.renderSourceDocument(sourceObj);
2336
2354
  }
2337
2355
  return sourceObj._id;
2338
2356
  };
@@ -2340,10 +2358,10 @@ var SearchBox = vue.defineComponent({
2340
2358
  "themePreset": this.$props.themePreset
2341
2359
  }, {
2342
2360
  "default": function _default() {
2343
- return [vue.createTextVNode("Summary generated using the following sources:"), ' ', vue.createVNode(SourceTags, null, _isSlot(_slot8 = _this14.getAISourceObjects().map(function (el) {
2361
+ return [vue.createTextVNode("Summary generated using the following sources:"), ' ', vue.createVNode(SourceTags, null, _isSlot(_slot8 = _this15.getAISourceObjects().map(function (el) {
2344
2362
  var _slot7;
2345
2363
  return vue.createVNode(Button.Button, {
2346
- "class": "--ai-source-tag " + (getClassName$1(_this14.$props.innerClass, 'ai-source-tag') || ''),
2364
+ "class": "--ai-source-tag " + (getClassName$1(_this15.$props.innerClass, 'ai-source-tag') || ''),
2347
2365
  "info": true,
2348
2366
  "onClick": function onClick() {
2349
2367
  return onSourceClick && onSourceClick(el);
@@ -2362,7 +2380,7 @@ var SearchBox = vue.defineComponent({
2362
2380
  }) : null;
2363
2381
  },
2364
2382
  renderAIScreen: function renderAIScreen() {
2365
- var _this15 = this;
2383
+ var _this16 = this;
2366
2384
  var customAIRenderer = this.$props.renderAIAnswer || this.$slots.renderAIAnswer;
2367
2385
  if (customAIRenderer) {
2368
2386
  return customAIRenderer({
@@ -2386,11 +2404,11 @@ var SearchBox = vue.defineComponent({
2386
2404
  "hideUI": this.isAIResponseLoading || this.isLoading || !this.sessionIdFromStore,
2387
2405
  "key": this.sessionIdFromStore,
2388
2406
  "onFeedbackSubmit": function onFeedbackSubmit(useful, reason) {
2389
- _this15.feedbackState = {
2407
+ _this16.feedbackState = {
2390
2408
  isRecorded: true,
2391
2409
  feedbackType: useful ? 'positive' : 'negative'
2392
2410
  };
2393
- _this15.recordAISessionUsefulness(_this15.sessionIdFromStore, {
2411
+ _this16.recordAISessionUsefulness(_this16.sessionIdFromStore, {
2394
2412
  useful: useful,
2395
2413
  reason: reason
2396
2414
  });
@@ -2425,7 +2443,7 @@ var SearchBox = vue.defineComponent({
2425
2443
  });
2426
2444
  },
2427
2445
  renderAskButtonElement: function renderAskButtonElement() {
2428
- var _this16 = this;
2446
+ var _this17 = this;
2429
2447
  var _this$$props5 = this.$props,
2430
2448
  AIUIConfig = _this$$props5.AIUIConfig,
2431
2449
  innerClass = _this$$props5.innerClass;
@@ -2435,12 +2453,12 @@ var SearchBox = vue.defineComponent({
2435
2453
  if (askButton) {
2436
2454
  var getEnterButtonMarkup = function getEnterButtonMarkup() {
2437
2455
  if (renderAskButton) {
2438
- return renderAskButton(_this16.askButtonOnClick);
2456
+ return renderAskButton(_this17.askButtonOnClick);
2439
2457
  }
2440
2458
  return vue.createVNode(Button.Button, {
2441
2459
  "class": "enter-btn " + getClassName$1(innerClass, 'ask-button'),
2442
2460
  "info": true,
2443
- "onClick": _this16.askButtonOnClick
2461
+ "onClick": _this17.askButtonOnClick
2444
2462
  }, {
2445
2463
  "default": function _default() {
2446
2464
  return [vue.createTextVNode("Ask")];
@@ -2455,28 +2473,28 @@ var SearchBox = vue.defineComponent({
2455
2473
  }
2456
2474
  },
2457
2475
  render: function render() {
2458
- var _this17 = this;
2476
+ var _this18 = this;
2459
2477
  var expandSuggestionsContainer = this.$props.expandSuggestionsContainer;
2460
2478
  var _this$$slots = this.$slots,
2461
2479
  recentSearchesIcon = _this$$slots.recentSearchesIcon,
2462
2480
  popularSearchesIcon = _this$$slots.popularSearchesIcon;
2463
- var hasSuggestions = Array.isArray(this.normalizedSuggestions) && this.normalizedSuggestions.length;
2481
+ var hasSuggestions = Array.isArray(this.parsedSuggestions) && this.parsedSuggestions.length;
2464
2482
  var renderItem = this.$slots.renderItem || this.$props.renderItem;
2465
2483
  return vue.createVNode(Container.Container, {
2466
2484
  "class": this.$props.className
2467
2485
  }, {
2468
2486
  "default": function _default() {
2469
- return [_this17.$props.title && vue.createVNode(Title.Title, {
2470
- "class": getClassName$1(_this17.$props.innerClass, 'title') || ''
2487
+ return [_this18.$props.title && vue.createVNode(Title.Title, {
2488
+ "class": getClassName$1(_this18.$props.innerClass, 'title') || ''
2471
2489
  }, {
2472
2490
  "default": function _default() {
2473
- return [_this17.$props.title];
2491
+ return [_this18.$props.title];
2474
2492
  }
2475
- }), _this17.$props.autosuggest ? vue.createVNode(DropDown.Downshift, {
2476
- "id": _this17.$props.componentId + "-downshift",
2477
- "handleChange": _this17.onSuggestionSelected,
2478
- "handleMouseup": _this17.handleStateChange,
2479
- "isOpen": _this17.$data.isOpen
2493
+ }), _this18.$props.autosuggest ? vue.createVNode(DropDown.Downshift, {
2494
+ "id": _this18.$props.componentId + "-downshift",
2495
+ "handleChange": _this18.onSuggestionSelected,
2496
+ "handleMouseup": _this18.handleStateChange,
2497
+ "isOpen": _this18.$data.isOpen
2480
2498
  }, {
2481
2499
  "default": function _default(_ref8) {
2482
2500
  var getInputEvents = _ref8.getInputEvents,
@@ -2532,21 +2550,21 @@ var SearchBox = vue.defineComponent({
2532
2550
  }
2533
2551
  };
2534
2552
  var indexOffset = 0;
2535
- return vue.createVNode("div", null, [_this17.hasCustomRenderer && _this17.getComponent({
2553
+ return vue.createVNode("div", null, [_this18.hasCustomRenderer && _this18.getComponent({
2536
2554
  isOpen: isOpen,
2537
2555
  getItemProps: getItemProps,
2538
2556
  getItemEvents: getItemEvents,
2539
2557
  highlightedIndex: highlightedIndex
2540
- }), _this17.renderErrorComponent(), !_this17.hasCustomRenderer && isOpen && hasSuggestions ? vue.createVNode("ul", {
2541
- "class": Input.suggestions(_this17.themePreset, _this17.theme) + " " + getClassName$1(_this17.$props.innerClass, 'list') + " " + Input.searchboxSuggestions(_this17.themePreset, _this17.theme) + "\n\t\t\t\t\t\t\t\t\t\t\t\t\t",
2558
+ }), _this18.renderErrorComponent(), !_this18.hasCustomRenderer && isOpen && hasSuggestions ? vue.createVNode("ul", {
2559
+ "class": Input.suggestions(_this18.themePreset, _this18.theme) + " " + getClassName$1(_this18.$props.innerClass, 'list') + " " + Input.searchboxSuggestions(_this18.themePreset, _this18.theme) + "\n\t\t\t\t\t\t\t\t\t\t\t\t\t",
2542
2560
  "ref": _dropdownULRef
2543
- }, [_this17.showAIScreen && vue.createVNode(SearchBoxAISection, {
2544
- "themePreset": _this17.$props.themePreset
2561
+ }, [_this18.showAIScreen && vue.createVNode(SearchBoxAISection, {
2562
+ "themePreset": _this18.$props.themePreset
2545
2563
  }, {
2546
2564
  "default": function _default() {
2547
- return [_this17.renderAIScreen(), ' ', _this17.renderErrorComponent(true)];
2565
+ return [_this18.renderAIScreen(), ' ', _this18.renderErrorComponent(true)];
2548
2566
  }
2549
- }), !_this17.showAIScreen && _this17.parsedSuggestions.map(function (item, itemIndex) {
2567
+ }), !_this18.showAIScreen && _this18.parsedSuggestions.map(function (item, itemIndex) {
2550
2568
  var index = indexOffset + itemIndex;
2551
2569
  if (Array.isArray(item)) {
2552
2570
  var sectionHtml = xss(item[0].sectionLabel);
@@ -2555,7 +2573,7 @@ var SearchBox = vue.defineComponent({
2555
2573
  "key": "section-" + itemIndex,
2556
2574
  "class": "section-container"
2557
2575
  }, [sectionHtml ? vue.createVNode("div", {
2558
- "class": "section-header " + getClassName$1(_this17.$props.innerClass, 'section-label'),
2576
+ "class": "section-header " + getClassName$1(_this18.$props.innerClass, 'section-label'),
2559
2577
  "key": "" + item[0].sectionId,
2560
2578
  "innerHTML": sectionHtml
2561
2579
  }, null) : null, vue.createVNode("ul", {
@@ -2575,7 +2593,7 @@ var SearchBox = vue.defineComponent({
2575
2593
  justifyContent: 'flex-start',
2576
2594
  alignItems: 'center'
2577
2595
  },
2578
- "class": "" + (highlightedIndex === index + sectionIndex ? "active-li-item " + getClassName$1(_this17.$props.innerClass, 'active-suggestion-item') : "li-item " + getClassName$1(_this17.$props.innerClass, 'suggestion-item'))
2596
+ "class": "" + (highlightedIndex === index + sectionIndex ? "active-li-item " + getClassName$1(_this18.$props.innerClass, 'active-suggestion-item') : "li-item " + getClassName$1(_this18.$props.innerClass, 'suggestion-item'))
2579
2597
  }), [renderItem(sectionItem)]);
2580
2598
  }
2581
2599
  if (sectionItem._suggestion_type === '_internal_a_i_trigger') {
@@ -2589,9 +2607,9 @@ var SearchBox = vue.defineComponent({
2589
2607
  justifyContent: 'flex-start',
2590
2608
  alignItems: 'center'
2591
2609
  },
2592
- "class": "" + (highlightedIndex === index + sectionIndex ? "active-li-item " + getClassName$1(_this17.$props.innerClass, 'active-suggestion-item') : "li-item " + getClassName$1(_this17.$props.innerClass, 'suggestion-item'))
2610
+ "class": "" + (highlightedIndex === index + sectionIndex ? "active-li-item " + getClassName$1(_this18.$props.innerClass, 'active-suggestion-item') : "li-item " + getClassName$1(_this18.$props.innerClass, 'suggestion-item'))
2593
2611
  }), [vue.createVNode(SuggestionItem, {
2594
- "currentValue": _this17.currentValue,
2612
+ "currentValue": _this18.currentValue,
2595
2613
  "suggestion": sectionItem
2596
2614
  }, null)]);
2597
2615
  }
@@ -2605,7 +2623,7 @@ var SearchBox = vue.defineComponent({
2605
2623
  justifyContent: 'flex-start',
2606
2624
  alignItems: 'center'
2607
2625
  },
2608
- "class": "" + (highlightedIndex === index + sectionIndex ? "active-li-item " + getClassName$1(_this17.$props.innerClass, 'active-suggestion-item') : "li-item " + getClassName$1(_this17.$props.innerClass, 'suggestion-item'))
2626
+ "class": "" + (highlightedIndex === index + sectionIndex ? "active-li-item " + getClassName$1(_this18.$props.innerClass, 'active-suggestion-item') : "li-item " + getClassName$1(_this18.$props.innerClass, 'suggestion-item'))
2609
2627
  }), [vue.createVNode("div", {
2610
2628
  "style": {
2611
2629
  padding: '0 10px 0 0',
@@ -2613,74 +2631,74 @@ var SearchBox = vue.defineComponent({
2613
2631
  }
2614
2632
  }, [vue.createVNode(CustomSvg, {
2615
2633
  "key": sectionItem._suggestion_type + "-" + sectionIndex,
2616
- "className": getClassName$1(_this17.$props.innerClass, sectionItem._suggestion_type + "-search-icon") || null,
2634
+ "className": getClassName$1(_this18.$props.innerClass, sectionItem._suggestion_type + "-search-icon") || null,
2617
2635
  "icon": getIcon(sectionItem._suggestion_type, sectionItem, suggestionsHaveIcon),
2618
2636
  "type": sectionItem._suggestion_type + "-search-icon"
2619
2637
  }, null)]), vue.createVNode(SuggestionItem, {
2620
- "currentValue": _this17.currentValue,
2638
+ "currentValue": _this18.currentValue,
2621
2639
  "suggestion": sectionItem
2622
- }, null), _this17.renderActionIcon(sectionItem)]);
2640
+ }, null), _this18.renderActionIcon(sectionItem)]);
2623
2641
  })])]);
2624
2642
  }
2625
2643
  return vue.createVNode("div", null, [vue.createTextVNode("No suggestions")]);
2626
- }), !_this17.showAIScreen && _this17.parsedSuggestions.length && _this17.$props.showSuggestionsFooter ? _this17.suggestionsFooter() : null]) : _this17.renderNoSuggestions(_this17.normalizedSuggestions)]);
2644
+ }), !_this18.showAIScreen && _this18.parsedSuggestions.length && _this18.$props.showSuggestionsFooter ? _this18.suggestionsFooter() : null]) : _this18.renderNoSuggestions(_this18.normalizedSuggestions)]);
2627
2645
  };
2628
2646
  return vue.createVNode("div", {
2629
2647
  "class": Input.suggestionsContainer
2630
2648
  }, [vue.createVNode(InputGroup, {
2631
2649
  "searchBox": true,
2632
2650
  "ref": _inputGroupRef,
2633
- "isOpen": _this17.$data.isOpen
2651
+ "isOpen": _this18.$data.isOpen
2634
2652
  }, {
2635
2653
  "default": function _default() {
2636
2654
  return [vue.createVNode(Input.Actions, null, {
2637
2655
  "default": function _default() {
2638
- return [_this17.renderInputAddonBefore(), _this17.renderLeftIcons()];
2656
+ return [_this18.renderInputAddonBefore(), _this18.renderLeftIcons()];
2639
2657
  }
2640
2658
  }), vue.createVNode(DropDown.InputWrapper, null, {
2641
2659
  "default": function _default() {
2642
2660
  return [vue.createVNode(Input.TextArea, vue.mergeProps(_transformOn(getInputEvents({
2643
- onInput: _this17.onInputChange,
2661
+ onInput: _this18.onInputChange,
2644
2662
  onBlur: function onBlur(e) {
2645
- _this17.$emit('blur', e, _this17.triggerQuery);
2663
+ _this18.$emit('blur', e, _this18.triggerQuery);
2646
2664
  },
2647
- onFocus: _this17.handleFocus,
2665
+ onFocus: _this18.handleFocus,
2648
2666
  onKeyPress: function onKeyPress(e) {
2649
- _this17.$emit('keyPress', e, _this17.triggerQuery);
2650
- _this17.$emit('key-press', e, _this17.triggerQuery);
2667
+ _this18.$emit('keyPress', e, _this18.triggerQuery);
2668
+ _this18.$emit('key-press', e, _this18.triggerQuery);
2651
2669
  },
2652
2670
  onKeyDown: function onKeyDown(e) {
2653
- return _this17.handleKeyDown(e, highlightedIndex);
2671
+ return _this18.handleKeyDown(e, highlightedIndex);
2654
2672
  },
2655
2673
  onKeyUp: function onKeyUp(e) {
2656
- _this17.$emit('keyUp', e, _this17.triggerQuery);
2657
- _this17.$emit('key-up', e, _this17.triggerQuery);
2674
+ _this18.$emit('keyUp', e, _this18.triggerQuery);
2675
+ _this18.$emit('key-up', e, _this18.triggerQuery);
2658
2676
  },
2659
2677
  onClick: function onClick() {
2660
2678
  setHighlightedIndex(null);
2661
2679
  }
2662
2680
  })), {
2663
2681
  "searchBox": true,
2664
- "isOpen": _this17.$data.isOpen,
2665
- "id": _this17.$props.componentId + "-input",
2666
- "ref": _this17.$props.innerRef,
2667
- "class": getClassName$1(_this17.$props.innerClass, 'input'),
2668
- "placeholder": _this17.$props.placeholder,
2669
- "autoFocus": _this17.$props.autoFocus
2682
+ "isOpen": _this18.$data.isOpen,
2683
+ "id": _this18.$props.componentId + "-input",
2684
+ "ref": _this18.$props.innerRef,
2685
+ "class": getClassName$1(_this18.$props.innerClass, 'input'),
2686
+ "placeholder": _this18.$props.placeholder,
2687
+ "autoFocus": _this18.$props.autoFocus
2670
2688
  }, getInputProps({
2671
- value: _this17.$data.currentValue === null ? '' : _this17.$data.currentValue
2689
+ value: _this18.$data.currentValue === null ? '' : _this18.$data.currentValue
2672
2690
  }), {
2673
- "themePreset": _this17.themePreset,
2691
+ "themePreset": _this18.themePreset,
2674
2692
  "autocomplete": "off"
2675
2693
  }), null), !expandSuggestionsContainer && renderSuggestionsDropdown()];
2676
2694
  }
2677
2695
  }), vue.createVNode(Input.Actions, null, {
2678
2696
  "default": function _default() {
2679
- return [_this17.renderRightIcons(), _this17.renderInputAddonAfter(), _this17.renderAskButtonElement(), _this17.renderEnterButtonElement()];
2697
+ return [_this18.renderRightIcons(), _this18.renderInputAddonAfter(), _this18.renderAskButtonElement(), _this18.renderEnterButtonElement()];
2680
2698
  }
2681
2699
  })];
2682
2700
  }
2683
- }), expandSuggestionsContainer && renderSuggestionsDropdown(), _this17.renderTags()]);
2701
+ }), expandSuggestionsContainer && renderSuggestionsDropdown(), _this18.renderTags()]);
2684
2702
  }
2685
2703
  }) : vue.createVNode("div", {
2686
2704
  "class": Input.suggestionsContainer
@@ -2691,43 +2709,43 @@ var SearchBox = vue.defineComponent({
2691
2709
  "default": function _default() {
2692
2710
  return [vue.createVNode(Input.Actions, null, {
2693
2711
  "default": function _default() {
2694
- return [_this17.renderInputAddonBefore(), _this17.renderLeftIcons()];
2712
+ return [_this18.renderInputAddonBefore(), _this18.renderLeftIcons()];
2695
2713
  }
2696
2714
  }), vue.createVNode(DropDown.InputWrapper, null, {
2697
2715
  "default": function _default() {
2698
2716
  return [vue.createVNode(Input.TextArea, vue.mergeProps(_transformOn({
2699
2717
  blur: function blur(e) {
2700
- _this17.$emit('blur', e, _this17.triggerQuery);
2718
+ _this18.$emit('blur', e, _this18.triggerQuery);
2701
2719
  },
2702
2720
  keypress: function keypress(e) {
2703
- _this17.$emit('keyPress', e, _this17.triggerQuery);
2704
- _this17.$emit('key-press', e, _this17.triggerQuery);
2721
+ _this18.$emit('keyPress', e, _this18.triggerQuery);
2722
+ _this18.$emit('key-press', e, _this18.triggerQuery);
2705
2723
  },
2706
- input: _this17.onInputChange,
2724
+ input: _this18.onInputChange,
2707
2725
  focus: function focus(e) {
2708
- _this17.$emit('focus', e, _this17.triggerQuery);
2726
+ _this18.$emit('focus', e, _this18.triggerQuery);
2709
2727
  },
2710
- keydown: _this17.handleKeyDown,
2728
+ keydown: _this18.handleKeyDown,
2711
2729
  keyup: function keyup(e) {
2712
- _this17.$emit('keyUp', e, _this17.triggerQuery);
2713
- _this17.$emit('key-up', e, _this17.triggerQuery);
2730
+ _this18.$emit('keyUp', e, _this18.triggerQuery);
2731
+ _this18.$emit('key-up', e, _this18.triggerQuery);
2714
2732
  }
2715
2733
  }), {
2716
2734
  "searchBox": true,
2717
- "class": getClassName$1(_this17.$props.innerClass, 'input') || '',
2718
- "placeholder": _this17.$props.placeholder,
2719
- "autofocus": _this17.$props.autoFocus,
2720
- "value": _this17.$data.currentValue ? _this17.$data.currentValue : '',
2721
- "iconPosition": _this17.$props.iconPosition,
2722
- "showIcon": _this17.$props.showIcon,
2723
- "showClear": _this17.$props.showClear,
2724
- "ref": _this17.$props.innerRef,
2725
- "themePreset": _this17.themePreset
2735
+ "class": getClassName$1(_this18.$props.innerClass, 'input') || '',
2736
+ "placeholder": _this18.$props.placeholder,
2737
+ "autofocus": _this18.$props.autoFocus,
2738
+ "value": _this18.$data.currentValue ? _this18.$data.currentValue : '',
2739
+ "iconPosition": _this18.$props.iconPosition,
2740
+ "showIcon": _this18.$props.showIcon,
2741
+ "showClear": _this18.$props.showClear,
2742
+ "ref": _this18.$props.innerRef,
2743
+ "themePreset": _this18.themePreset
2726
2744
  }), null)];
2727
2745
  }
2728
2746
  }), vue.createVNode(Input.Actions, null, {
2729
2747
  "default": function _default() {
2730
- return [_this17.renderRightIcons(), _this17.renderInputAddonAfter(), _this17.renderEnterButtonElement()];
2748
+ return [_this18.renderRightIcons(), _this18.renderInputAddonAfter(), _this18.renderEnterButtonElement()];
2731
2749
  }
2732
2750
  })];
2733
2751
  }