@appbaseio/reactivesearch-vue 3.0.3 → 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.
- package/dist/@appbaseio/reactivesearch-vue.umd.js +177 -159
- package/dist/@appbaseio/reactivesearch-vue.umd.js.map +1 -1
- package/dist/@appbaseio/reactivesearch-vue.umd.min.js +3 -3
- package/dist/@appbaseio/reactivesearch-vue.umd.min.js.map +1 -1
- package/dist/cjs/{DropDown-26666911.js → DropDown-1532353d.js} +1 -1
- package/dist/cjs/{Input-3ecdb905.js → Input-4279b088.js} +2 -2
- package/dist/cjs/MultiDropdownList.js +2 -2
- package/dist/cjs/MultiList.js +1 -1
- package/dist/cjs/RangeInput.js +1 -1
- package/dist/cjs/SingleDropdownList.js +2 -2
- package/dist/cjs/SingleList.js +1 -1
- package/dist/cjs/index.js +3 -3
- package/dist/cjs/{install-aa24bd30.js → install-3b1b24b2.js} +176 -158
- package/dist/cjs/install.js +3 -3
- package/dist/cjs/version.js +1 -1
- package/dist/es/{DropDown-48045fde.js → DropDown-6d1dddde.js} +1 -1
- package/dist/es/{Input-83dee8c5.js → Input-1f6207bc.js} +2 -2
- package/dist/es/MultiDropdownList.js +2 -2
- package/dist/es/MultiList.js +1 -1
- package/dist/es/RangeInput.js +1 -1
- package/dist/es/SingleDropdownList.js +2 -2
- package/dist/es/SingleList.js +1 -1
- package/dist/es/index.js +4 -4
- package/dist/es/{install-37ef0fb5.js → install-49240941.js} +176 -158
- package/dist/es/install.js +3 -3
- package/dist/es/version.js +1 -1
- package/package.json +1 -1
|
@@ -23,8 +23,8 @@ import ReactiveBase from './ReactiveBase.js';
|
|
|
23
23
|
import hotkeys from 'hotkeys-js';
|
|
24
24
|
import xss from 'xss';
|
|
25
25
|
import { Remarkable } from 'remarkable';
|
|
26
|
-
import { I as IconWrapper, C as CancelSvg, a as IconGroup, B as ButtonIconWrapper, D as Downshift, b as InputWrapper } from './DropDown-
|
|
27
|
-
import { n as noSuggestions, T as TextArea, I as Input, s as suggestionsContainer, A as Actions$1, a as suggestions, b as searchboxSuggestions } from './Input-
|
|
26
|
+
import { I as IconWrapper, C as CancelSvg, a as IconGroup, B as ButtonIconWrapper, D as Downshift, b as InputWrapper } from './DropDown-6d1dddde.js';
|
|
27
|
+
import { n as noSuggestions, T as TextArea, I as Input, s as suggestionsContainer, A as Actions$1, a as suggestions, b as searchboxSuggestions } from './Input-1f6207bc.js';
|
|
28
28
|
import { C as Container } from './Container-d00219f7.js';
|
|
29
29
|
import Highlight from 'vue-highlight-words';
|
|
30
30
|
import { fetchAIResponse, createAISession } from '@appbaseio/reactivecore/lib/actions/query';
|
|
@@ -61,7 +61,7 @@ InputGroup.defaultProps = {
|
|
|
61
61
|
};
|
|
62
62
|
|
|
63
63
|
var _templateObject$1;
|
|
64
|
-
var InputAddon = styled('span')(_templateObject$1 || (_templateObject$1 = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: #fafafa;\n border: 1px solid
|
|
64
|
+
var InputAddon = styled('span')(_templateObject$1 || (_templateObject$1 = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: #fafafa;\n border: 1px solid transparent;\n border-radius: 6px;\n color: rgba(0, 0, 0, 0.85);\n font-size: 14px;\n font-weight: 400;\n padding: 0 11px;\n position: relative;\n transition: all 0.3s;\n box-sizing: border-box;\n overflow: hidden;\n\n &:first-of-type {\n border-right: none;\n }\n &:last-of-type {\n border-left: none;\n }\n"])));
|
|
65
65
|
InputAddon.defaultProps = {
|
|
66
66
|
className: 'input-addon'
|
|
67
67
|
};
|
|
@@ -866,16 +866,10 @@ var Message = styled('div')(_templateObject7 || (_templateObject7 = _taggedTempl
|
|
|
866
866
|
return resetCSS(props);
|
|
867
867
|
});
|
|
868
868
|
var MessageInputContainer = styled('form')(_templateObject8 || (_templateObject8 = _taggedTemplateLiteralLoose(["\n\tdisplay: flex;\n\tpadding-top: 12px;\n\talign-items: stretch;\n\tmargin-top: 10px;\n\t.ai-enter-button-wrapper {\n\t\talign-self: baseline;\n\t\theight: 41px;\n\t}\n"])));
|
|
869
|
-
var MessageInput = styled(TextArea)(_templateObject9 || (_templateObject9 = _taggedTemplateLiteralLoose(["\n\twidth: 100%;\n\tborder-radius: 5px;\n\tborder: 1px solid #ccc;\n\tbackground-color: ", ";\n\tcolor: ", ";\n\n\t
|
|
869
|
+
var MessageInput = styled(TextArea)(_templateObject9 || (_templateObject9 = _taggedTemplateLiteralLoose(["\n\twidth: 100%;\n\tborder-radius: 5px;\n\tborder: 1px solid #ccc;\n\tbackground-color: ", ";\n\tcolor: ", ";\n\n\t", "\n\tpadding-left: 35px;\n"])), function (props) {
|
|
870
870
|
return props.themePreset === 'dark' ? props.theme.colors.borderColor : '#fff';
|
|
871
871
|
}, function (props) {
|
|
872
872
|
return props.themePreset === 'dark' ? props.theme.colors.titleColor : props.theme.colors.textColor;
|
|
873
|
-
}, function (props) {
|
|
874
|
-
return props.theme.colors.textColor;
|
|
875
|
-
}, function (props) {
|
|
876
|
-
return props.theme.colors.textColor;
|
|
877
|
-
}, function (props) {
|
|
878
|
-
return props.theme.colors.textColor;
|
|
879
873
|
}, function (_ref) {
|
|
880
874
|
var enterButton = _ref.enterButton;
|
|
881
875
|
return enterButton && "\n\t\t border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n\t";
|
|
@@ -1307,7 +1301,23 @@ var SearchBox = defineComponent({
|
|
|
1307
1301
|
AIUIConfig: types.AIUIConfig
|
|
1308
1302
|
},
|
|
1309
1303
|
mounted: function mounted() {
|
|
1304
|
+
var _this = this;
|
|
1310
1305
|
this.listenForFocusShortcuts();
|
|
1306
|
+
var dropdownEle = this.$refs[_dropdownULRef];
|
|
1307
|
+
if (dropdownEle) {
|
|
1308
|
+
var handleScroll = function handleScroll() {
|
|
1309
|
+
var scrollTop = dropdownEle.scrollTop;
|
|
1310
|
+
_this.lastScrollTop = scrollTop;
|
|
1311
|
+
if (scrollTop < _this.lastScrollTop) {
|
|
1312
|
+
// User is scrolling up
|
|
1313
|
+
clearInterval(_this.scrollTimerRef);
|
|
1314
|
+
_this.isUserScrolling = true;
|
|
1315
|
+
}
|
|
1316
|
+
// Update lastScrollTop with the current scroll position
|
|
1317
|
+
_this.lastScrollTop = scrollTop;
|
|
1318
|
+
};
|
|
1319
|
+
dropdownEle.addEventListener('scroll', handleScroll);
|
|
1320
|
+
}
|
|
1311
1321
|
},
|
|
1312
1322
|
updated: function updated() {
|
|
1313
1323
|
if (this.$props.mode === SEARCH_COMPONENTS_MODES.SELECT && this.$options.isTagsMode === true) {
|
|
@@ -1326,6 +1336,9 @@ var SearchBox = defineComponent({
|
|
|
1326
1336
|
if (localCache && localCache.meta && localCache.meta.hits && localCache.meta.hits.hits) {
|
|
1327
1337
|
this.initialHits = localCache.meta.hits.hits;
|
|
1328
1338
|
}
|
|
1339
|
+
if (!this.showAIScreenFooter) {
|
|
1340
|
+
this.showAIScreenFooter = true;
|
|
1341
|
+
}
|
|
1329
1342
|
}
|
|
1330
1343
|
}
|
|
1331
1344
|
},
|
|
@@ -1440,9 +1453,10 @@ var SearchBox = defineComponent({
|
|
|
1440
1453
|
}
|
|
1441
1454
|
},
|
|
1442
1455
|
isAITyping: function isAITyping(newVal, oldVal) {
|
|
1443
|
-
var
|
|
1456
|
+
var _this2 = this;
|
|
1444
1457
|
var scrollAIContainer = function scrollAIContainer() {
|
|
1445
|
-
|
|
1458
|
+
if (_this2.isUserScrolling) return;
|
|
1459
|
+
var dropdownEle = _this2.$refs[_dropdownULRef];
|
|
1446
1460
|
if (dropdownEle) {
|
|
1447
1461
|
dropdownEle.scrollTo({
|
|
1448
1462
|
top: dropdownEle.scrollHeight,
|
|
@@ -1451,6 +1465,7 @@ var SearchBox = defineComponent({
|
|
|
1451
1465
|
}
|
|
1452
1466
|
};
|
|
1453
1467
|
if (!newVal && oldVal) {
|
|
1468
|
+
clearInterval(this.scrollTimerRef);
|
|
1454
1469
|
this.showAIScreenFooter = true;
|
|
1455
1470
|
if (this.$props.AIUIConfig && typeof this.$props.AIUIConfig.showFeedback === 'boolean' ? this.$props.AIUIConfig.showFeedback : true) {
|
|
1456
1471
|
this.showFeedbackComponent = true;
|
|
@@ -1459,7 +1474,7 @@ var SearchBox = defineComponent({
|
|
|
1459
1474
|
scrollAIContainer();
|
|
1460
1475
|
}, 500);
|
|
1461
1476
|
} else if (newVal) {
|
|
1462
|
-
this.scrollTimerRef =
|
|
1477
|
+
this.scrollTimerRef = setInterval(function () {
|
|
1463
1478
|
scrollAIContainer();
|
|
1464
1479
|
}, 2000);
|
|
1465
1480
|
}
|
|
@@ -1476,7 +1491,7 @@ var SearchBox = defineComponent({
|
|
|
1476
1491
|
}
|
|
1477
1492
|
},
|
|
1478
1493
|
currentValue: function currentValue() {
|
|
1479
|
-
this.handleTextAreaHeightChange
|
|
1494
|
+
this.$nextTick(this.handleTextAreaHeightChange);
|
|
1480
1495
|
}
|
|
1481
1496
|
},
|
|
1482
1497
|
methods: {
|
|
@@ -1551,7 +1566,7 @@ var SearchBox = defineComponent({
|
|
|
1551
1566
|
}
|
|
1552
1567
|
},
|
|
1553
1568
|
setValue: function setValue(value, isDefaultValue, props, cause, toggleIsOpen, categoryValue, shouldExecuteQuery) {
|
|
1554
|
-
var
|
|
1569
|
+
var _this3 = this;
|
|
1555
1570
|
if (isDefaultValue === void 0) {
|
|
1556
1571
|
isDefaultValue = false;
|
|
1557
1572
|
}
|
|
@@ -1568,65 +1583,65 @@ var SearchBox = defineComponent({
|
|
|
1568
1583
|
shouldExecuteQuery = true;
|
|
1569
1584
|
}
|
|
1570
1585
|
var performUpdate = function performUpdate() {
|
|
1571
|
-
if (
|
|
1586
|
+
if (_this3.$options.isTagsMode && isEqual(value, _this3.selectedTags)) {
|
|
1572
1587
|
return;
|
|
1573
1588
|
}
|
|
1574
|
-
if (
|
|
1575
|
-
if (Array.isArray(
|
|
1589
|
+
if (_this3.$options.isTagsMode && cause === causes.SUGGESTION_SELECT) {
|
|
1590
|
+
if (Array.isArray(_this3.selectedTags) && _this3.selectedTags.length) {
|
|
1576
1591
|
// check if value already present in selectedTags
|
|
1577
|
-
if (typeof value === 'string' &&
|
|
1578
|
-
|
|
1592
|
+
if (typeof value === 'string' && _this3.selectedTags.includes(value)) {
|
|
1593
|
+
_this3.isOpen = false;
|
|
1579
1594
|
return;
|
|
1580
1595
|
}
|
|
1581
|
-
|
|
1596
|
+
_this3.selectedTags = [].concat(_this3.selectedTags);
|
|
1582
1597
|
if (typeof value === 'string' && !!value) {
|
|
1583
|
-
|
|
1584
|
-
} else if (Array.isArray(value) && !isEqual(
|
|
1585
|
-
|
|
1598
|
+
_this3.selectedTags.push(value);
|
|
1599
|
+
} else if (Array.isArray(value) && !isEqual(_this3.selectedTags, value)) {
|
|
1600
|
+
_this3.selectedTags = value;
|
|
1586
1601
|
}
|
|
1587
1602
|
} else if (value) {
|
|
1588
|
-
|
|
1603
|
+
_this3.selectedTags = typeof value !== 'string' ? value : [].concat(value);
|
|
1589
1604
|
}
|
|
1590
|
-
|
|
1605
|
+
_this3.currentValue = '';
|
|
1591
1606
|
} else {
|
|
1592
|
-
|
|
1607
|
+
_this3.currentValue = decodeHtml(value);
|
|
1593
1608
|
}
|
|
1594
1609
|
var queryHandlerValue = value;
|
|
1595
|
-
if (
|
|
1596
|
-
queryHandlerValue = Array.isArray(
|
|
1610
|
+
if (_this3.$options.isTagsMode && cause === causes.SUGGESTION_SELECT) {
|
|
1611
|
+
queryHandlerValue = Array.isArray(_this3.selectedTags) && _this3.selectedTags.length ? _this3.selectedTags : undefined;
|
|
1597
1612
|
}
|
|
1598
|
-
if ((
|
|
1613
|
+
if ((_this3.faqAnswer || _this3.faqQuestion) && value === '') {
|
|
1599
1614
|
// Empty the previous state
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1615
|
+
_this3.faqAnswer = '';
|
|
1616
|
+
_this3.faqQuestion = '';
|
|
1617
|
+
_this3.showAIScreen = false;
|
|
1603
1618
|
}
|
|
1604
1619
|
if (isDefaultValue) {
|
|
1605
|
-
if (
|
|
1620
|
+
if (_this3.$props.autosuggest) {
|
|
1606
1621
|
if (toggleIsOpen) {
|
|
1607
|
-
|
|
1622
|
+
_this3.isOpen = false;
|
|
1608
1623
|
}
|
|
1609
|
-
if (typeof
|
|
1624
|
+
if (typeof _this3.currentValue === 'string') _this3.triggerDefaultQuery(_this3.currentValue, props.enableAI && _this3.currentTriggerMode === AI_TRIGGER_MODES.QUESTION && _this3.currentValue.endsWith('?') ? {
|
|
1610
1625
|
enableAI: true
|
|
1611
1626
|
} : {}, shouldExecuteQuery);
|
|
1612
1627
|
} // in case of strict selection only SUGGESTION_SELECT should be able
|
|
1613
1628
|
// to set the query otherwise the value should reset
|
|
1614
1629
|
if (props.strictSelection) {
|
|
1615
|
-
if (cause === causes.SUGGESTION_SELECT || (
|
|
1616
|
-
|
|
1630
|
+
if (cause === causes.SUGGESTION_SELECT || (_this3.$options.isTagsMode ? _this3.selectedTags.length === 0 : value === '')) {
|
|
1631
|
+
_this3.triggerCustomQuery(queryHandlerValue, _this3.$options.isTagsMode ? undefined : categoryValue, shouldExecuteQuery);
|
|
1617
1632
|
} else {
|
|
1618
|
-
|
|
1633
|
+
_this3.setValue('', true);
|
|
1619
1634
|
}
|
|
1620
1635
|
} else if (props.value === undefined || cause === causes.SUGGESTION_SELECT || cause === causes.CLEAR_VALUE) {
|
|
1621
|
-
|
|
1622
|
-
|
|
1636
|
+
_this3.showAIScreen = false;
|
|
1637
|
+
_this3.triggerCustomQuery(queryHandlerValue, _this3.$options.isTagsMode ? undefined : categoryValue, shouldExecuteQuery);
|
|
1623
1638
|
}
|
|
1624
1639
|
} else {
|
|
1625
1640
|
// debounce for handling text while typing
|
|
1626
|
-
|
|
1641
|
+
_this3.handleTextChange(value, cause);
|
|
1627
1642
|
}
|
|
1628
|
-
|
|
1629
|
-
|
|
1643
|
+
_this3.$emit('valueChange', value);
|
|
1644
|
+
_this3.$emit('value-change', value);
|
|
1630
1645
|
};
|
|
1631
1646
|
checkValueChange(props.componentId, value, props.beforeValueChange, performUpdate);
|
|
1632
1647
|
},
|
|
@@ -1775,7 +1790,7 @@ var SearchBox = defineComponent({
|
|
|
1775
1790
|
this.$emit('key-down', event, this.triggerQuery);
|
|
1776
1791
|
},
|
|
1777
1792
|
onInputChange: function onInputChange(e) {
|
|
1778
|
-
var
|
|
1793
|
+
var _this4 = this;
|
|
1779
1794
|
var inputValue = e.target.value;
|
|
1780
1795
|
if (!this.$data.isOpen && this.$props.autosuggest) {
|
|
1781
1796
|
this.isOpen = true;
|
|
@@ -1789,7 +1804,7 @@ var SearchBox = defineComponent({
|
|
|
1789
1804
|
} else {
|
|
1790
1805
|
this.$emit('change', inputValue, function (_ref3) {
|
|
1791
1806
|
var isOpen = _ref3.isOpen;
|
|
1792
|
-
return
|
|
1807
|
+
return _this4.triggerQuery({
|
|
1793
1808
|
defaultQuery: true,
|
|
1794
1809
|
customQuery: true,
|
|
1795
1810
|
value: inputValue,
|
|
@@ -1833,7 +1848,7 @@ var SearchBox = defineComponent({
|
|
|
1833
1848
|
}
|
|
1834
1849
|
},
|
|
1835
1850
|
onSuggestionSelected: function onSuggestionSelected(suggestion) {
|
|
1836
|
-
var
|
|
1851
|
+
var _this5 = this;
|
|
1837
1852
|
var value = this.$props.value;
|
|
1838
1853
|
// The state of the suggestion is open by the time it reaches here. i.e. isOpen = true
|
|
1839
1854
|
// handle when FAQ suggestion is clicked
|
|
@@ -1882,10 +1897,10 @@ var SearchBox = defineComponent({
|
|
|
1882
1897
|
this.setValue(emitValue, true, this.$props, causes.SUGGESTION_SELECT, false, suggestion._category);
|
|
1883
1898
|
this.$emit('change', emitValue, function (_ref4) {
|
|
1884
1899
|
var isOpen = _ref4.isOpen;
|
|
1885
|
-
return
|
|
1900
|
+
return _this5.triggerQuery(_extends({
|
|
1886
1901
|
isOpen: isOpen,
|
|
1887
1902
|
value: emitValue
|
|
1888
|
-
}, !
|
|
1903
|
+
}, !_this5.$options.isTagsMode && {
|
|
1889
1904
|
categoryValue: suggestion._category
|
|
1890
1905
|
}));
|
|
1891
1906
|
});
|
|
@@ -1925,7 +1940,7 @@ var SearchBox = defineComponent({
|
|
|
1925
1940
|
return null;
|
|
1926
1941
|
},
|
|
1927
1942
|
renderErrorComponent: function renderErrorComponent(isAIError) {
|
|
1928
|
-
var
|
|
1943
|
+
var _this6 = this;
|
|
1929
1944
|
if (isAIError === void 0) {
|
|
1930
1945
|
isAIError = false;
|
|
1931
1946
|
}
|
|
@@ -1952,7 +1967,7 @@ var SearchBox = defineComponent({
|
|
|
1952
1967
|
"themePreset": this.themePreset
|
|
1953
1968
|
}, {
|
|
1954
1969
|
"default": function _default() {
|
|
1955
|
-
return [isFunction(renderError) ? renderError(
|
|
1970
|
+
return [isFunction(renderError) ? renderError(_this6.error) : renderError];
|
|
1956
1971
|
}
|
|
1957
1972
|
});
|
|
1958
1973
|
}
|
|
@@ -2032,7 +2047,7 @@ var SearchBox = defineComponent({
|
|
|
2032
2047
|
});
|
|
2033
2048
|
},
|
|
2034
2049
|
renderEnterButtonElement: function renderEnterButtonElement() {
|
|
2035
|
-
var
|
|
2050
|
+
var _this7 = this;
|
|
2036
2051
|
var _this$$props2 = this.$props,
|
|
2037
2052
|
enterButton = _this$$props2.enterButton,
|
|
2038
2053
|
innerClass = _this$$props2.innerClass;
|
|
@@ -2040,12 +2055,12 @@ var SearchBox = defineComponent({
|
|
|
2040
2055
|
if (enterButton) {
|
|
2041
2056
|
var getEnterButtonMarkup = function getEnterButtonMarkup() {
|
|
2042
2057
|
if (renderEnterButton) {
|
|
2043
|
-
return renderEnterButton(
|
|
2058
|
+
return renderEnterButton(_this7.enterButtonOnClick);
|
|
2044
2059
|
}
|
|
2045
2060
|
return createVNode(Button, {
|
|
2046
2061
|
"class": "enter-btn " + getClassName$1(innerClass, 'enter-button'),
|
|
2047
2062
|
"primary": true,
|
|
2048
|
-
"onClick":
|
|
2063
|
+
"onClick": _this7.enterButtonOnClick
|
|
2049
2064
|
}, {
|
|
2050
2065
|
"default": function _default() {
|
|
2051
2066
|
return [createTextVNode("Search")];
|
|
@@ -2071,7 +2086,7 @@ var SearchBox = defineComponent({
|
|
|
2071
2086
|
return '/';
|
|
2072
2087
|
},
|
|
2073
2088
|
renderLeftIcons: function renderLeftIcons() {
|
|
2074
|
-
var
|
|
2089
|
+
var _this8 = this;
|
|
2075
2090
|
var _slot3;
|
|
2076
2091
|
var _this$$props3 = this.$props,
|
|
2077
2092
|
iconPosition = _this$$props3.iconPosition,
|
|
@@ -2081,8 +2096,8 @@ var SearchBox = defineComponent({
|
|
|
2081
2096
|
}, {
|
|
2082
2097
|
"default": function _default() {
|
|
2083
2098
|
return [iconPosition === 'left' && showIcon && createVNode(IconWrapper, {
|
|
2084
|
-
"onClick":
|
|
2085
|
-
}, _isSlot(_slot3 =
|
|
2099
|
+
"onClick": _this8.handleSearchIconClick
|
|
2100
|
+
}, _isSlot(_slot3 = _this8.renderIcon()) ? _slot3 : {
|
|
2086
2101
|
"default": function _default() {
|
|
2087
2102
|
return [_slot3];
|
|
2088
2103
|
}
|
|
@@ -2091,7 +2106,7 @@ var SearchBox = defineComponent({
|
|
|
2091
2106
|
})]);
|
|
2092
2107
|
},
|
|
2093
2108
|
renderRightIcons: function renderRightIcons() {
|
|
2094
|
-
var
|
|
2109
|
+
var _this9 = this;
|
|
2095
2110
|
var _slot4, _slot5, _slot6;
|
|
2096
2111
|
var _this$$props4 = this.$props,
|
|
2097
2112
|
iconPosition = _this$$props4.iconPosition,
|
|
@@ -2108,29 +2123,29 @@ var SearchBox = defineComponent({
|
|
|
2108
2123
|
}, {
|
|
2109
2124
|
"default": function _default() {
|
|
2110
2125
|
return [currentValue && showClear && createVNode(IconWrapper, {
|
|
2111
|
-
"onClick":
|
|
2126
|
+
"onClick": _this9.clearValue,
|
|
2112
2127
|
"showIcon": showIcon,
|
|
2113
2128
|
"isClearIcon": true
|
|
2114
|
-
}, _isSlot(_slot4 =
|
|
2129
|
+
}, _isSlot(_slot4 = _this9.renderCancelIcon()) ? _slot4 : {
|
|
2115
2130
|
"default": function _default() {
|
|
2116
2131
|
return [_slot4];
|
|
2117
2132
|
}
|
|
2118
2133
|
}), showFocusShortcutsIcon && createVNode(ButtonIconWrapper, {
|
|
2119
2134
|
"onClick": function onClick(e) {
|
|
2120
|
-
return
|
|
2135
|
+
return _this9.focusSearchBox(e);
|
|
2121
2136
|
}
|
|
2122
|
-
}, _isSlot(_slot5 =
|
|
2137
|
+
}, _isSlot(_slot5 = _this9.renderShortcut()) ? _slot5 : {
|
|
2123
2138
|
"default": function _default() {
|
|
2124
2139
|
return [_slot5];
|
|
2125
2140
|
}
|
|
2126
2141
|
}), showVoiceSearch && createVNode(Mic, {
|
|
2127
2142
|
"getInstance": getMicInstance,
|
|
2128
2143
|
"render": renderMic,
|
|
2129
|
-
"handleResult":
|
|
2144
|
+
"handleResult": _this9.handleVoiceResults,
|
|
2130
2145
|
"className": getClassName$1(innerClass, 'mic') || null
|
|
2131
2146
|
}, null), iconPosition === 'right' && showIcon && createVNode(IconWrapper, {
|
|
2132
|
-
"onClick":
|
|
2133
|
-
}, _isSlot(_slot6 =
|
|
2147
|
+
"onClick": _this9.handleSearchIconClick
|
|
2148
|
+
}, _isSlot(_slot6 = _this9.renderIcon()) ? _slot6 : {
|
|
2134
2149
|
"default": function _default() {
|
|
2135
2150
|
return [_slot6];
|
|
2136
2151
|
}
|
|
@@ -2149,7 +2164,7 @@ var SearchBox = defineComponent({
|
|
|
2149
2164
|
(_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
|
|
2150
2165
|
},
|
|
2151
2166
|
listenForFocusShortcuts: function listenForFocusShortcuts() {
|
|
2152
|
-
var
|
|
2167
|
+
var _this10 = this;
|
|
2153
2168
|
var _this$$props$focusSho = this.$props.focusShortcuts,
|
|
2154
2169
|
focusShortcuts = _this$$props$focusSho === void 0 ? ['/'] : _this$$props$focusSho;
|
|
2155
2170
|
if (isEmpty(focusShortcuts)) {
|
|
@@ -2164,7 +2179,7 @@ var SearchBox = defineComponent({
|
|
|
2164
2179
|
function (event, handler) {
|
|
2165
2180
|
// Prevent the default refresh event under WINDOWS system
|
|
2166
2181
|
event.preventDefault();
|
|
2167
|
-
|
|
2182
|
+
_this10.focusSearchBox(event);
|
|
2168
2183
|
});
|
|
2169
2184
|
|
|
2170
2185
|
// if one of modifier keys are used, they are handled below
|
|
@@ -2174,7 +2189,7 @@ var SearchBox = defineComponent({
|
|
|
2174
2189
|
for (var index = 0; index < modifierKeys.length; index += 1) {
|
|
2175
2190
|
var element = modifierKeys[index];
|
|
2176
2191
|
if (hotkeys[element]) {
|
|
2177
|
-
|
|
2192
|
+
_this10.focusSearchBox(event);
|
|
2178
2193
|
break;
|
|
2179
2194
|
}
|
|
2180
2195
|
}
|
|
@@ -2187,10 +2202,10 @@ var SearchBox = defineComponent({
|
|
|
2187
2202
|
this.triggerDefaultQuery(value);
|
|
2188
2203
|
},
|
|
2189
2204
|
renderActionIcon: function renderActionIcon(suggestion) {
|
|
2190
|
-
var
|
|
2205
|
+
var _this11 = this;
|
|
2191
2206
|
var handleAutoFillClick = function handleAutoFillClick(e) {
|
|
2192
2207
|
e.stopPropagation();
|
|
2193
|
-
|
|
2208
|
+
_this11.onAutofillClick(suggestion);
|
|
2194
2209
|
};
|
|
2195
2210
|
if (suggestion._suggestion_type === suggestionTypes.Featured) {
|
|
2196
2211
|
if (suggestion.action === featuredSuggestionsActionTypes.FUNCTION) {
|
|
@@ -2213,7 +2228,7 @@ var SearchBox = defineComponent({
|
|
|
2213
2228
|
return null;
|
|
2214
2229
|
},
|
|
2215
2230
|
renderTag: function renderTag(item) {
|
|
2216
|
-
var
|
|
2231
|
+
var _this12 = this;
|
|
2217
2232
|
var innerClass = this.$props.innerClass;
|
|
2218
2233
|
return createVNode(TagItem, {
|
|
2219
2234
|
"class": getClassName$1(innerClass, 'selected-tag') || ''
|
|
@@ -2224,7 +2239,7 @@ var SearchBox = defineComponent({
|
|
|
2224
2239
|
"aria-label": "delete-tag",
|
|
2225
2240
|
"class": "close-icon",
|
|
2226
2241
|
"onClick": function onClick() {
|
|
2227
|
-
return
|
|
2242
|
+
return _this12.clearTag(item);
|
|
2228
2243
|
}
|
|
2229
2244
|
}, [createVNode(CancelSvg, null, null)])];
|
|
2230
2245
|
}
|
|
@@ -2247,7 +2262,7 @@ var SearchBox = defineComponent({
|
|
|
2247
2262
|
}
|
|
2248
2263
|
},
|
|
2249
2264
|
renderTags: function renderTags() {
|
|
2250
|
-
var
|
|
2265
|
+
var _this13 = this;
|
|
2251
2266
|
if (!Array.isArray(this.selectedTags)) {
|
|
2252
2267
|
return null;
|
|
2253
2268
|
}
|
|
@@ -2261,16 +2276,16 @@ var SearchBox = defineComponent({
|
|
|
2261
2276
|
}) : createVNode(TagsContainer, null, {
|
|
2262
2277
|
"default": function _default() {
|
|
2263
2278
|
return [tagsList.map(function (item) {
|
|
2264
|
-
return
|
|
2279
|
+
return _this13.renderTag(item);
|
|
2265
2280
|
}), shouldRenderClearAllTag && createVNode(TagItem, {
|
|
2266
|
-
"class": getClassName$1(
|
|
2281
|
+
"class": getClassName$1(_this13.$props.innerClass, 'selected-tag') || ''
|
|
2267
2282
|
}, {
|
|
2268
2283
|
"default": function _default() {
|
|
2269
2284
|
return [createVNode("span", null, [createTextVNode("Clear All")]), createVNode("span", {
|
|
2270
2285
|
"role": "img",
|
|
2271
2286
|
"aria-label": "delete-tag",
|
|
2272
2287
|
"class": "close-icon",
|
|
2273
|
-
"onClick":
|
|
2288
|
+
"onClick": _this13.clearAllTags
|
|
2274
2289
|
}, [createVNode(CancelSvg, null, null)])];
|
|
2275
2290
|
}
|
|
2276
2291
|
})];
|
|
@@ -2278,13 +2293,13 @@ var SearchBox = defineComponent({
|
|
|
2278
2293
|
});
|
|
2279
2294
|
},
|
|
2280
2295
|
getAISourceObjects: function getAISourceObjects() {
|
|
2281
|
-
var
|
|
2296
|
+
var _this14 = this;
|
|
2282
2297
|
var sourceObjects = [];
|
|
2283
2298
|
if (!this.AIResponse) return sourceObjects;
|
|
2284
2299
|
var docIds = this.AIResponse && this.AIResponse.response && this.AIResponse.response.answer && this.AIResponse.response.answer.documentIds || [];
|
|
2285
2300
|
if (this.initialHits) {
|
|
2286
2301
|
docIds.forEach(function (id) {
|
|
2287
|
-
var foundSourceObj =
|
|
2302
|
+
var foundSourceObj = _this14.initialHits.find(function (hit) {
|
|
2288
2303
|
return hit._id === id;
|
|
2289
2304
|
}) || {};
|
|
2290
2305
|
if (foundSourceObj) {
|
|
@@ -2318,20 +2333,20 @@ var SearchBox = defineComponent({
|
|
|
2318
2333
|
},
|
|
2319
2334
|
renderAIScreenFooter: function renderAIScreenFooter() {
|
|
2320
2335
|
var _slot8;
|
|
2321
|
-
var
|
|
2336
|
+
var _this15 = this;
|
|
2322
2337
|
var _this$$props$AIUIConf2 = this.$props.AIUIConfig,
|
|
2323
2338
|
AIUIConfig = _this$$props$AIUIConf2 === void 0 ? {} : _this$$props$AIUIConf2;
|
|
2324
2339
|
var _ref6 = AIUIConfig || {},
|
|
2325
2340
|
_ref6$showSourceDocum = _ref6.showSourceDocuments,
|
|
2326
|
-
showSourceDocuments = _ref6$showSourceDocum === void 0 ?
|
|
2341
|
+
showSourceDocuments = _ref6$showSourceDocum === void 0 ? false : _ref6$showSourceDocum,
|
|
2327
2342
|
_ref6$onSourceClick = _ref6.onSourceClick,
|
|
2328
2343
|
onSourceClick = _ref6$onSourceClick === void 0 ? function () {} : _ref6$onSourceClick;
|
|
2329
2344
|
var renderSourceDocumentLabel = function renderSourceDocumentLabel(sourceObj) {
|
|
2330
|
-
if (
|
|
2331
|
-
return
|
|
2345
|
+
if (_this15.$props.AIUIConfig && _this15.$props.AIUIConfig.renderSourceDocument) {
|
|
2346
|
+
return _this15.$props.AIUIConfig.renderSourceDocument(sourceObj);
|
|
2332
2347
|
}
|
|
2333
|
-
if (
|
|
2334
|
-
return
|
|
2348
|
+
if (_this15.$slots.renderSourceDocument) {
|
|
2349
|
+
return _this15.$slots.renderSourceDocument(sourceObj);
|
|
2335
2350
|
}
|
|
2336
2351
|
return sourceObj._id;
|
|
2337
2352
|
};
|
|
@@ -2339,10 +2354,10 @@ var SearchBox = defineComponent({
|
|
|
2339
2354
|
"themePreset": this.$props.themePreset
|
|
2340
2355
|
}, {
|
|
2341
2356
|
"default": function _default() {
|
|
2342
|
-
return [createTextVNode("Summary generated using the following sources:"), ' ', createVNode(SourceTags, null, _isSlot(_slot8 =
|
|
2357
|
+
return [createTextVNode("Summary generated using the following sources:"), ' ', createVNode(SourceTags, null, _isSlot(_slot8 = _this15.getAISourceObjects().map(function (el) {
|
|
2343
2358
|
var _slot7;
|
|
2344
2359
|
return createVNode(Button, {
|
|
2345
|
-
"class": "--ai-source-tag " + (getClassName$1(
|
|
2360
|
+
"class": "--ai-source-tag " + (getClassName$1(_this15.$props.innerClass, 'ai-source-tag') || ''),
|
|
2346
2361
|
"info": true,
|
|
2347
2362
|
"onClick": function onClick() {
|
|
2348
2363
|
return onSourceClick && onSourceClick(el);
|
|
@@ -2361,7 +2376,7 @@ var SearchBox = defineComponent({
|
|
|
2361
2376
|
}) : null;
|
|
2362
2377
|
},
|
|
2363
2378
|
renderAIScreen: function renderAIScreen() {
|
|
2364
|
-
var
|
|
2379
|
+
var _this16 = this;
|
|
2365
2380
|
var customAIRenderer = this.$props.renderAIAnswer || this.$slots.renderAIAnswer;
|
|
2366
2381
|
if (customAIRenderer) {
|
|
2367
2382
|
return customAIRenderer({
|
|
@@ -2385,11 +2400,11 @@ var SearchBox = defineComponent({
|
|
|
2385
2400
|
"hideUI": this.isAIResponseLoading || this.isLoading || !this.sessionIdFromStore,
|
|
2386
2401
|
"key": this.sessionIdFromStore,
|
|
2387
2402
|
"onFeedbackSubmit": function onFeedbackSubmit(useful, reason) {
|
|
2388
|
-
|
|
2403
|
+
_this16.feedbackState = {
|
|
2389
2404
|
isRecorded: true,
|
|
2390
2405
|
feedbackType: useful ? 'positive' : 'negative'
|
|
2391
2406
|
};
|
|
2392
|
-
|
|
2407
|
+
_this16.recordAISessionUsefulness(_this16.sessionIdFromStore, {
|
|
2393
2408
|
useful: useful,
|
|
2394
2409
|
reason: reason
|
|
2395
2410
|
});
|
|
@@ -2424,7 +2439,7 @@ var SearchBox = defineComponent({
|
|
|
2424
2439
|
});
|
|
2425
2440
|
},
|
|
2426
2441
|
renderAskButtonElement: function renderAskButtonElement() {
|
|
2427
|
-
var
|
|
2442
|
+
var _this17 = this;
|
|
2428
2443
|
var _this$$props5 = this.$props,
|
|
2429
2444
|
AIUIConfig = _this$$props5.AIUIConfig,
|
|
2430
2445
|
innerClass = _this$$props5.innerClass;
|
|
@@ -2434,12 +2449,12 @@ var SearchBox = defineComponent({
|
|
|
2434
2449
|
if (askButton) {
|
|
2435
2450
|
var getEnterButtonMarkup = function getEnterButtonMarkup() {
|
|
2436
2451
|
if (renderAskButton) {
|
|
2437
|
-
return renderAskButton(
|
|
2452
|
+
return renderAskButton(_this17.askButtonOnClick);
|
|
2438
2453
|
}
|
|
2439
2454
|
return createVNode(Button, {
|
|
2440
2455
|
"class": "enter-btn " + getClassName$1(innerClass, 'ask-button'),
|
|
2441
2456
|
"info": true,
|
|
2442
|
-
"onClick":
|
|
2457
|
+
"onClick": _this17.askButtonOnClick
|
|
2443
2458
|
}, {
|
|
2444
2459
|
"default": function _default() {
|
|
2445
2460
|
return [createTextVNode("Ask")];
|
|
@@ -2454,28 +2469,28 @@ var SearchBox = defineComponent({
|
|
|
2454
2469
|
}
|
|
2455
2470
|
},
|
|
2456
2471
|
render: function render() {
|
|
2457
|
-
var
|
|
2472
|
+
var _this18 = this;
|
|
2458
2473
|
var expandSuggestionsContainer = this.$props.expandSuggestionsContainer;
|
|
2459
2474
|
var _this$$slots = this.$slots,
|
|
2460
2475
|
recentSearchesIcon = _this$$slots.recentSearchesIcon,
|
|
2461
2476
|
popularSearchesIcon = _this$$slots.popularSearchesIcon;
|
|
2462
|
-
var hasSuggestions = Array.isArray(this.
|
|
2477
|
+
var hasSuggestions = Array.isArray(this.parsedSuggestions) && this.parsedSuggestions.length;
|
|
2463
2478
|
var renderItem = this.$slots.renderItem || this.$props.renderItem;
|
|
2464
2479
|
return createVNode(Container, {
|
|
2465
2480
|
"class": this.$props.className
|
|
2466
2481
|
}, {
|
|
2467
2482
|
"default": function _default() {
|
|
2468
|
-
return [
|
|
2469
|
-
"class": getClassName$1(
|
|
2483
|
+
return [_this18.$props.title && createVNode(Title, {
|
|
2484
|
+
"class": getClassName$1(_this18.$props.innerClass, 'title') || ''
|
|
2470
2485
|
}, {
|
|
2471
2486
|
"default": function _default() {
|
|
2472
|
-
return [
|
|
2487
|
+
return [_this18.$props.title];
|
|
2473
2488
|
}
|
|
2474
|
-
}),
|
|
2475
|
-
"id":
|
|
2476
|
-
"handleChange":
|
|
2477
|
-
"handleMouseup":
|
|
2478
|
-
"isOpen":
|
|
2489
|
+
}), _this18.$props.autosuggest ? createVNode(Downshift, {
|
|
2490
|
+
"id": _this18.$props.componentId + "-downshift",
|
|
2491
|
+
"handleChange": _this18.onSuggestionSelected,
|
|
2492
|
+
"handleMouseup": _this18.handleStateChange,
|
|
2493
|
+
"isOpen": _this18.$data.isOpen
|
|
2479
2494
|
}, {
|
|
2480
2495
|
"default": function _default(_ref8) {
|
|
2481
2496
|
var getInputEvents = _ref8.getInputEvents,
|
|
@@ -2531,21 +2546,21 @@ var SearchBox = defineComponent({
|
|
|
2531
2546
|
}
|
|
2532
2547
|
};
|
|
2533
2548
|
var indexOffset = 0;
|
|
2534
|
-
return createVNode("div", null, [
|
|
2549
|
+
return createVNode("div", null, [_this18.hasCustomRenderer && _this18.getComponent({
|
|
2535
2550
|
isOpen: isOpen,
|
|
2536
2551
|
getItemProps: getItemProps,
|
|
2537
2552
|
getItemEvents: getItemEvents,
|
|
2538
2553
|
highlightedIndex: highlightedIndex
|
|
2539
|
-
}),
|
|
2540
|
-
"class": suggestions(
|
|
2554
|
+
}), _this18.renderErrorComponent(), !_this18.hasCustomRenderer && isOpen && hasSuggestions ? createVNode("ul", {
|
|
2555
|
+
"class": suggestions(_this18.themePreset, _this18.theme) + " " + getClassName$1(_this18.$props.innerClass, 'list') + " " + searchboxSuggestions(_this18.themePreset, _this18.theme) + "\n\t\t\t\t\t\t\t\t\t\t\t\t\t",
|
|
2541
2556
|
"ref": _dropdownULRef
|
|
2542
|
-
}, [
|
|
2543
|
-
"themePreset":
|
|
2557
|
+
}, [_this18.showAIScreen && createVNode(SearchBoxAISection, {
|
|
2558
|
+
"themePreset": _this18.$props.themePreset
|
|
2544
2559
|
}, {
|
|
2545
2560
|
"default": function _default() {
|
|
2546
|
-
return [
|
|
2561
|
+
return [_this18.renderAIScreen(), ' ', _this18.renderErrorComponent(true)];
|
|
2547
2562
|
}
|
|
2548
|
-
}), !
|
|
2563
|
+
}), !_this18.showAIScreen && _this18.parsedSuggestions.map(function (item, itemIndex) {
|
|
2549
2564
|
var index = indexOffset + itemIndex;
|
|
2550
2565
|
if (Array.isArray(item)) {
|
|
2551
2566
|
var sectionHtml = xss(item[0].sectionLabel);
|
|
@@ -2554,7 +2569,7 @@ var SearchBox = defineComponent({
|
|
|
2554
2569
|
"key": "section-" + itemIndex,
|
|
2555
2570
|
"class": "section-container"
|
|
2556
2571
|
}, [sectionHtml ? createVNode("div", {
|
|
2557
|
-
"class": "section-header " + getClassName$1(
|
|
2572
|
+
"class": "section-header " + getClassName$1(_this18.$props.innerClass, 'section-label'),
|
|
2558
2573
|
"key": "" + item[0].sectionId,
|
|
2559
2574
|
"innerHTML": sectionHtml
|
|
2560
2575
|
}, null) : null, createVNode("ul", {
|
|
@@ -2574,7 +2589,7 @@ var SearchBox = defineComponent({
|
|
|
2574
2589
|
justifyContent: 'flex-start',
|
|
2575
2590
|
alignItems: 'center'
|
|
2576
2591
|
},
|
|
2577
|
-
"class": "" + (highlightedIndex === index + sectionIndex ? "active-li-item " + getClassName$1(
|
|
2592
|
+
"class": "" + (highlightedIndex === index + sectionIndex ? "active-li-item " + getClassName$1(_this18.$props.innerClass, 'active-suggestion-item') : "li-item " + getClassName$1(_this18.$props.innerClass, 'suggestion-item'))
|
|
2578
2593
|
}), [renderItem(sectionItem)]);
|
|
2579
2594
|
}
|
|
2580
2595
|
if (sectionItem._suggestion_type === '_internal_a_i_trigger') {
|
|
@@ -2588,9 +2603,9 @@ var SearchBox = defineComponent({
|
|
|
2588
2603
|
justifyContent: 'flex-start',
|
|
2589
2604
|
alignItems: 'center'
|
|
2590
2605
|
},
|
|
2591
|
-
"class": "" + (highlightedIndex === index + sectionIndex ? "active-li-item " + getClassName$1(
|
|
2606
|
+
"class": "" + (highlightedIndex === index + sectionIndex ? "active-li-item " + getClassName$1(_this18.$props.innerClass, 'active-suggestion-item') : "li-item " + getClassName$1(_this18.$props.innerClass, 'suggestion-item'))
|
|
2592
2607
|
}), [createVNode(SuggestionItem, {
|
|
2593
|
-
"currentValue":
|
|
2608
|
+
"currentValue": _this18.currentValue,
|
|
2594
2609
|
"suggestion": sectionItem
|
|
2595
2610
|
}, null)]);
|
|
2596
2611
|
}
|
|
@@ -2604,7 +2619,7 @@ var SearchBox = defineComponent({
|
|
|
2604
2619
|
justifyContent: 'flex-start',
|
|
2605
2620
|
alignItems: 'center'
|
|
2606
2621
|
},
|
|
2607
|
-
"class": "" + (highlightedIndex === index + sectionIndex ? "active-li-item " + getClassName$1(
|
|
2622
|
+
"class": "" + (highlightedIndex === index + sectionIndex ? "active-li-item " + getClassName$1(_this18.$props.innerClass, 'active-suggestion-item') : "li-item " + getClassName$1(_this18.$props.innerClass, 'suggestion-item'))
|
|
2608
2623
|
}), [createVNode("div", {
|
|
2609
2624
|
"style": {
|
|
2610
2625
|
padding: '0 10px 0 0',
|
|
@@ -2612,74 +2627,74 @@ var SearchBox = defineComponent({
|
|
|
2612
2627
|
}
|
|
2613
2628
|
}, [createVNode(CustomSvg, {
|
|
2614
2629
|
"key": sectionItem._suggestion_type + "-" + sectionIndex,
|
|
2615
|
-
"className": getClassName$1(
|
|
2630
|
+
"className": getClassName$1(_this18.$props.innerClass, sectionItem._suggestion_type + "-search-icon") || null,
|
|
2616
2631
|
"icon": getIcon(sectionItem._suggestion_type, sectionItem, suggestionsHaveIcon),
|
|
2617
2632
|
"type": sectionItem._suggestion_type + "-search-icon"
|
|
2618
2633
|
}, null)]), createVNode(SuggestionItem, {
|
|
2619
|
-
"currentValue":
|
|
2634
|
+
"currentValue": _this18.currentValue,
|
|
2620
2635
|
"suggestion": sectionItem
|
|
2621
|
-
}, null),
|
|
2636
|
+
}, null), _this18.renderActionIcon(sectionItem)]);
|
|
2622
2637
|
})])]);
|
|
2623
2638
|
}
|
|
2624
2639
|
return createVNode("div", null, [createTextVNode("No suggestions")]);
|
|
2625
|
-
}), !
|
|
2640
|
+
}), !_this18.showAIScreen && _this18.parsedSuggestions.length && _this18.$props.showSuggestionsFooter ? _this18.suggestionsFooter() : null]) : _this18.renderNoSuggestions(_this18.normalizedSuggestions)]);
|
|
2626
2641
|
};
|
|
2627
2642
|
return createVNode("div", {
|
|
2628
2643
|
"class": suggestionsContainer
|
|
2629
2644
|
}, [createVNode(InputGroup, {
|
|
2630
2645
|
"searchBox": true,
|
|
2631
2646
|
"ref": _inputGroupRef,
|
|
2632
|
-
"isOpen":
|
|
2647
|
+
"isOpen": _this18.$data.isOpen
|
|
2633
2648
|
}, {
|
|
2634
2649
|
"default": function _default() {
|
|
2635
2650
|
return [createVNode(Actions$1, null, {
|
|
2636
2651
|
"default": function _default() {
|
|
2637
|
-
return [
|
|
2652
|
+
return [_this18.renderInputAddonBefore(), _this18.renderLeftIcons()];
|
|
2638
2653
|
}
|
|
2639
2654
|
}), createVNode(InputWrapper, null, {
|
|
2640
2655
|
"default": function _default() {
|
|
2641
2656
|
return [createVNode(TextArea, mergeProps(_transformOn(getInputEvents({
|
|
2642
|
-
onInput:
|
|
2657
|
+
onInput: _this18.onInputChange,
|
|
2643
2658
|
onBlur: function onBlur(e) {
|
|
2644
|
-
|
|
2659
|
+
_this18.$emit('blur', e, _this18.triggerQuery);
|
|
2645
2660
|
},
|
|
2646
|
-
onFocus:
|
|
2661
|
+
onFocus: _this18.handleFocus,
|
|
2647
2662
|
onKeyPress: function onKeyPress(e) {
|
|
2648
|
-
|
|
2649
|
-
|
|
2663
|
+
_this18.$emit('keyPress', e, _this18.triggerQuery);
|
|
2664
|
+
_this18.$emit('key-press', e, _this18.triggerQuery);
|
|
2650
2665
|
},
|
|
2651
2666
|
onKeyDown: function onKeyDown(e) {
|
|
2652
|
-
return
|
|
2667
|
+
return _this18.handleKeyDown(e, highlightedIndex);
|
|
2653
2668
|
},
|
|
2654
2669
|
onKeyUp: function onKeyUp(e) {
|
|
2655
|
-
|
|
2656
|
-
|
|
2670
|
+
_this18.$emit('keyUp', e, _this18.triggerQuery);
|
|
2671
|
+
_this18.$emit('key-up', e, _this18.triggerQuery);
|
|
2657
2672
|
},
|
|
2658
2673
|
onClick: function onClick() {
|
|
2659
2674
|
setHighlightedIndex(null);
|
|
2660
2675
|
}
|
|
2661
2676
|
})), {
|
|
2662
2677
|
"searchBox": true,
|
|
2663
|
-
"isOpen":
|
|
2664
|
-
"id":
|
|
2665
|
-
"ref":
|
|
2666
|
-
"class": getClassName$1(
|
|
2667
|
-
"placeholder":
|
|
2668
|
-
"autoFocus":
|
|
2678
|
+
"isOpen": _this18.$data.isOpen,
|
|
2679
|
+
"id": _this18.$props.componentId + "-input",
|
|
2680
|
+
"ref": _this18.$props.innerRef,
|
|
2681
|
+
"class": getClassName$1(_this18.$props.innerClass, 'input'),
|
|
2682
|
+
"placeholder": _this18.$props.placeholder,
|
|
2683
|
+
"autoFocus": _this18.$props.autoFocus
|
|
2669
2684
|
}, getInputProps({
|
|
2670
|
-
value:
|
|
2685
|
+
value: _this18.$data.currentValue === null ? '' : _this18.$data.currentValue
|
|
2671
2686
|
}), {
|
|
2672
|
-
"themePreset":
|
|
2687
|
+
"themePreset": _this18.themePreset,
|
|
2673
2688
|
"autocomplete": "off"
|
|
2674
2689
|
}), null), !expandSuggestionsContainer && renderSuggestionsDropdown()];
|
|
2675
2690
|
}
|
|
2676
2691
|
}), createVNode(Actions$1, null, {
|
|
2677
2692
|
"default": function _default() {
|
|
2678
|
-
return [
|
|
2693
|
+
return [_this18.renderRightIcons(), _this18.renderInputAddonAfter(), _this18.renderAskButtonElement(), _this18.renderEnterButtonElement()];
|
|
2679
2694
|
}
|
|
2680
2695
|
})];
|
|
2681
2696
|
}
|
|
2682
|
-
}), expandSuggestionsContainer && renderSuggestionsDropdown(),
|
|
2697
|
+
}), expandSuggestionsContainer && renderSuggestionsDropdown(), _this18.renderTags()]);
|
|
2683
2698
|
}
|
|
2684
2699
|
}) : createVNode("div", {
|
|
2685
2700
|
"class": suggestionsContainer
|
|
@@ -2690,43 +2705,43 @@ var SearchBox = defineComponent({
|
|
|
2690
2705
|
"default": function _default() {
|
|
2691
2706
|
return [createVNode(Actions$1, null, {
|
|
2692
2707
|
"default": function _default() {
|
|
2693
|
-
return [
|
|
2708
|
+
return [_this18.renderInputAddonBefore(), _this18.renderLeftIcons()];
|
|
2694
2709
|
}
|
|
2695
2710
|
}), createVNode(InputWrapper, null, {
|
|
2696
2711
|
"default": function _default() {
|
|
2697
2712
|
return [createVNode(TextArea, mergeProps(_transformOn({
|
|
2698
2713
|
blur: function blur(e) {
|
|
2699
|
-
|
|
2714
|
+
_this18.$emit('blur', e, _this18.triggerQuery);
|
|
2700
2715
|
},
|
|
2701
2716
|
keypress: function keypress(e) {
|
|
2702
|
-
|
|
2703
|
-
|
|
2717
|
+
_this18.$emit('keyPress', e, _this18.triggerQuery);
|
|
2718
|
+
_this18.$emit('key-press', e, _this18.triggerQuery);
|
|
2704
2719
|
},
|
|
2705
|
-
input:
|
|
2720
|
+
input: _this18.onInputChange,
|
|
2706
2721
|
focus: function focus(e) {
|
|
2707
|
-
|
|
2722
|
+
_this18.$emit('focus', e, _this18.triggerQuery);
|
|
2708
2723
|
},
|
|
2709
|
-
keydown:
|
|
2724
|
+
keydown: _this18.handleKeyDown,
|
|
2710
2725
|
keyup: function keyup(e) {
|
|
2711
|
-
|
|
2712
|
-
|
|
2726
|
+
_this18.$emit('keyUp', e, _this18.triggerQuery);
|
|
2727
|
+
_this18.$emit('key-up', e, _this18.triggerQuery);
|
|
2713
2728
|
}
|
|
2714
2729
|
}), {
|
|
2715
2730
|
"searchBox": true,
|
|
2716
|
-
"class": getClassName$1(
|
|
2717
|
-
"placeholder":
|
|
2718
|
-
"autofocus":
|
|
2719
|
-
"value":
|
|
2720
|
-
"iconPosition":
|
|
2721
|
-
"showIcon":
|
|
2722
|
-
"showClear":
|
|
2723
|
-
"ref":
|
|
2724
|
-
"themePreset":
|
|
2731
|
+
"class": getClassName$1(_this18.$props.innerClass, 'input') || '',
|
|
2732
|
+
"placeholder": _this18.$props.placeholder,
|
|
2733
|
+
"autofocus": _this18.$props.autoFocus,
|
|
2734
|
+
"value": _this18.$data.currentValue ? _this18.$data.currentValue : '',
|
|
2735
|
+
"iconPosition": _this18.$props.iconPosition,
|
|
2736
|
+
"showIcon": _this18.$props.showIcon,
|
|
2737
|
+
"showClear": _this18.$props.showClear,
|
|
2738
|
+
"ref": _this18.$props.innerRef,
|
|
2739
|
+
"themePreset": _this18.themePreset
|
|
2725
2740
|
}), null)];
|
|
2726
2741
|
}
|
|
2727
2742
|
}), createVNode(Actions$1, null, {
|
|
2728
2743
|
"default": function _default() {
|
|
2729
|
-
return [
|
|
2744
|
+
return [_this18.renderRightIcons(), _this18.renderInputAddonAfter(), _this18.renderEnterButtonElement()];
|
|
2730
2745
|
}
|
|
2731
2746
|
})];
|
|
2732
2747
|
}
|
|
@@ -2945,7 +2960,10 @@ var AIAnswer = defineComponent({
|
|
|
2945
2960
|
if (messagesHistory && Array.isArray(messagesHistory)) {
|
|
2946
2961
|
finalMessages.push.apply(finalMessages, messagesHistory.filter(function (msg) {
|
|
2947
2962
|
return msg.role !== AI_ROLES.SYSTEM;
|
|
2948
|
-
})
|
|
2963
|
+
}));
|
|
2964
|
+
if (finalMessages[0].role === AI_ROLES.USER) {
|
|
2965
|
+
finalMessages.shift();
|
|
2966
|
+
}
|
|
2949
2967
|
} else if (response && response.answer && response.answer.text) {
|
|
2950
2968
|
finalMessages.push({
|
|
2951
2969
|
role: AI_ROLES.ASSISTANT,
|