@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
|
@@ -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-
|
|
31
|
-
var Input = require('./Input-
|
|
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');
|
|
@@ -65,7 +65,7 @@ InputGroup.defaultProps = {
|
|
|
65
65
|
};
|
|
66
66
|
|
|
67
67
|
var _templateObject$1;
|
|
68
|
-
var InputAddon = vueEmotion.styled('span')(_templateObject$1 || (_templateObject$1 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: #fafafa;\n border: 1px solid
|
|
68
|
+
var InputAddon = vueEmotion.styled('span')(_templateObject$1 || (_templateObject$1 = _rollupPluginBabelHelpers._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"])));
|
|
69
69
|
InputAddon.defaultProps = {
|
|
70
70
|
className: 'input-addon'
|
|
71
71
|
};
|
|
@@ -870,16 +870,10 @@ var Message = vueEmotion.styled('div')(_templateObject7 || (_templateObject7 = _
|
|
|
870
870
|
return resetCSS(props);
|
|
871
871
|
});
|
|
872
872
|
var MessageInputContainer = vueEmotion.styled('form')(_templateObject8 || (_templateObject8 = _rollupPluginBabelHelpers._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"])));
|
|
873
|
-
var MessageInput = vueEmotion.styled(Input.TextArea)(_templateObject9 || (_templateObject9 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\twidth: 100%;\n\tborder-radius: 5px;\n\tborder: 1px solid #ccc;\n\tbackground-color: ", ";\n\tcolor: ", ";\n\n\t
|
|
873
|
+
var MessageInput = vueEmotion.styled(Input.TextArea)(_templateObject9 || (_templateObject9 = _rollupPluginBabelHelpers._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) {
|
|
874
874
|
return props.themePreset === 'dark' ? props.theme.colors.borderColor : '#fff';
|
|
875
875
|
}, function (props) {
|
|
876
876
|
return props.themePreset === 'dark' ? props.theme.colors.titleColor : props.theme.colors.textColor;
|
|
877
|
-
}, function (props) {
|
|
878
|
-
return props.theme.colors.textColor;
|
|
879
|
-
}, function (props) {
|
|
880
|
-
return props.theme.colors.textColor;
|
|
881
|
-
}, function (props) {
|
|
882
|
-
return props.theme.colors.textColor;
|
|
883
877
|
}, function (_ref) {
|
|
884
878
|
var enterButton = _ref.enterButton;
|
|
885
879
|
return enterButton && "\n\t\t border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n\t";
|
|
@@ -1311,7 +1305,23 @@ var SearchBox = vue.defineComponent({
|
|
|
1311
1305
|
AIUIConfig: vueTypes.types.AIUIConfig
|
|
1312
1306
|
},
|
|
1313
1307
|
mounted: function mounted() {
|
|
1308
|
+
var _this = this;
|
|
1314
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
|
+
}
|
|
1315
1325
|
},
|
|
1316
1326
|
updated: function updated() {
|
|
1317
1327
|
if (this.$props.mode === constants.SEARCH_COMPONENTS_MODES.SELECT && this.$options.isTagsMode === true) {
|
|
@@ -1330,6 +1340,9 @@ var SearchBox = vue.defineComponent({
|
|
|
1330
1340
|
if (localCache && localCache.meta && localCache.meta.hits && localCache.meta.hits.hits) {
|
|
1331
1341
|
this.initialHits = localCache.meta.hits.hits;
|
|
1332
1342
|
}
|
|
1343
|
+
if (!this.showAIScreenFooter) {
|
|
1344
|
+
this.showAIScreenFooter = true;
|
|
1345
|
+
}
|
|
1333
1346
|
}
|
|
1334
1347
|
}
|
|
1335
1348
|
},
|
|
@@ -1444,9 +1457,10 @@ var SearchBox = vue.defineComponent({
|
|
|
1444
1457
|
}
|
|
1445
1458
|
},
|
|
1446
1459
|
isAITyping: function isAITyping(newVal, oldVal) {
|
|
1447
|
-
var
|
|
1460
|
+
var _this2 = this;
|
|
1448
1461
|
var scrollAIContainer = function scrollAIContainer() {
|
|
1449
|
-
|
|
1462
|
+
if (_this2.isUserScrolling) return;
|
|
1463
|
+
var dropdownEle = _this2.$refs[_dropdownULRef];
|
|
1450
1464
|
if (dropdownEle) {
|
|
1451
1465
|
dropdownEle.scrollTo({
|
|
1452
1466
|
top: dropdownEle.scrollHeight,
|
|
@@ -1455,6 +1469,7 @@ var SearchBox = vue.defineComponent({
|
|
|
1455
1469
|
}
|
|
1456
1470
|
};
|
|
1457
1471
|
if (!newVal && oldVal) {
|
|
1472
|
+
clearInterval(this.scrollTimerRef);
|
|
1458
1473
|
this.showAIScreenFooter = true;
|
|
1459
1474
|
if (this.$props.AIUIConfig && typeof this.$props.AIUIConfig.showFeedback === 'boolean' ? this.$props.AIUIConfig.showFeedback : true) {
|
|
1460
1475
|
this.showFeedbackComponent = true;
|
|
@@ -1463,7 +1478,7 @@ var SearchBox = vue.defineComponent({
|
|
|
1463
1478
|
scrollAIContainer();
|
|
1464
1479
|
}, 500);
|
|
1465
1480
|
} else if (newVal) {
|
|
1466
|
-
this.scrollTimerRef =
|
|
1481
|
+
this.scrollTimerRef = setInterval(function () {
|
|
1467
1482
|
scrollAIContainer();
|
|
1468
1483
|
}, 2000);
|
|
1469
1484
|
}
|
|
@@ -1480,7 +1495,7 @@ var SearchBox = vue.defineComponent({
|
|
|
1480
1495
|
}
|
|
1481
1496
|
},
|
|
1482
1497
|
currentValue: function currentValue() {
|
|
1483
|
-
this.handleTextAreaHeightChange
|
|
1498
|
+
this.$nextTick(this.handleTextAreaHeightChange);
|
|
1484
1499
|
}
|
|
1485
1500
|
},
|
|
1486
1501
|
methods: {
|
|
@@ -1555,7 +1570,7 @@ var SearchBox = vue.defineComponent({
|
|
|
1555
1570
|
}
|
|
1556
1571
|
},
|
|
1557
1572
|
setValue: function setValue(value, isDefaultValue, props, cause, toggleIsOpen, categoryValue, shouldExecuteQuery) {
|
|
1558
|
-
var
|
|
1573
|
+
var _this3 = this;
|
|
1559
1574
|
if (isDefaultValue === void 0) {
|
|
1560
1575
|
isDefaultValue = false;
|
|
1561
1576
|
}
|
|
@@ -1572,65 +1587,65 @@ var SearchBox = vue.defineComponent({
|
|
|
1572
1587
|
shouldExecuteQuery = true;
|
|
1573
1588
|
}
|
|
1574
1589
|
var performUpdate = function performUpdate() {
|
|
1575
|
-
if (
|
|
1590
|
+
if (_this3.$options.isTagsMode && isEqual(value, _this3.selectedTags)) {
|
|
1576
1591
|
return;
|
|
1577
1592
|
}
|
|
1578
|
-
if (
|
|
1579
|
-
if (Array.isArray(
|
|
1593
|
+
if (_this3.$options.isTagsMode && cause === reactivecore.causes.SUGGESTION_SELECT) {
|
|
1594
|
+
if (Array.isArray(_this3.selectedTags) && _this3.selectedTags.length) {
|
|
1580
1595
|
// check if value already present in selectedTags
|
|
1581
|
-
if (typeof value === 'string' &&
|
|
1582
|
-
|
|
1596
|
+
if (typeof value === 'string' && _this3.selectedTags.includes(value)) {
|
|
1597
|
+
_this3.isOpen = false;
|
|
1583
1598
|
return;
|
|
1584
1599
|
}
|
|
1585
|
-
|
|
1600
|
+
_this3.selectedTags = [].concat(_this3.selectedTags);
|
|
1586
1601
|
if (typeof value === 'string' && !!value) {
|
|
1587
|
-
|
|
1588
|
-
} else if (Array.isArray(value) && !isEqual(
|
|
1589
|
-
|
|
1602
|
+
_this3.selectedTags.push(value);
|
|
1603
|
+
} else if (Array.isArray(value) && !isEqual(_this3.selectedTags, value)) {
|
|
1604
|
+
_this3.selectedTags = value;
|
|
1590
1605
|
}
|
|
1591
1606
|
} else if (value) {
|
|
1592
|
-
|
|
1607
|
+
_this3.selectedTags = typeof value !== 'string' ? value : [].concat(value);
|
|
1593
1608
|
}
|
|
1594
|
-
|
|
1609
|
+
_this3.currentValue = '';
|
|
1595
1610
|
} else {
|
|
1596
|
-
|
|
1611
|
+
_this3.currentValue = index.decodeHtml(value);
|
|
1597
1612
|
}
|
|
1598
1613
|
var queryHandlerValue = value;
|
|
1599
|
-
if (
|
|
1600
|
-
queryHandlerValue = Array.isArray(
|
|
1614
|
+
if (_this3.$options.isTagsMode && cause === reactivecore.causes.SUGGESTION_SELECT) {
|
|
1615
|
+
queryHandlerValue = Array.isArray(_this3.selectedTags) && _this3.selectedTags.length ? _this3.selectedTags : undefined;
|
|
1601
1616
|
}
|
|
1602
|
-
if ((
|
|
1617
|
+
if ((_this3.faqAnswer || _this3.faqQuestion) && value === '') {
|
|
1603
1618
|
// Empty the previous state
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1619
|
+
_this3.faqAnswer = '';
|
|
1620
|
+
_this3.faqQuestion = '';
|
|
1621
|
+
_this3.showAIScreen = false;
|
|
1607
1622
|
}
|
|
1608
1623
|
if (isDefaultValue) {
|
|
1609
|
-
if (
|
|
1624
|
+
if (_this3.$props.autosuggest) {
|
|
1610
1625
|
if (toggleIsOpen) {
|
|
1611
|
-
|
|
1626
|
+
_this3.isOpen = false;
|
|
1612
1627
|
}
|
|
1613
|
-
if (typeof
|
|
1628
|
+
if (typeof _this3.currentValue === 'string') _this3.triggerDefaultQuery(_this3.currentValue, props.enableAI && _this3.currentTriggerMode === constants.AI_TRIGGER_MODES.QUESTION && _this3.currentValue.endsWith('?') ? {
|
|
1614
1629
|
enableAI: true
|
|
1615
1630
|
} : {}, shouldExecuteQuery);
|
|
1616
1631
|
} // in case of strict selection only SUGGESTION_SELECT should be able
|
|
1617
1632
|
// to set the query otherwise the value should reset
|
|
1618
1633
|
if (props.strictSelection) {
|
|
1619
|
-
if (cause === reactivecore.causes.SUGGESTION_SELECT || (
|
|
1620
|
-
|
|
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);
|
|
1621
1636
|
} else {
|
|
1622
|
-
|
|
1637
|
+
_this3.setValue('', true);
|
|
1623
1638
|
}
|
|
1624
1639
|
} else if (props.value === undefined || cause === reactivecore.causes.SUGGESTION_SELECT || cause === reactivecore.causes.CLEAR_VALUE) {
|
|
1625
|
-
|
|
1626
|
-
|
|
1640
|
+
_this3.showAIScreen = false;
|
|
1641
|
+
_this3.triggerCustomQuery(queryHandlerValue, _this3.$options.isTagsMode ? undefined : categoryValue, shouldExecuteQuery);
|
|
1627
1642
|
}
|
|
1628
1643
|
} else {
|
|
1629
1644
|
// debounce for handling text while typing
|
|
1630
|
-
|
|
1645
|
+
_this3.handleTextChange(value, cause);
|
|
1631
1646
|
}
|
|
1632
|
-
|
|
1633
|
-
|
|
1647
|
+
_this3.$emit('valueChange', value);
|
|
1648
|
+
_this3.$emit('value-change', value);
|
|
1634
1649
|
};
|
|
1635
1650
|
checkValueChange(props.componentId, value, props.beforeValueChange, performUpdate);
|
|
1636
1651
|
},
|
|
@@ -1779,7 +1794,7 @@ var SearchBox = vue.defineComponent({
|
|
|
1779
1794
|
this.$emit('key-down', event, this.triggerQuery);
|
|
1780
1795
|
},
|
|
1781
1796
|
onInputChange: function onInputChange(e) {
|
|
1782
|
-
var
|
|
1797
|
+
var _this4 = this;
|
|
1783
1798
|
var inputValue = e.target.value;
|
|
1784
1799
|
if (!this.$data.isOpen && this.$props.autosuggest) {
|
|
1785
1800
|
this.isOpen = true;
|
|
@@ -1793,7 +1808,7 @@ var SearchBox = vue.defineComponent({
|
|
|
1793
1808
|
} else {
|
|
1794
1809
|
this.$emit('change', inputValue, function (_ref3) {
|
|
1795
1810
|
var isOpen = _ref3.isOpen;
|
|
1796
|
-
return
|
|
1811
|
+
return _this4.triggerQuery({
|
|
1797
1812
|
defaultQuery: true,
|
|
1798
1813
|
customQuery: true,
|
|
1799
1814
|
value: inputValue,
|
|
@@ -1837,7 +1852,7 @@ var SearchBox = vue.defineComponent({
|
|
|
1837
1852
|
}
|
|
1838
1853
|
},
|
|
1839
1854
|
onSuggestionSelected: function onSuggestionSelected(suggestion) {
|
|
1840
|
-
var
|
|
1855
|
+
var _this5 = this;
|
|
1841
1856
|
var value = this.$props.value;
|
|
1842
1857
|
// The state of the suggestion is open by the time it reaches here. i.e. isOpen = true
|
|
1843
1858
|
// handle when FAQ suggestion is clicked
|
|
@@ -1886,10 +1901,10 @@ var SearchBox = vue.defineComponent({
|
|
|
1886
1901
|
this.setValue(emitValue, true, this.$props, reactivecore.causes.SUGGESTION_SELECT, false, suggestion._category);
|
|
1887
1902
|
this.$emit('change', emitValue, function (_ref4) {
|
|
1888
1903
|
var isOpen = _ref4.isOpen;
|
|
1889
|
-
return
|
|
1904
|
+
return _this5.triggerQuery(_rollupPluginBabelHelpers._extends({
|
|
1890
1905
|
isOpen: isOpen,
|
|
1891
1906
|
value: emitValue
|
|
1892
|
-
}, !
|
|
1907
|
+
}, !_this5.$options.isTagsMode && {
|
|
1893
1908
|
categoryValue: suggestion._category
|
|
1894
1909
|
}));
|
|
1895
1910
|
});
|
|
@@ -1929,7 +1944,7 @@ var SearchBox = vue.defineComponent({
|
|
|
1929
1944
|
return null;
|
|
1930
1945
|
},
|
|
1931
1946
|
renderErrorComponent: function renderErrorComponent(isAIError) {
|
|
1932
|
-
var
|
|
1947
|
+
var _this6 = this;
|
|
1933
1948
|
if (isAIError === void 0) {
|
|
1934
1949
|
isAIError = false;
|
|
1935
1950
|
}
|
|
@@ -1956,7 +1971,7 @@ var SearchBox = vue.defineComponent({
|
|
|
1956
1971
|
"themePreset": this.themePreset
|
|
1957
1972
|
}, {
|
|
1958
1973
|
"default": function _default() {
|
|
1959
|
-
return [index.isFunction(renderError) ? renderError(
|
|
1974
|
+
return [index.isFunction(renderError) ? renderError(_this6.error) : renderError];
|
|
1960
1975
|
}
|
|
1961
1976
|
});
|
|
1962
1977
|
}
|
|
@@ -2036,7 +2051,7 @@ var SearchBox = vue.defineComponent({
|
|
|
2036
2051
|
});
|
|
2037
2052
|
},
|
|
2038
2053
|
renderEnterButtonElement: function renderEnterButtonElement() {
|
|
2039
|
-
var
|
|
2054
|
+
var _this7 = this;
|
|
2040
2055
|
var _this$$props2 = this.$props,
|
|
2041
2056
|
enterButton = _this$$props2.enterButton,
|
|
2042
2057
|
innerClass = _this$$props2.innerClass;
|
|
@@ -2044,12 +2059,12 @@ var SearchBox = vue.defineComponent({
|
|
|
2044
2059
|
if (enterButton) {
|
|
2045
2060
|
var getEnterButtonMarkup = function getEnterButtonMarkup() {
|
|
2046
2061
|
if (renderEnterButton) {
|
|
2047
|
-
return renderEnterButton(
|
|
2062
|
+
return renderEnterButton(_this7.enterButtonOnClick);
|
|
2048
2063
|
}
|
|
2049
2064
|
return vue.createVNode(Button.Button, {
|
|
2050
2065
|
"class": "enter-btn " + getClassName$1(innerClass, 'enter-button'),
|
|
2051
2066
|
"primary": true,
|
|
2052
|
-
"onClick":
|
|
2067
|
+
"onClick": _this7.enterButtonOnClick
|
|
2053
2068
|
}, {
|
|
2054
2069
|
"default": function _default() {
|
|
2055
2070
|
return [vue.createTextVNode("Search")];
|
|
@@ -2075,7 +2090,7 @@ var SearchBox = vue.defineComponent({
|
|
|
2075
2090
|
return '/';
|
|
2076
2091
|
},
|
|
2077
2092
|
renderLeftIcons: function renderLeftIcons() {
|
|
2078
|
-
var
|
|
2093
|
+
var _this8 = this;
|
|
2079
2094
|
var _slot3;
|
|
2080
2095
|
var _this$$props3 = this.$props,
|
|
2081
2096
|
iconPosition = _this$$props3.iconPosition,
|
|
@@ -2085,8 +2100,8 @@ var SearchBox = vue.defineComponent({
|
|
|
2085
2100
|
}, {
|
|
2086
2101
|
"default": function _default() {
|
|
2087
2102
|
return [iconPosition === 'left' && showIcon && vue.createVNode(DropDown.IconWrapper, {
|
|
2088
|
-
"onClick":
|
|
2089
|
-
}, _isSlot(_slot3 =
|
|
2103
|
+
"onClick": _this8.handleSearchIconClick
|
|
2104
|
+
}, _isSlot(_slot3 = _this8.renderIcon()) ? _slot3 : {
|
|
2090
2105
|
"default": function _default() {
|
|
2091
2106
|
return [_slot3];
|
|
2092
2107
|
}
|
|
@@ -2095,7 +2110,7 @@ var SearchBox = vue.defineComponent({
|
|
|
2095
2110
|
})]);
|
|
2096
2111
|
},
|
|
2097
2112
|
renderRightIcons: function renderRightIcons() {
|
|
2098
|
-
var
|
|
2113
|
+
var _this9 = this;
|
|
2099
2114
|
var _slot4, _slot5, _slot6;
|
|
2100
2115
|
var _this$$props4 = this.$props,
|
|
2101
2116
|
iconPosition = _this$$props4.iconPosition,
|
|
@@ -2112,29 +2127,29 @@ var SearchBox = vue.defineComponent({
|
|
|
2112
2127
|
}, {
|
|
2113
2128
|
"default": function _default() {
|
|
2114
2129
|
return [currentValue && showClear && vue.createVNode(DropDown.IconWrapper, {
|
|
2115
|
-
"onClick":
|
|
2130
|
+
"onClick": _this9.clearValue,
|
|
2116
2131
|
"showIcon": showIcon,
|
|
2117
2132
|
"isClearIcon": true
|
|
2118
|
-
}, _isSlot(_slot4 =
|
|
2133
|
+
}, _isSlot(_slot4 = _this9.renderCancelIcon()) ? _slot4 : {
|
|
2119
2134
|
"default": function _default() {
|
|
2120
2135
|
return [_slot4];
|
|
2121
2136
|
}
|
|
2122
2137
|
}), showFocusShortcutsIcon && vue.createVNode(DropDown.ButtonIconWrapper, {
|
|
2123
2138
|
"onClick": function onClick(e) {
|
|
2124
|
-
return
|
|
2139
|
+
return _this9.focusSearchBox(e);
|
|
2125
2140
|
}
|
|
2126
|
-
}, _isSlot(_slot5 =
|
|
2141
|
+
}, _isSlot(_slot5 = _this9.renderShortcut()) ? _slot5 : {
|
|
2127
2142
|
"default": function _default() {
|
|
2128
2143
|
return [_slot5];
|
|
2129
2144
|
}
|
|
2130
2145
|
}), showVoiceSearch && vue.createVNode(Mic, {
|
|
2131
2146
|
"getInstance": getMicInstance,
|
|
2132
2147
|
"render": renderMic,
|
|
2133
|
-
"handleResult":
|
|
2148
|
+
"handleResult": _this9.handleVoiceResults,
|
|
2134
2149
|
"className": getClassName$1(innerClass, 'mic') || null
|
|
2135
2150
|
}, null), iconPosition === 'right' && showIcon && vue.createVNode(DropDown.IconWrapper, {
|
|
2136
|
-
"onClick":
|
|
2137
|
-
}, _isSlot(_slot6 =
|
|
2151
|
+
"onClick": _this9.handleSearchIconClick
|
|
2152
|
+
}, _isSlot(_slot6 = _this9.renderIcon()) ? _slot6 : {
|
|
2138
2153
|
"default": function _default() {
|
|
2139
2154
|
return [_slot6];
|
|
2140
2155
|
}
|
|
@@ -2153,7 +2168,7 @@ var SearchBox = vue.defineComponent({
|
|
|
2153
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
|
|
2154
2169
|
},
|
|
2155
2170
|
listenForFocusShortcuts: function listenForFocusShortcuts() {
|
|
2156
|
-
var
|
|
2171
|
+
var _this10 = this;
|
|
2157
2172
|
var _this$$props$focusSho = this.$props.focusShortcuts,
|
|
2158
2173
|
focusShortcuts = _this$$props$focusSho === void 0 ? ['/'] : _this$$props$focusSho;
|
|
2159
2174
|
if (index.isEmpty(focusShortcuts)) {
|
|
@@ -2168,7 +2183,7 @@ var SearchBox = vue.defineComponent({
|
|
|
2168
2183
|
function (event, handler) {
|
|
2169
2184
|
// Prevent the default refresh event under WINDOWS system
|
|
2170
2185
|
event.preventDefault();
|
|
2171
|
-
|
|
2186
|
+
_this10.focusSearchBox(event);
|
|
2172
2187
|
});
|
|
2173
2188
|
|
|
2174
2189
|
// if one of modifier keys are used, they are handled below
|
|
@@ -2178,7 +2193,7 @@ var SearchBox = vue.defineComponent({
|
|
|
2178
2193
|
for (var index$1 = 0; index$1 < modifierKeys.length; index$1 += 1) {
|
|
2179
2194
|
var element = modifierKeys[index$1];
|
|
2180
2195
|
if (hotkeys[element]) {
|
|
2181
|
-
|
|
2196
|
+
_this10.focusSearchBox(event);
|
|
2182
2197
|
break;
|
|
2183
2198
|
}
|
|
2184
2199
|
}
|
|
@@ -2191,10 +2206,10 @@ var SearchBox = vue.defineComponent({
|
|
|
2191
2206
|
this.triggerDefaultQuery(value);
|
|
2192
2207
|
},
|
|
2193
2208
|
renderActionIcon: function renderActionIcon(suggestion) {
|
|
2194
|
-
var
|
|
2209
|
+
var _this11 = this;
|
|
2195
2210
|
var handleAutoFillClick = function handleAutoFillClick(e) {
|
|
2196
2211
|
e.stopPropagation();
|
|
2197
|
-
|
|
2212
|
+
_this11.onAutofillClick(suggestion);
|
|
2198
2213
|
};
|
|
2199
2214
|
if (suggestion._suggestion_type === helper.suggestionTypes.Featured) {
|
|
2200
2215
|
if (suggestion.action === helper.featuredSuggestionsActionTypes.FUNCTION) {
|
|
@@ -2217,7 +2232,7 @@ var SearchBox = vue.defineComponent({
|
|
|
2217
2232
|
return null;
|
|
2218
2233
|
},
|
|
2219
2234
|
renderTag: function renderTag(item) {
|
|
2220
|
-
var
|
|
2235
|
+
var _this12 = this;
|
|
2221
2236
|
var innerClass = this.$props.innerClass;
|
|
2222
2237
|
return vue.createVNode(TagItem, {
|
|
2223
2238
|
"class": getClassName$1(innerClass, 'selected-tag') || ''
|
|
@@ -2228,7 +2243,7 @@ var SearchBox = vue.defineComponent({
|
|
|
2228
2243
|
"aria-label": "delete-tag",
|
|
2229
2244
|
"class": "close-icon",
|
|
2230
2245
|
"onClick": function onClick() {
|
|
2231
|
-
return
|
|
2246
|
+
return _this12.clearTag(item);
|
|
2232
2247
|
}
|
|
2233
2248
|
}, [vue.createVNode(DropDown.CancelSvg, null, null)])];
|
|
2234
2249
|
}
|
|
@@ -2251,7 +2266,7 @@ var SearchBox = vue.defineComponent({
|
|
|
2251
2266
|
}
|
|
2252
2267
|
},
|
|
2253
2268
|
renderTags: function renderTags() {
|
|
2254
|
-
var
|
|
2269
|
+
var _this13 = this;
|
|
2255
2270
|
if (!Array.isArray(this.selectedTags)) {
|
|
2256
2271
|
return null;
|
|
2257
2272
|
}
|
|
@@ -2265,16 +2280,16 @@ var SearchBox = vue.defineComponent({
|
|
|
2265
2280
|
}) : vue.createVNode(TagsContainer, null, {
|
|
2266
2281
|
"default": function _default() {
|
|
2267
2282
|
return [tagsList.map(function (item) {
|
|
2268
|
-
return
|
|
2283
|
+
return _this13.renderTag(item);
|
|
2269
2284
|
}), shouldRenderClearAllTag && vue.createVNode(TagItem, {
|
|
2270
|
-
"class": getClassName$1(
|
|
2285
|
+
"class": getClassName$1(_this13.$props.innerClass, 'selected-tag') || ''
|
|
2271
2286
|
}, {
|
|
2272
2287
|
"default": function _default() {
|
|
2273
2288
|
return [vue.createVNode("span", null, [vue.createTextVNode("Clear All")]), vue.createVNode("span", {
|
|
2274
2289
|
"role": "img",
|
|
2275
2290
|
"aria-label": "delete-tag",
|
|
2276
2291
|
"class": "close-icon",
|
|
2277
|
-
"onClick":
|
|
2292
|
+
"onClick": _this13.clearAllTags
|
|
2278
2293
|
}, [vue.createVNode(DropDown.CancelSvg, null, null)])];
|
|
2279
2294
|
}
|
|
2280
2295
|
})];
|
|
@@ -2282,13 +2297,13 @@ var SearchBox = vue.defineComponent({
|
|
|
2282
2297
|
});
|
|
2283
2298
|
},
|
|
2284
2299
|
getAISourceObjects: function getAISourceObjects() {
|
|
2285
|
-
var
|
|
2300
|
+
var _this14 = this;
|
|
2286
2301
|
var sourceObjects = [];
|
|
2287
2302
|
if (!this.AIResponse) return sourceObjects;
|
|
2288
2303
|
var docIds = this.AIResponse && this.AIResponse.response && this.AIResponse.response.answer && this.AIResponse.response.answer.documentIds || [];
|
|
2289
2304
|
if (this.initialHits) {
|
|
2290
2305
|
docIds.forEach(function (id) {
|
|
2291
|
-
var foundSourceObj =
|
|
2306
|
+
var foundSourceObj = _this14.initialHits.find(function (hit) {
|
|
2292
2307
|
return hit._id === id;
|
|
2293
2308
|
}) || {};
|
|
2294
2309
|
if (foundSourceObj) {
|
|
@@ -2322,20 +2337,20 @@ var SearchBox = vue.defineComponent({
|
|
|
2322
2337
|
},
|
|
2323
2338
|
renderAIScreenFooter: function renderAIScreenFooter() {
|
|
2324
2339
|
var _slot8;
|
|
2325
|
-
var
|
|
2340
|
+
var _this15 = this;
|
|
2326
2341
|
var _this$$props$AIUIConf2 = this.$props.AIUIConfig,
|
|
2327
2342
|
AIUIConfig = _this$$props$AIUIConf2 === void 0 ? {} : _this$$props$AIUIConf2;
|
|
2328
2343
|
var _ref6 = AIUIConfig || {},
|
|
2329
2344
|
_ref6$showSourceDocum = _ref6.showSourceDocuments,
|
|
2330
|
-
showSourceDocuments = _ref6$showSourceDocum === void 0 ?
|
|
2345
|
+
showSourceDocuments = _ref6$showSourceDocum === void 0 ? false : _ref6$showSourceDocum,
|
|
2331
2346
|
_ref6$onSourceClick = _ref6.onSourceClick,
|
|
2332
2347
|
onSourceClick = _ref6$onSourceClick === void 0 ? function () {} : _ref6$onSourceClick;
|
|
2333
2348
|
var renderSourceDocumentLabel = function renderSourceDocumentLabel(sourceObj) {
|
|
2334
|
-
if (
|
|
2335
|
-
return
|
|
2349
|
+
if (_this15.$props.AIUIConfig && _this15.$props.AIUIConfig.renderSourceDocument) {
|
|
2350
|
+
return _this15.$props.AIUIConfig.renderSourceDocument(sourceObj);
|
|
2336
2351
|
}
|
|
2337
|
-
if (
|
|
2338
|
-
return
|
|
2352
|
+
if (_this15.$slots.renderSourceDocument) {
|
|
2353
|
+
return _this15.$slots.renderSourceDocument(sourceObj);
|
|
2339
2354
|
}
|
|
2340
2355
|
return sourceObj._id;
|
|
2341
2356
|
};
|
|
@@ -2343,10 +2358,10 @@ var SearchBox = vue.defineComponent({
|
|
|
2343
2358
|
"themePreset": this.$props.themePreset
|
|
2344
2359
|
}, {
|
|
2345
2360
|
"default": function _default() {
|
|
2346
|
-
return [vue.createTextVNode("Summary generated using the following sources:"), ' ', vue.createVNode(SourceTags, null, _isSlot(_slot8 =
|
|
2361
|
+
return [vue.createTextVNode("Summary generated using the following sources:"), ' ', vue.createVNode(SourceTags, null, _isSlot(_slot8 = _this15.getAISourceObjects().map(function (el) {
|
|
2347
2362
|
var _slot7;
|
|
2348
2363
|
return vue.createVNode(Button.Button, {
|
|
2349
|
-
"class": "--ai-source-tag " + (getClassName$1(
|
|
2364
|
+
"class": "--ai-source-tag " + (getClassName$1(_this15.$props.innerClass, 'ai-source-tag') || ''),
|
|
2350
2365
|
"info": true,
|
|
2351
2366
|
"onClick": function onClick() {
|
|
2352
2367
|
return onSourceClick && onSourceClick(el);
|
|
@@ -2365,7 +2380,7 @@ var SearchBox = vue.defineComponent({
|
|
|
2365
2380
|
}) : null;
|
|
2366
2381
|
},
|
|
2367
2382
|
renderAIScreen: function renderAIScreen() {
|
|
2368
|
-
var
|
|
2383
|
+
var _this16 = this;
|
|
2369
2384
|
var customAIRenderer = this.$props.renderAIAnswer || this.$slots.renderAIAnswer;
|
|
2370
2385
|
if (customAIRenderer) {
|
|
2371
2386
|
return customAIRenderer({
|
|
@@ -2389,11 +2404,11 @@ var SearchBox = vue.defineComponent({
|
|
|
2389
2404
|
"hideUI": this.isAIResponseLoading || this.isLoading || !this.sessionIdFromStore,
|
|
2390
2405
|
"key": this.sessionIdFromStore,
|
|
2391
2406
|
"onFeedbackSubmit": function onFeedbackSubmit(useful, reason) {
|
|
2392
|
-
|
|
2407
|
+
_this16.feedbackState = {
|
|
2393
2408
|
isRecorded: true,
|
|
2394
2409
|
feedbackType: useful ? 'positive' : 'negative'
|
|
2395
2410
|
};
|
|
2396
|
-
|
|
2411
|
+
_this16.recordAISessionUsefulness(_this16.sessionIdFromStore, {
|
|
2397
2412
|
useful: useful,
|
|
2398
2413
|
reason: reason
|
|
2399
2414
|
});
|
|
@@ -2428,7 +2443,7 @@ var SearchBox = vue.defineComponent({
|
|
|
2428
2443
|
});
|
|
2429
2444
|
},
|
|
2430
2445
|
renderAskButtonElement: function renderAskButtonElement() {
|
|
2431
|
-
var
|
|
2446
|
+
var _this17 = this;
|
|
2432
2447
|
var _this$$props5 = this.$props,
|
|
2433
2448
|
AIUIConfig = _this$$props5.AIUIConfig,
|
|
2434
2449
|
innerClass = _this$$props5.innerClass;
|
|
@@ -2438,12 +2453,12 @@ var SearchBox = vue.defineComponent({
|
|
|
2438
2453
|
if (askButton) {
|
|
2439
2454
|
var getEnterButtonMarkup = function getEnterButtonMarkup() {
|
|
2440
2455
|
if (renderAskButton) {
|
|
2441
|
-
return renderAskButton(
|
|
2456
|
+
return renderAskButton(_this17.askButtonOnClick);
|
|
2442
2457
|
}
|
|
2443
2458
|
return vue.createVNode(Button.Button, {
|
|
2444
2459
|
"class": "enter-btn " + getClassName$1(innerClass, 'ask-button'),
|
|
2445
2460
|
"info": true,
|
|
2446
|
-
"onClick":
|
|
2461
|
+
"onClick": _this17.askButtonOnClick
|
|
2447
2462
|
}, {
|
|
2448
2463
|
"default": function _default() {
|
|
2449
2464
|
return [vue.createTextVNode("Ask")];
|
|
@@ -2458,28 +2473,28 @@ var SearchBox = vue.defineComponent({
|
|
|
2458
2473
|
}
|
|
2459
2474
|
},
|
|
2460
2475
|
render: function render() {
|
|
2461
|
-
var
|
|
2476
|
+
var _this18 = this;
|
|
2462
2477
|
var expandSuggestionsContainer = this.$props.expandSuggestionsContainer;
|
|
2463
2478
|
var _this$$slots = this.$slots,
|
|
2464
2479
|
recentSearchesIcon = _this$$slots.recentSearchesIcon,
|
|
2465
2480
|
popularSearchesIcon = _this$$slots.popularSearchesIcon;
|
|
2466
|
-
var hasSuggestions = Array.isArray(this.
|
|
2481
|
+
var hasSuggestions = Array.isArray(this.parsedSuggestions) && this.parsedSuggestions.length;
|
|
2467
2482
|
var renderItem = this.$slots.renderItem || this.$props.renderItem;
|
|
2468
2483
|
return vue.createVNode(Container.Container, {
|
|
2469
2484
|
"class": this.$props.className
|
|
2470
2485
|
}, {
|
|
2471
2486
|
"default": function _default() {
|
|
2472
|
-
return [
|
|
2473
|
-
"class": getClassName$1(
|
|
2487
|
+
return [_this18.$props.title && vue.createVNode(Title.Title, {
|
|
2488
|
+
"class": getClassName$1(_this18.$props.innerClass, 'title') || ''
|
|
2474
2489
|
}, {
|
|
2475
2490
|
"default": function _default() {
|
|
2476
|
-
return [
|
|
2491
|
+
return [_this18.$props.title];
|
|
2477
2492
|
}
|
|
2478
|
-
}),
|
|
2479
|
-
"id":
|
|
2480
|
-
"handleChange":
|
|
2481
|
-
"handleMouseup":
|
|
2482
|
-
"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
|
|
2483
2498
|
}, {
|
|
2484
2499
|
"default": function _default(_ref8) {
|
|
2485
2500
|
var getInputEvents = _ref8.getInputEvents,
|
|
@@ -2535,21 +2550,21 @@ var SearchBox = vue.defineComponent({
|
|
|
2535
2550
|
}
|
|
2536
2551
|
};
|
|
2537
2552
|
var indexOffset = 0;
|
|
2538
|
-
return vue.createVNode("div", null, [
|
|
2553
|
+
return vue.createVNode("div", null, [_this18.hasCustomRenderer && _this18.getComponent({
|
|
2539
2554
|
isOpen: isOpen,
|
|
2540
2555
|
getItemProps: getItemProps,
|
|
2541
2556
|
getItemEvents: getItemEvents,
|
|
2542
2557
|
highlightedIndex: highlightedIndex
|
|
2543
|
-
}),
|
|
2544
|
-
"class": Input.suggestions(
|
|
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",
|
|
2545
2560
|
"ref": _dropdownULRef
|
|
2546
|
-
}, [
|
|
2547
|
-
"themePreset":
|
|
2561
|
+
}, [_this18.showAIScreen && vue.createVNode(SearchBoxAISection, {
|
|
2562
|
+
"themePreset": _this18.$props.themePreset
|
|
2548
2563
|
}, {
|
|
2549
2564
|
"default": function _default() {
|
|
2550
|
-
return [
|
|
2565
|
+
return [_this18.renderAIScreen(), ' ', _this18.renderErrorComponent(true)];
|
|
2551
2566
|
}
|
|
2552
|
-
}), !
|
|
2567
|
+
}), !_this18.showAIScreen && _this18.parsedSuggestions.map(function (item, itemIndex) {
|
|
2553
2568
|
var index = indexOffset + itemIndex;
|
|
2554
2569
|
if (Array.isArray(item)) {
|
|
2555
2570
|
var sectionHtml = xss(item[0].sectionLabel);
|
|
@@ -2558,7 +2573,7 @@ var SearchBox = vue.defineComponent({
|
|
|
2558
2573
|
"key": "section-" + itemIndex,
|
|
2559
2574
|
"class": "section-container"
|
|
2560
2575
|
}, [sectionHtml ? vue.createVNode("div", {
|
|
2561
|
-
"class": "section-header " + getClassName$1(
|
|
2576
|
+
"class": "section-header " + getClassName$1(_this18.$props.innerClass, 'section-label'),
|
|
2562
2577
|
"key": "" + item[0].sectionId,
|
|
2563
2578
|
"innerHTML": sectionHtml
|
|
2564
2579
|
}, null) : null, vue.createVNode("ul", {
|
|
@@ -2578,7 +2593,7 @@ var SearchBox = vue.defineComponent({
|
|
|
2578
2593
|
justifyContent: 'flex-start',
|
|
2579
2594
|
alignItems: 'center'
|
|
2580
2595
|
},
|
|
2581
|
-
"class": "" + (highlightedIndex === index + sectionIndex ? "active-li-item " + getClassName$1(
|
|
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'))
|
|
2582
2597
|
}), [renderItem(sectionItem)]);
|
|
2583
2598
|
}
|
|
2584
2599
|
if (sectionItem._suggestion_type === '_internal_a_i_trigger') {
|
|
@@ -2592,9 +2607,9 @@ var SearchBox = vue.defineComponent({
|
|
|
2592
2607
|
justifyContent: 'flex-start',
|
|
2593
2608
|
alignItems: 'center'
|
|
2594
2609
|
},
|
|
2595
|
-
"class": "" + (highlightedIndex === index + sectionIndex ? "active-li-item " + getClassName$1(
|
|
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'))
|
|
2596
2611
|
}), [vue.createVNode(SuggestionItem, {
|
|
2597
|
-
"currentValue":
|
|
2612
|
+
"currentValue": _this18.currentValue,
|
|
2598
2613
|
"suggestion": sectionItem
|
|
2599
2614
|
}, null)]);
|
|
2600
2615
|
}
|
|
@@ -2608,7 +2623,7 @@ var SearchBox = vue.defineComponent({
|
|
|
2608
2623
|
justifyContent: 'flex-start',
|
|
2609
2624
|
alignItems: 'center'
|
|
2610
2625
|
},
|
|
2611
|
-
"class": "" + (highlightedIndex === index + sectionIndex ? "active-li-item " + getClassName$1(
|
|
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'))
|
|
2612
2627
|
}), [vue.createVNode("div", {
|
|
2613
2628
|
"style": {
|
|
2614
2629
|
padding: '0 10px 0 0',
|
|
@@ -2616,74 +2631,74 @@ var SearchBox = vue.defineComponent({
|
|
|
2616
2631
|
}
|
|
2617
2632
|
}, [vue.createVNode(CustomSvg, {
|
|
2618
2633
|
"key": sectionItem._suggestion_type + "-" + sectionIndex,
|
|
2619
|
-
"className": getClassName$1(
|
|
2634
|
+
"className": getClassName$1(_this18.$props.innerClass, sectionItem._suggestion_type + "-search-icon") || null,
|
|
2620
2635
|
"icon": getIcon(sectionItem._suggestion_type, sectionItem, suggestionsHaveIcon),
|
|
2621
2636
|
"type": sectionItem._suggestion_type + "-search-icon"
|
|
2622
2637
|
}, null)]), vue.createVNode(SuggestionItem, {
|
|
2623
|
-
"currentValue":
|
|
2638
|
+
"currentValue": _this18.currentValue,
|
|
2624
2639
|
"suggestion": sectionItem
|
|
2625
|
-
}, null),
|
|
2640
|
+
}, null), _this18.renderActionIcon(sectionItem)]);
|
|
2626
2641
|
})])]);
|
|
2627
2642
|
}
|
|
2628
2643
|
return vue.createVNode("div", null, [vue.createTextVNode("No suggestions")]);
|
|
2629
|
-
}), !
|
|
2644
|
+
}), !_this18.showAIScreen && _this18.parsedSuggestions.length && _this18.$props.showSuggestionsFooter ? _this18.suggestionsFooter() : null]) : _this18.renderNoSuggestions(_this18.normalizedSuggestions)]);
|
|
2630
2645
|
};
|
|
2631
2646
|
return vue.createVNode("div", {
|
|
2632
2647
|
"class": Input.suggestionsContainer
|
|
2633
2648
|
}, [vue.createVNode(InputGroup, {
|
|
2634
2649
|
"searchBox": true,
|
|
2635
2650
|
"ref": _inputGroupRef,
|
|
2636
|
-
"isOpen":
|
|
2651
|
+
"isOpen": _this18.$data.isOpen
|
|
2637
2652
|
}, {
|
|
2638
2653
|
"default": function _default() {
|
|
2639
2654
|
return [vue.createVNode(Input.Actions, null, {
|
|
2640
2655
|
"default": function _default() {
|
|
2641
|
-
return [
|
|
2656
|
+
return [_this18.renderInputAddonBefore(), _this18.renderLeftIcons()];
|
|
2642
2657
|
}
|
|
2643
2658
|
}), vue.createVNode(DropDown.InputWrapper, null, {
|
|
2644
2659
|
"default": function _default() {
|
|
2645
2660
|
return [vue.createVNode(Input.TextArea, vue.mergeProps(_transformOn(getInputEvents({
|
|
2646
|
-
onInput:
|
|
2661
|
+
onInput: _this18.onInputChange,
|
|
2647
2662
|
onBlur: function onBlur(e) {
|
|
2648
|
-
|
|
2663
|
+
_this18.$emit('blur', e, _this18.triggerQuery);
|
|
2649
2664
|
},
|
|
2650
|
-
onFocus:
|
|
2665
|
+
onFocus: _this18.handleFocus,
|
|
2651
2666
|
onKeyPress: function onKeyPress(e) {
|
|
2652
|
-
|
|
2653
|
-
|
|
2667
|
+
_this18.$emit('keyPress', e, _this18.triggerQuery);
|
|
2668
|
+
_this18.$emit('key-press', e, _this18.triggerQuery);
|
|
2654
2669
|
},
|
|
2655
2670
|
onKeyDown: function onKeyDown(e) {
|
|
2656
|
-
return
|
|
2671
|
+
return _this18.handleKeyDown(e, highlightedIndex);
|
|
2657
2672
|
},
|
|
2658
2673
|
onKeyUp: function onKeyUp(e) {
|
|
2659
|
-
|
|
2660
|
-
|
|
2674
|
+
_this18.$emit('keyUp', e, _this18.triggerQuery);
|
|
2675
|
+
_this18.$emit('key-up', e, _this18.triggerQuery);
|
|
2661
2676
|
},
|
|
2662
2677
|
onClick: function onClick() {
|
|
2663
2678
|
setHighlightedIndex(null);
|
|
2664
2679
|
}
|
|
2665
2680
|
})), {
|
|
2666
2681
|
"searchBox": true,
|
|
2667
|
-
"isOpen":
|
|
2668
|
-
"id":
|
|
2669
|
-
"ref":
|
|
2670
|
-
"class": getClassName$1(
|
|
2671
|
-
"placeholder":
|
|
2672
|
-
"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
|
|
2673
2688
|
}, getInputProps({
|
|
2674
|
-
value:
|
|
2689
|
+
value: _this18.$data.currentValue === null ? '' : _this18.$data.currentValue
|
|
2675
2690
|
}), {
|
|
2676
|
-
"themePreset":
|
|
2691
|
+
"themePreset": _this18.themePreset,
|
|
2677
2692
|
"autocomplete": "off"
|
|
2678
2693
|
}), null), !expandSuggestionsContainer && renderSuggestionsDropdown()];
|
|
2679
2694
|
}
|
|
2680
2695
|
}), vue.createVNode(Input.Actions, null, {
|
|
2681
2696
|
"default": function _default() {
|
|
2682
|
-
return [
|
|
2697
|
+
return [_this18.renderRightIcons(), _this18.renderInputAddonAfter(), _this18.renderAskButtonElement(), _this18.renderEnterButtonElement()];
|
|
2683
2698
|
}
|
|
2684
2699
|
})];
|
|
2685
2700
|
}
|
|
2686
|
-
}), expandSuggestionsContainer && renderSuggestionsDropdown(),
|
|
2701
|
+
}), expandSuggestionsContainer && renderSuggestionsDropdown(), _this18.renderTags()]);
|
|
2687
2702
|
}
|
|
2688
2703
|
}) : vue.createVNode("div", {
|
|
2689
2704
|
"class": Input.suggestionsContainer
|
|
@@ -2694,43 +2709,43 @@ var SearchBox = vue.defineComponent({
|
|
|
2694
2709
|
"default": function _default() {
|
|
2695
2710
|
return [vue.createVNode(Input.Actions, null, {
|
|
2696
2711
|
"default": function _default() {
|
|
2697
|
-
return [
|
|
2712
|
+
return [_this18.renderInputAddonBefore(), _this18.renderLeftIcons()];
|
|
2698
2713
|
}
|
|
2699
2714
|
}), vue.createVNode(DropDown.InputWrapper, null, {
|
|
2700
2715
|
"default": function _default() {
|
|
2701
2716
|
return [vue.createVNode(Input.TextArea, vue.mergeProps(_transformOn({
|
|
2702
2717
|
blur: function blur(e) {
|
|
2703
|
-
|
|
2718
|
+
_this18.$emit('blur', e, _this18.triggerQuery);
|
|
2704
2719
|
},
|
|
2705
2720
|
keypress: function keypress(e) {
|
|
2706
|
-
|
|
2707
|
-
|
|
2721
|
+
_this18.$emit('keyPress', e, _this18.triggerQuery);
|
|
2722
|
+
_this18.$emit('key-press', e, _this18.triggerQuery);
|
|
2708
2723
|
},
|
|
2709
|
-
input:
|
|
2724
|
+
input: _this18.onInputChange,
|
|
2710
2725
|
focus: function focus(e) {
|
|
2711
|
-
|
|
2726
|
+
_this18.$emit('focus', e, _this18.triggerQuery);
|
|
2712
2727
|
},
|
|
2713
|
-
keydown:
|
|
2728
|
+
keydown: _this18.handleKeyDown,
|
|
2714
2729
|
keyup: function keyup(e) {
|
|
2715
|
-
|
|
2716
|
-
|
|
2730
|
+
_this18.$emit('keyUp', e, _this18.triggerQuery);
|
|
2731
|
+
_this18.$emit('key-up', e, _this18.triggerQuery);
|
|
2717
2732
|
}
|
|
2718
2733
|
}), {
|
|
2719
2734
|
"searchBox": true,
|
|
2720
|
-
"class": getClassName$1(
|
|
2721
|
-
"placeholder":
|
|
2722
|
-
"autofocus":
|
|
2723
|
-
"value":
|
|
2724
|
-
"iconPosition":
|
|
2725
|
-
"showIcon":
|
|
2726
|
-
"showClear":
|
|
2727
|
-
"ref":
|
|
2728
|
-
"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
|
|
2729
2744
|
}), null)];
|
|
2730
2745
|
}
|
|
2731
2746
|
}), vue.createVNode(Input.Actions, null, {
|
|
2732
2747
|
"default": function _default() {
|
|
2733
|
-
return [
|
|
2748
|
+
return [_this18.renderRightIcons(), _this18.renderInputAddonAfter(), _this18.renderEnterButtonElement()];
|
|
2734
2749
|
}
|
|
2735
2750
|
})];
|
|
2736
2751
|
}
|
|
@@ -2949,7 +2964,10 @@ var AIAnswer = vue.defineComponent({
|
|
|
2949
2964
|
if (messagesHistory && Array.isArray(messagesHistory)) {
|
|
2950
2965
|
finalMessages.push.apply(finalMessages, messagesHistory.filter(function (msg) {
|
|
2951
2966
|
return msg.role !== constants.AI_ROLES.SYSTEM;
|
|
2952
|
-
})
|
|
2967
|
+
}));
|
|
2968
|
+
if (finalMessages[0].role === constants.AI_ROLES.USER) {
|
|
2969
|
+
finalMessages.shift();
|
|
2970
|
+
}
|
|
2953
2971
|
} else if (response && response.answer && response.answer.text) {
|
|
2954
2972
|
finalMessages.push({
|
|
2955
2973
|
role: constants.AI_ROLES.ASSISTANT,
|