@appbaseio/reactivesearch-vue 3.0.6 → 3.1.0-alpha.1
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 +297 -186
- package/dist/@appbaseio/reactivesearch-vue.umd.js.map +1 -1
- package/dist/@appbaseio/reactivesearch-vue.umd.min.js +4 -4
- package/dist/@appbaseio/reactivesearch-vue.umd.min.js.map +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/{install-435992f3.js → install-05fcf590.js} +237 -153
- package/dist/cjs/install.js +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/components/search/SearchBox.d.ts +4 -0
- package/dist/es/index.js +2 -2
- package/dist/es/{install-df2e75f3.js → install-2b5814e0.js} +237 -153
- package/dist/es/install.js +1 -1
- package/dist/es/version.js +1 -1
- package/dist/types.ts +12 -0
- package/package.json +91 -92
|
@@ -101,7 +101,30 @@ var SuggestionItem = {
|
|
|
101
101
|
name: 'SuggestionItem',
|
|
102
102
|
props: {
|
|
103
103
|
currentValue: vueTypes.types.string,
|
|
104
|
-
suggestion: vueTypes.types.any
|
|
104
|
+
suggestion: vueTypes.types.any,
|
|
105
|
+
innerHTML: vueTypes.types.string.isRequired
|
|
106
|
+
},
|
|
107
|
+
data: function data() {
|
|
108
|
+
return {
|
|
109
|
+
isOverflowing: false
|
|
110
|
+
};
|
|
111
|
+
},
|
|
112
|
+
methods: {
|
|
113
|
+
updateOverflowing: function updateOverflowing() {
|
|
114
|
+
if (this.$refs.container && this.$refs.content) {
|
|
115
|
+
var _this$$refs = this.$refs,
|
|
116
|
+
container = _this$$refs.container,
|
|
117
|
+
content = _this$$refs.content;
|
|
118
|
+
var containerWidth = container.offsetWidth;
|
|
119
|
+
var contentWidth = content.scrollWidth;
|
|
120
|
+
this.isOverflowing = contentWidth > containerWidth;
|
|
121
|
+
} else {
|
|
122
|
+
this.isOverflowing = false;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
mounted: function mounted() {
|
|
127
|
+
this.updateOverflowing();
|
|
105
128
|
},
|
|
106
129
|
render: function render() {
|
|
107
130
|
var _this = this;
|
|
@@ -117,7 +140,11 @@ var SuggestionItem = {
|
|
|
117
140
|
if (label) {
|
|
118
141
|
// label has highest precedence
|
|
119
142
|
return typeof label === 'string' ? vue.createVNode("div", {
|
|
120
|
-
"
|
|
143
|
+
"ref": "container",
|
|
144
|
+
"class": "trim",
|
|
145
|
+
"title": this.isOverflowing ? label : ''
|
|
146
|
+
}, [vue.createVNode("div", {
|
|
147
|
+
"ref": "content"
|
|
121
148
|
}, [(_category ? false : isPredictiveSuggestion
|
|
122
149
|
// eslint-disable-next-line
|
|
123
150
|
|| !!_suggestion_type) ? vue.createVNode(PredictiveSuggestion, {
|
|
@@ -127,7 +154,7 @@ var SuggestionItem = {
|
|
|
127
154
|
"textToHighlight": label,
|
|
128
155
|
"autoEscape": true,
|
|
129
156
|
"highlightStyle": highlightStyle
|
|
130
|
-
}, null)]) : label;
|
|
157
|
+
}, null)])]) : label;
|
|
131
158
|
}
|
|
132
159
|
if (title || image || description) {
|
|
133
160
|
return vue.createVNode(Flex.Flex, {
|
|
@@ -1078,6 +1105,42 @@ var AIFeedback = vue.defineComponent({
|
|
|
1078
1105
|
}
|
|
1079
1106
|
});
|
|
1080
1107
|
|
|
1108
|
+
// eslint-disable-next-line import/prefer-default-export
|
|
1109
|
+
var innerText = function innerText(jsx) {
|
|
1110
|
+
// Empty
|
|
1111
|
+
if (jsx === null || typeof jsx === 'boolean' || typeof jsx === 'undefined') {
|
|
1112
|
+
return '';
|
|
1113
|
+
}
|
|
1114
|
+
|
|
1115
|
+
// Numeric children.
|
|
1116
|
+
if (typeof jsx === 'number') {
|
|
1117
|
+
return jsx.toString();
|
|
1118
|
+
}
|
|
1119
|
+
|
|
1120
|
+
// String literals.
|
|
1121
|
+
if (typeof jsx === 'string') {
|
|
1122
|
+
return jsx;
|
|
1123
|
+
}
|
|
1124
|
+
|
|
1125
|
+
// Array of JSX.
|
|
1126
|
+
if (Array.isArray(jsx)) {
|
|
1127
|
+
// eslint-disable-next-line no-use-before-define
|
|
1128
|
+
return jsx.reduce(reduceJsxToString, '');
|
|
1129
|
+
}
|
|
1130
|
+
|
|
1131
|
+
// Children prop.
|
|
1132
|
+
if (Object.prototype.hasOwnProperty.call(jsx, 'children')) {
|
|
1133
|
+
return innerText(jsx.children);
|
|
1134
|
+
}
|
|
1135
|
+
|
|
1136
|
+
// Default
|
|
1137
|
+
return '';
|
|
1138
|
+
};
|
|
1139
|
+
innerText["default"] = innerText;
|
|
1140
|
+
function reduceJsxToString(previous, current) {
|
|
1141
|
+
return previous + innerText(current);
|
|
1142
|
+
}
|
|
1143
|
+
|
|
1081
1144
|
var _excluded = ["_source"];
|
|
1082
1145
|
function _isSlot(s) {
|
|
1083
1146
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
|
|
@@ -1171,6 +1234,7 @@ var SearchBox = vue.defineComponent({
|
|
|
1171
1234
|
return this.faqAnswer || this.AIResponse && this.AIResponse.response && this.AIResponse.response.answer && this.AIResponse.response.answer.text;
|
|
1172
1235
|
},
|
|
1173
1236
|
parsedSuggestions: function parsedSuggestions() {
|
|
1237
|
+
var _this = this;
|
|
1174
1238
|
var suggestionsArray = [];
|
|
1175
1239
|
if (Array.isArray(this.suggestions) && this.suggestions.length) {
|
|
1176
1240
|
suggestionsArray = [].concat(withClickIds(this.suggestions));
|
|
@@ -1189,6 +1253,20 @@ var SearchBox = vue.defineComponent({
|
|
|
1189
1253
|
return _rollupPluginBabelHelpers._extends({}, s, {
|
|
1190
1254
|
sectionId: s._suggestion_type
|
|
1191
1255
|
});
|
|
1256
|
+
}).map(function (suggestion) {
|
|
1257
|
+
if (suggestion._suggestion_type === 'document') {
|
|
1258
|
+
// Document suggestions don't have a meaningful label and value
|
|
1259
|
+
var newSuggestion = _rollupPluginBabelHelpers._extends({}, suggestion);
|
|
1260
|
+
newSuggestion.label = 'For recent document suggestion, please implement a renderItem method to display label.';
|
|
1261
|
+
var renderItem = _this.$slots.renderItem || _this.$props.renderItem;
|
|
1262
|
+
if (typeof renderItem === 'function') {
|
|
1263
|
+
var jsxEl = renderItem(newSuggestion);
|
|
1264
|
+
var innerValue = innerText(jsxEl);
|
|
1265
|
+
newSuggestion.value = xss(innerValue);
|
|
1266
|
+
}
|
|
1267
|
+
return newSuggestion;
|
|
1268
|
+
}
|
|
1269
|
+
return suggestion;
|
|
1192
1270
|
});
|
|
1193
1271
|
var sectionsAccumulated = [];
|
|
1194
1272
|
var sectionisedSuggestions = suggestionsArray.reduce(function (acc, d, currentIndex) {
|
|
@@ -1237,6 +1315,12 @@ var SearchBox = vue.defineComponent({
|
|
|
1237
1315
|
enablePopularSuggestions: VueTypes.bool.def(false),
|
|
1238
1316
|
enableRecentSuggestions: VueTypes.bool.def(false),
|
|
1239
1317
|
enableFAQSuggestions: VueTypes.bool.def(false),
|
|
1318
|
+
enableDocumentSuggestions: VueTypes.bool.def(false),
|
|
1319
|
+
documentSuggestionsConfig: VueTypes.shape({
|
|
1320
|
+
size: VueTypes.number,
|
|
1321
|
+
from: VueTypes.number,
|
|
1322
|
+
maxChars: VueTypes.number
|
|
1323
|
+
}),
|
|
1240
1324
|
FAQSuggestionsConfig: VueTypes.shape({
|
|
1241
1325
|
sectionLabel: VueTypes.string,
|
|
1242
1326
|
size: VueTypes.number
|
|
@@ -1305,20 +1389,20 @@ var SearchBox = vue.defineComponent({
|
|
|
1305
1389
|
AIUIConfig: vueTypes.types.AIUIConfig
|
|
1306
1390
|
},
|
|
1307
1391
|
mounted: function mounted() {
|
|
1308
|
-
var
|
|
1392
|
+
var _this2 = this;
|
|
1309
1393
|
this.listenForFocusShortcuts();
|
|
1310
1394
|
var dropdownEle = this.$refs[_dropdownULRef];
|
|
1311
1395
|
if (dropdownEle) {
|
|
1312
1396
|
var handleScroll = function handleScroll() {
|
|
1313
1397
|
var scrollTop = dropdownEle.scrollTop;
|
|
1314
|
-
|
|
1315
|
-
if (scrollTop <
|
|
1398
|
+
_this2.lastScrollTop = scrollTop;
|
|
1399
|
+
if (scrollTop < _this2.lastScrollTop) {
|
|
1316
1400
|
// User is scrolling up
|
|
1317
|
-
clearInterval(
|
|
1318
|
-
|
|
1401
|
+
clearInterval(_this2.scrollTimerRef);
|
|
1402
|
+
_this2.isUserScrolling = true;
|
|
1319
1403
|
}
|
|
1320
1404
|
// Update lastScrollTop with the current scroll position
|
|
1321
|
-
|
|
1405
|
+
_this2.lastScrollTop = scrollTop;
|
|
1322
1406
|
};
|
|
1323
1407
|
dropdownEle.addEventListener('scroll', handleScroll);
|
|
1324
1408
|
}
|
|
@@ -1457,10 +1541,10 @@ var SearchBox = vue.defineComponent({
|
|
|
1457
1541
|
}
|
|
1458
1542
|
},
|
|
1459
1543
|
isAITyping: function isAITyping(newVal, oldVal) {
|
|
1460
|
-
var
|
|
1544
|
+
var _this3 = this;
|
|
1461
1545
|
var scrollAIContainer = function scrollAIContainer() {
|
|
1462
|
-
if (
|
|
1463
|
-
var dropdownEle =
|
|
1546
|
+
if (_this3.isUserScrolling) return;
|
|
1547
|
+
var dropdownEle = _this3.$refs[_dropdownULRef];
|
|
1464
1548
|
if (dropdownEle) {
|
|
1465
1549
|
dropdownEle.scrollTo({
|
|
1466
1550
|
top: dropdownEle.scrollHeight,
|
|
@@ -1570,7 +1654,7 @@ var SearchBox = vue.defineComponent({
|
|
|
1570
1654
|
}
|
|
1571
1655
|
},
|
|
1572
1656
|
setValue: function setValue(value, isDefaultValue, props, cause, toggleIsOpen, categoryValue, shouldExecuteQuery) {
|
|
1573
|
-
var
|
|
1657
|
+
var _this4 = this;
|
|
1574
1658
|
if (isDefaultValue === void 0) {
|
|
1575
1659
|
isDefaultValue = false;
|
|
1576
1660
|
}
|
|
@@ -1587,65 +1671,65 @@ var SearchBox = vue.defineComponent({
|
|
|
1587
1671
|
shouldExecuteQuery = true;
|
|
1588
1672
|
}
|
|
1589
1673
|
var performUpdate = function performUpdate() {
|
|
1590
|
-
if (
|
|
1674
|
+
if (_this4.$options.isTagsMode && isEqual(value, _this4.selectedTags)) {
|
|
1591
1675
|
return;
|
|
1592
1676
|
}
|
|
1593
|
-
if (
|
|
1594
|
-
if (Array.isArray(
|
|
1677
|
+
if (_this4.$options.isTagsMode && cause === reactivecore.causes.SUGGESTION_SELECT) {
|
|
1678
|
+
if (Array.isArray(_this4.selectedTags) && _this4.selectedTags.length) {
|
|
1595
1679
|
// check if value already present in selectedTags
|
|
1596
|
-
if (typeof value === 'string' &&
|
|
1597
|
-
|
|
1680
|
+
if (typeof value === 'string' && _this4.selectedTags.includes(value)) {
|
|
1681
|
+
_this4.isOpen = false;
|
|
1598
1682
|
return;
|
|
1599
1683
|
}
|
|
1600
|
-
|
|
1684
|
+
_this4.selectedTags = [].concat(_this4.selectedTags);
|
|
1601
1685
|
if (typeof value === 'string' && !!value) {
|
|
1602
|
-
|
|
1603
|
-
} else if (Array.isArray(value) && !isEqual(
|
|
1604
|
-
|
|
1686
|
+
_this4.selectedTags.push(value);
|
|
1687
|
+
} else if (Array.isArray(value) && !isEqual(_this4.selectedTags, value)) {
|
|
1688
|
+
_this4.selectedTags = value;
|
|
1605
1689
|
}
|
|
1606
1690
|
} else if (value) {
|
|
1607
|
-
|
|
1691
|
+
_this4.selectedTags = typeof value !== 'string' ? value : [].concat(value);
|
|
1608
1692
|
}
|
|
1609
|
-
|
|
1693
|
+
_this4.currentValue = '';
|
|
1610
1694
|
} else {
|
|
1611
|
-
|
|
1695
|
+
_this4.currentValue = index.decodeHtml(value);
|
|
1612
1696
|
}
|
|
1613
1697
|
var queryHandlerValue = value;
|
|
1614
|
-
if (
|
|
1615
|
-
queryHandlerValue = Array.isArray(
|
|
1698
|
+
if (_this4.$options.isTagsMode && cause === reactivecore.causes.SUGGESTION_SELECT) {
|
|
1699
|
+
queryHandlerValue = Array.isArray(_this4.selectedTags) && _this4.selectedTags.length ? _this4.selectedTags : undefined;
|
|
1616
1700
|
}
|
|
1617
|
-
if ((
|
|
1701
|
+
if ((_this4.faqAnswer || _this4.faqQuestion) && value === '') {
|
|
1618
1702
|
// Empty the previous state
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1703
|
+
_this4.faqAnswer = '';
|
|
1704
|
+
_this4.faqQuestion = '';
|
|
1705
|
+
_this4.showAIScreen = false;
|
|
1622
1706
|
}
|
|
1623
1707
|
if (isDefaultValue) {
|
|
1624
|
-
if (
|
|
1708
|
+
if (_this4.$props.autosuggest) {
|
|
1625
1709
|
if (toggleIsOpen) {
|
|
1626
|
-
|
|
1710
|
+
_this4.isOpen = false;
|
|
1627
1711
|
}
|
|
1628
|
-
if (typeof
|
|
1712
|
+
if (typeof _this4.currentValue === 'string') _this4.triggerDefaultQuery(_this4.currentValue, props.enableAI && _this4.currentTriggerMode === constants.AI_TRIGGER_MODES.QUESTION && _this4.currentValue.endsWith('?') ? {
|
|
1629
1713
|
enableAI: true
|
|
1630
1714
|
} : {}, shouldExecuteQuery);
|
|
1631
1715
|
} // in case of strict selection only SUGGESTION_SELECT should be able
|
|
1632
1716
|
// to set the query otherwise the value should reset
|
|
1633
1717
|
if (props.strictSelection) {
|
|
1634
|
-
if (cause === reactivecore.causes.SUGGESTION_SELECT || (
|
|
1635
|
-
|
|
1718
|
+
if (cause === reactivecore.causes.SUGGESTION_SELECT || (_this4.$options.isTagsMode ? _this4.selectedTags.length === 0 : value === '')) {
|
|
1719
|
+
_this4.triggerCustomQuery(queryHandlerValue, _this4.$options.isTagsMode ? undefined : categoryValue, shouldExecuteQuery);
|
|
1636
1720
|
} else {
|
|
1637
|
-
|
|
1721
|
+
_this4.setValue('', true);
|
|
1638
1722
|
}
|
|
1639
1723
|
} else if (props.value === undefined || cause === reactivecore.causes.SUGGESTION_SELECT || cause === reactivecore.causes.CLEAR_VALUE) {
|
|
1640
|
-
|
|
1641
|
-
|
|
1724
|
+
_this4.showAIScreen = false;
|
|
1725
|
+
_this4.triggerCustomQuery(queryHandlerValue, _this4.$options.isTagsMode ? undefined : categoryValue, shouldExecuteQuery);
|
|
1642
1726
|
}
|
|
1643
1727
|
} else {
|
|
1644
1728
|
// debounce for handling text while typing
|
|
1645
|
-
|
|
1729
|
+
_this4.handleTextChange(value, cause);
|
|
1646
1730
|
}
|
|
1647
|
-
|
|
1648
|
-
|
|
1731
|
+
_this4.$emit('valueChange', value);
|
|
1732
|
+
_this4.$emit('value-change', value);
|
|
1649
1733
|
};
|
|
1650
1734
|
checkValueChange(props.componentId, value, props.beforeValueChange, performUpdate);
|
|
1651
1735
|
},
|
|
@@ -1794,7 +1878,7 @@ var SearchBox = vue.defineComponent({
|
|
|
1794
1878
|
this.$emit('key-down', event, this.triggerQuery);
|
|
1795
1879
|
},
|
|
1796
1880
|
onInputChange: function onInputChange(e) {
|
|
1797
|
-
var
|
|
1881
|
+
var _this5 = this;
|
|
1798
1882
|
var inputValue = e.target.value;
|
|
1799
1883
|
if (!this.$data.isOpen && this.$props.autosuggest) {
|
|
1800
1884
|
this.isOpen = true;
|
|
@@ -1808,7 +1892,7 @@ var SearchBox = vue.defineComponent({
|
|
|
1808
1892
|
} else {
|
|
1809
1893
|
this.$emit('change', inputValue, function (_ref3) {
|
|
1810
1894
|
var isOpen = _ref3.isOpen;
|
|
1811
|
-
return
|
|
1895
|
+
return _this5.triggerQuery({
|
|
1812
1896
|
defaultQuery: true,
|
|
1813
1897
|
customQuery: true,
|
|
1814
1898
|
value: inputValue,
|
|
@@ -1852,7 +1936,7 @@ var SearchBox = vue.defineComponent({
|
|
|
1852
1936
|
}
|
|
1853
1937
|
},
|
|
1854
1938
|
onSuggestionSelected: function onSuggestionSelected(suggestion) {
|
|
1855
|
-
var
|
|
1939
|
+
var _this6 = this;
|
|
1856
1940
|
var value = this.$props.value;
|
|
1857
1941
|
// The state of the suggestion is open by the time it reaches here. i.e. isOpen = true
|
|
1858
1942
|
// handle when FAQ suggestion is clicked
|
|
@@ -1901,10 +1985,10 @@ var SearchBox = vue.defineComponent({
|
|
|
1901
1985
|
this.setValue(emitValue, true, this.$props, reactivecore.causes.SUGGESTION_SELECT, false, suggestion._category);
|
|
1902
1986
|
this.$emit('change', emitValue, function (_ref4) {
|
|
1903
1987
|
var isOpen = _ref4.isOpen;
|
|
1904
|
-
return
|
|
1988
|
+
return _this6.triggerQuery(_rollupPluginBabelHelpers._extends({
|
|
1905
1989
|
isOpen: isOpen,
|
|
1906
1990
|
value: emitValue
|
|
1907
|
-
}, !
|
|
1991
|
+
}, !_this6.$options.isTagsMode && {
|
|
1908
1992
|
categoryValue: suggestion._category
|
|
1909
1993
|
}));
|
|
1910
1994
|
});
|
|
@@ -1944,7 +2028,7 @@ var SearchBox = vue.defineComponent({
|
|
|
1944
2028
|
return null;
|
|
1945
2029
|
},
|
|
1946
2030
|
renderErrorComponent: function renderErrorComponent(isAIError) {
|
|
1947
|
-
var
|
|
2031
|
+
var _this7 = this;
|
|
1948
2032
|
if (isAIError === void 0) {
|
|
1949
2033
|
isAIError = false;
|
|
1950
2034
|
}
|
|
@@ -1971,7 +2055,7 @@ var SearchBox = vue.defineComponent({
|
|
|
1971
2055
|
"themePreset": this.themePreset
|
|
1972
2056
|
}, {
|
|
1973
2057
|
"default": function _default() {
|
|
1974
|
-
return [index.isFunction(renderError) ? renderError(
|
|
2058
|
+
return [index.isFunction(renderError) ? renderError(_this7.error) : renderError];
|
|
1975
2059
|
}
|
|
1976
2060
|
});
|
|
1977
2061
|
}
|
|
@@ -2051,7 +2135,7 @@ var SearchBox = vue.defineComponent({
|
|
|
2051
2135
|
});
|
|
2052
2136
|
},
|
|
2053
2137
|
renderEnterButtonElement: function renderEnterButtonElement() {
|
|
2054
|
-
var
|
|
2138
|
+
var _this8 = this;
|
|
2055
2139
|
var _this$$props2 = this.$props,
|
|
2056
2140
|
enterButton = _this$$props2.enterButton,
|
|
2057
2141
|
innerClass = _this$$props2.innerClass;
|
|
@@ -2059,12 +2143,12 @@ var SearchBox = vue.defineComponent({
|
|
|
2059
2143
|
if (enterButton) {
|
|
2060
2144
|
var getEnterButtonMarkup = function getEnterButtonMarkup() {
|
|
2061
2145
|
if (renderEnterButton) {
|
|
2062
|
-
return renderEnterButton(
|
|
2146
|
+
return renderEnterButton(_this8.enterButtonOnClick);
|
|
2063
2147
|
}
|
|
2064
2148
|
return vue.createVNode(Button.Button, {
|
|
2065
2149
|
"class": "enter-btn " + getClassName$1(innerClass, 'enter-button'),
|
|
2066
2150
|
"primary": true,
|
|
2067
|
-
"onClick":
|
|
2151
|
+
"onClick": _this8.enterButtonOnClick
|
|
2068
2152
|
}, {
|
|
2069
2153
|
"default": function _default() {
|
|
2070
2154
|
return [vue.createTextVNode("Search")];
|
|
@@ -2090,7 +2174,7 @@ var SearchBox = vue.defineComponent({
|
|
|
2090
2174
|
return '/';
|
|
2091
2175
|
},
|
|
2092
2176
|
renderLeftIcons: function renderLeftIcons() {
|
|
2093
|
-
var
|
|
2177
|
+
var _this9 = this;
|
|
2094
2178
|
var _slot3;
|
|
2095
2179
|
var _this$$props3 = this.$props,
|
|
2096
2180
|
iconPosition = _this$$props3.iconPosition,
|
|
@@ -2100,8 +2184,8 @@ var SearchBox = vue.defineComponent({
|
|
|
2100
2184
|
}, {
|
|
2101
2185
|
"default": function _default() {
|
|
2102
2186
|
return [iconPosition === 'left' && showIcon && vue.createVNode(DropDown.IconWrapper, {
|
|
2103
|
-
"onClick":
|
|
2104
|
-
}, _isSlot(_slot3 =
|
|
2187
|
+
"onClick": _this9.handleSearchIconClick
|
|
2188
|
+
}, _isSlot(_slot3 = _this9.renderIcon()) ? _slot3 : {
|
|
2105
2189
|
"default": function _default() {
|
|
2106
2190
|
return [_slot3];
|
|
2107
2191
|
}
|
|
@@ -2110,7 +2194,7 @@ var SearchBox = vue.defineComponent({
|
|
|
2110
2194
|
})]);
|
|
2111
2195
|
},
|
|
2112
2196
|
renderRightIcons: function renderRightIcons() {
|
|
2113
|
-
var
|
|
2197
|
+
var _this10 = this;
|
|
2114
2198
|
var _slot4, _slot5, _slot6;
|
|
2115
2199
|
var _this$$props4 = this.$props,
|
|
2116
2200
|
iconPosition = _this$$props4.iconPosition,
|
|
@@ -2127,29 +2211,29 @@ var SearchBox = vue.defineComponent({
|
|
|
2127
2211
|
}, {
|
|
2128
2212
|
"default": function _default() {
|
|
2129
2213
|
return [currentValue && showClear && vue.createVNode(DropDown.IconWrapper, {
|
|
2130
|
-
"onClick":
|
|
2214
|
+
"onClick": _this10.clearValue,
|
|
2131
2215
|
"showIcon": showIcon,
|
|
2132
2216
|
"isClearIcon": true
|
|
2133
|
-
}, _isSlot(_slot4 =
|
|
2217
|
+
}, _isSlot(_slot4 = _this10.renderCancelIcon()) ? _slot4 : {
|
|
2134
2218
|
"default": function _default() {
|
|
2135
2219
|
return [_slot4];
|
|
2136
2220
|
}
|
|
2137
2221
|
}), showFocusShortcutsIcon && vue.createVNode(DropDown.ButtonIconWrapper, {
|
|
2138
2222
|
"onClick": function onClick(e) {
|
|
2139
|
-
return
|
|
2223
|
+
return _this10.focusSearchBox(e);
|
|
2140
2224
|
}
|
|
2141
|
-
}, _isSlot(_slot5 =
|
|
2225
|
+
}, _isSlot(_slot5 = _this10.renderShortcut()) ? _slot5 : {
|
|
2142
2226
|
"default": function _default() {
|
|
2143
2227
|
return [_slot5];
|
|
2144
2228
|
}
|
|
2145
2229
|
}), showVoiceSearch && vue.createVNode(Mic, {
|
|
2146
2230
|
"getInstance": getMicInstance,
|
|
2147
2231
|
"render": renderMic,
|
|
2148
|
-
"handleResult":
|
|
2232
|
+
"handleResult": _this10.handleVoiceResults,
|
|
2149
2233
|
"className": getClassName$1(innerClass, 'mic') || null
|
|
2150
2234
|
}, null), iconPosition === 'right' && showIcon && vue.createVNode(DropDown.IconWrapper, {
|
|
2151
|
-
"onClick":
|
|
2152
|
-
}, _isSlot(_slot6 =
|
|
2235
|
+
"onClick": _this10.handleSearchIconClick
|
|
2236
|
+
}, _isSlot(_slot6 = _this10.renderIcon()) ? _slot6 : {
|
|
2153
2237
|
"default": function _default() {
|
|
2154
2238
|
return [_slot6];
|
|
2155
2239
|
}
|
|
@@ -2168,7 +2252,7 @@ var SearchBox = vue.defineComponent({
|
|
|
2168
2252
|
(_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
|
|
2169
2253
|
},
|
|
2170
2254
|
listenForFocusShortcuts: function listenForFocusShortcuts() {
|
|
2171
|
-
var
|
|
2255
|
+
var _this11 = this;
|
|
2172
2256
|
var _this$$props$focusSho = this.$props.focusShortcuts,
|
|
2173
2257
|
focusShortcuts = _this$$props$focusSho === void 0 ? ['/'] : _this$$props$focusSho;
|
|
2174
2258
|
if (index.isEmpty(focusShortcuts)) {
|
|
@@ -2183,7 +2267,7 @@ var SearchBox = vue.defineComponent({
|
|
|
2183
2267
|
function (event, handler) {
|
|
2184
2268
|
// Prevent the default refresh event under WINDOWS system
|
|
2185
2269
|
event.preventDefault();
|
|
2186
|
-
|
|
2270
|
+
_this11.focusSearchBox(event);
|
|
2187
2271
|
});
|
|
2188
2272
|
|
|
2189
2273
|
// if one of modifier keys are used, they are handled below
|
|
@@ -2193,7 +2277,7 @@ var SearchBox = vue.defineComponent({
|
|
|
2193
2277
|
for (var index$1 = 0; index$1 < modifierKeys.length; index$1 += 1) {
|
|
2194
2278
|
var element = modifierKeys[index$1];
|
|
2195
2279
|
if (hotkeys[element]) {
|
|
2196
|
-
|
|
2280
|
+
_this11.focusSearchBox(event);
|
|
2197
2281
|
break;
|
|
2198
2282
|
}
|
|
2199
2283
|
}
|
|
@@ -2206,10 +2290,10 @@ var SearchBox = vue.defineComponent({
|
|
|
2206
2290
|
this.triggerDefaultQuery(value);
|
|
2207
2291
|
},
|
|
2208
2292
|
renderActionIcon: function renderActionIcon(suggestion) {
|
|
2209
|
-
var
|
|
2293
|
+
var _this12 = this;
|
|
2210
2294
|
var handleAutoFillClick = function handleAutoFillClick(e) {
|
|
2211
2295
|
e.stopPropagation();
|
|
2212
|
-
|
|
2296
|
+
_this12.onAutofillClick(suggestion);
|
|
2213
2297
|
};
|
|
2214
2298
|
if (suggestion._suggestion_type === helper.suggestionTypes.Featured) {
|
|
2215
2299
|
if (suggestion.action === helper.featuredSuggestionsActionTypes.FUNCTION) {
|
|
@@ -2232,7 +2316,7 @@ var SearchBox = vue.defineComponent({
|
|
|
2232
2316
|
return null;
|
|
2233
2317
|
},
|
|
2234
2318
|
renderTag: function renderTag(item) {
|
|
2235
|
-
var
|
|
2319
|
+
var _this13 = this;
|
|
2236
2320
|
var innerClass = this.$props.innerClass;
|
|
2237
2321
|
return vue.createVNode(TagItem, {
|
|
2238
2322
|
"class": getClassName$1(innerClass, 'selected-tag') || ''
|
|
@@ -2243,7 +2327,7 @@ var SearchBox = vue.defineComponent({
|
|
|
2243
2327
|
"aria-label": "delete-tag",
|
|
2244
2328
|
"class": "close-icon",
|
|
2245
2329
|
"onClick": function onClick() {
|
|
2246
|
-
return
|
|
2330
|
+
return _this13.clearTag(item);
|
|
2247
2331
|
}
|
|
2248
2332
|
}, [vue.createVNode(DropDown.CancelSvg, null, null)])];
|
|
2249
2333
|
}
|
|
@@ -2266,7 +2350,7 @@ var SearchBox = vue.defineComponent({
|
|
|
2266
2350
|
}
|
|
2267
2351
|
},
|
|
2268
2352
|
renderTags: function renderTags() {
|
|
2269
|
-
var
|
|
2353
|
+
var _this14 = this;
|
|
2270
2354
|
if (!Array.isArray(this.selectedTags)) {
|
|
2271
2355
|
return null;
|
|
2272
2356
|
}
|
|
@@ -2280,16 +2364,16 @@ var SearchBox = vue.defineComponent({
|
|
|
2280
2364
|
}) : vue.createVNode(TagsContainer, null, {
|
|
2281
2365
|
"default": function _default() {
|
|
2282
2366
|
return [tagsList.map(function (item) {
|
|
2283
|
-
return
|
|
2367
|
+
return _this14.renderTag(item);
|
|
2284
2368
|
}), shouldRenderClearAllTag && vue.createVNode(TagItem, {
|
|
2285
|
-
"class": getClassName$1(
|
|
2369
|
+
"class": getClassName$1(_this14.$props.innerClass, 'selected-tag') || ''
|
|
2286
2370
|
}, {
|
|
2287
2371
|
"default": function _default() {
|
|
2288
2372
|
return [vue.createVNode("span", null, [vue.createTextVNode("Clear All")]), vue.createVNode("span", {
|
|
2289
2373
|
"role": "img",
|
|
2290
2374
|
"aria-label": "delete-tag",
|
|
2291
2375
|
"class": "close-icon",
|
|
2292
|
-
"onClick":
|
|
2376
|
+
"onClick": _this14.clearAllTags
|
|
2293
2377
|
}, [vue.createVNode(DropDown.CancelSvg, null, null)])];
|
|
2294
2378
|
}
|
|
2295
2379
|
})];
|
|
@@ -2297,13 +2381,13 @@ var SearchBox = vue.defineComponent({
|
|
|
2297
2381
|
});
|
|
2298
2382
|
},
|
|
2299
2383
|
getAISourceObjects: function getAISourceObjects() {
|
|
2300
|
-
var
|
|
2384
|
+
var _this15 = this;
|
|
2301
2385
|
var sourceObjects = [];
|
|
2302
2386
|
if (!this.AIResponse) return sourceObjects;
|
|
2303
2387
|
var docIds = this.AIResponse && this.AIResponse.response && this.AIResponse.response.answer && this.AIResponse.response.answer.documentIds || [];
|
|
2304
2388
|
if (this.initialHits) {
|
|
2305
2389
|
docIds.forEach(function (id) {
|
|
2306
|
-
var foundSourceObj =
|
|
2390
|
+
var foundSourceObj = _this15.initialHits.find(function (hit) {
|
|
2307
2391
|
return hit._id === id;
|
|
2308
2392
|
}) || {};
|
|
2309
2393
|
if (foundSourceObj) {
|
|
@@ -2337,7 +2421,7 @@ var SearchBox = vue.defineComponent({
|
|
|
2337
2421
|
},
|
|
2338
2422
|
renderAIScreenFooter: function renderAIScreenFooter() {
|
|
2339
2423
|
var _slot8;
|
|
2340
|
-
var
|
|
2424
|
+
var _this16 = this;
|
|
2341
2425
|
var _this$$props$AIUIConf2 = this.$props.AIUIConfig,
|
|
2342
2426
|
AIUIConfig = _this$$props$AIUIConf2 === void 0 ? {} : _this$$props$AIUIConf2;
|
|
2343
2427
|
var _ref6 = AIUIConfig || {},
|
|
@@ -2346,11 +2430,11 @@ var SearchBox = vue.defineComponent({
|
|
|
2346
2430
|
_ref6$onSourceClick = _ref6.onSourceClick,
|
|
2347
2431
|
onSourceClick = _ref6$onSourceClick === void 0 ? function () {} : _ref6$onSourceClick;
|
|
2348
2432
|
var renderSourceDocumentLabel = function renderSourceDocumentLabel(sourceObj) {
|
|
2349
|
-
if (
|
|
2350
|
-
return
|
|
2433
|
+
if (_this16.$props.AIUIConfig && _this16.$props.AIUIConfig.renderSourceDocument) {
|
|
2434
|
+
return _this16.$props.AIUIConfig.renderSourceDocument(sourceObj);
|
|
2351
2435
|
}
|
|
2352
|
-
if (
|
|
2353
|
-
return
|
|
2436
|
+
if (_this16.$slots.renderSourceDocument) {
|
|
2437
|
+
return _this16.$slots.renderSourceDocument(sourceObj);
|
|
2354
2438
|
}
|
|
2355
2439
|
return sourceObj._id;
|
|
2356
2440
|
};
|
|
@@ -2358,10 +2442,10 @@ var SearchBox = vue.defineComponent({
|
|
|
2358
2442
|
"themePreset": this.$props.themePreset
|
|
2359
2443
|
}, {
|
|
2360
2444
|
"default": function _default() {
|
|
2361
|
-
return [vue.createTextVNode("Summary generated using the following sources:"), ' ', vue.createVNode(SourceTags, null, _isSlot(_slot8 =
|
|
2445
|
+
return [vue.createTextVNode("Summary generated using the following sources:"), ' ', vue.createVNode(SourceTags, null, _isSlot(_slot8 = _this16.getAISourceObjects().map(function (el) {
|
|
2362
2446
|
var _slot7;
|
|
2363
2447
|
return vue.createVNode(Button.Button, {
|
|
2364
|
-
"class": "--ai-source-tag " + (getClassName$1(
|
|
2448
|
+
"class": "--ai-source-tag " + (getClassName$1(_this16.$props.innerClass, 'ai-source-tag') || ''),
|
|
2365
2449
|
"info": true,
|
|
2366
2450
|
"onClick": function onClick() {
|
|
2367
2451
|
return onSourceClick && onSourceClick(el);
|
|
@@ -2380,7 +2464,7 @@ var SearchBox = vue.defineComponent({
|
|
|
2380
2464
|
}) : null;
|
|
2381
2465
|
},
|
|
2382
2466
|
renderAIScreen: function renderAIScreen() {
|
|
2383
|
-
var
|
|
2467
|
+
var _this17 = this;
|
|
2384
2468
|
var customAIRenderer = this.$props.renderAIAnswer || this.$slots.renderAIAnswer;
|
|
2385
2469
|
if (customAIRenderer) {
|
|
2386
2470
|
return customAIRenderer({
|
|
@@ -2404,11 +2488,11 @@ var SearchBox = vue.defineComponent({
|
|
|
2404
2488
|
"hideUI": this.isAIResponseLoading || this.isLoading || !this.sessionIdFromStore,
|
|
2405
2489
|
"key": this.sessionIdFromStore,
|
|
2406
2490
|
"onFeedbackSubmit": function onFeedbackSubmit(useful, reason) {
|
|
2407
|
-
|
|
2491
|
+
_this17.feedbackState = {
|
|
2408
2492
|
isRecorded: true,
|
|
2409
2493
|
feedbackType: useful ? 'positive' : 'negative'
|
|
2410
2494
|
};
|
|
2411
|
-
|
|
2495
|
+
_this17.recordAISessionUsefulness(_this17.sessionIdFromStore, {
|
|
2412
2496
|
useful: useful,
|
|
2413
2497
|
reason: reason
|
|
2414
2498
|
});
|
|
@@ -2443,7 +2527,7 @@ var SearchBox = vue.defineComponent({
|
|
|
2443
2527
|
});
|
|
2444
2528
|
},
|
|
2445
2529
|
renderAskButtonElement: function renderAskButtonElement() {
|
|
2446
|
-
var
|
|
2530
|
+
var _this18 = this;
|
|
2447
2531
|
var _this$$props5 = this.$props,
|
|
2448
2532
|
AIUIConfig = _this$$props5.AIUIConfig,
|
|
2449
2533
|
innerClass = _this$$props5.innerClass;
|
|
@@ -2453,12 +2537,12 @@ var SearchBox = vue.defineComponent({
|
|
|
2453
2537
|
if (askButton) {
|
|
2454
2538
|
var getEnterButtonMarkup = function getEnterButtonMarkup() {
|
|
2455
2539
|
if (renderAskButton) {
|
|
2456
|
-
return renderAskButton(
|
|
2540
|
+
return renderAskButton(_this18.askButtonOnClick);
|
|
2457
2541
|
}
|
|
2458
2542
|
return vue.createVNode(Button.Button, {
|
|
2459
2543
|
"class": "enter-btn " + getClassName$1(innerClass, 'ask-button'),
|
|
2460
2544
|
"info": true,
|
|
2461
|
-
"onClick":
|
|
2545
|
+
"onClick": _this18.askButtonOnClick
|
|
2462
2546
|
}, {
|
|
2463
2547
|
"default": function _default() {
|
|
2464
2548
|
return [vue.createTextVNode("Ask")];
|
|
@@ -2473,7 +2557,7 @@ var SearchBox = vue.defineComponent({
|
|
|
2473
2557
|
}
|
|
2474
2558
|
},
|
|
2475
2559
|
render: function render() {
|
|
2476
|
-
var
|
|
2560
|
+
var _this19 = this;
|
|
2477
2561
|
var expandSuggestionsContainer = this.$props.expandSuggestionsContainer;
|
|
2478
2562
|
var _this$$slots = this.$slots,
|
|
2479
2563
|
recentSearchesIcon = _this$$slots.recentSearchesIcon,
|
|
@@ -2484,17 +2568,17 @@ var SearchBox = vue.defineComponent({
|
|
|
2484
2568
|
"class": this.$props.className
|
|
2485
2569
|
}, {
|
|
2486
2570
|
"default": function _default() {
|
|
2487
|
-
return [
|
|
2488
|
-
"class": getClassName$1(
|
|
2571
|
+
return [_this19.$props.title && vue.createVNode(Title.Title, {
|
|
2572
|
+
"class": getClassName$1(_this19.$props.innerClass, 'title') || ''
|
|
2489
2573
|
}, {
|
|
2490
2574
|
"default": function _default() {
|
|
2491
|
-
return [
|
|
2575
|
+
return [_this19.$props.title];
|
|
2492
2576
|
}
|
|
2493
|
-
}),
|
|
2494
|
-
"id":
|
|
2495
|
-
"handleChange":
|
|
2496
|
-
"handleMouseup":
|
|
2497
|
-
"isOpen":
|
|
2577
|
+
}), _this19.$props.autosuggest ? vue.createVNode(DropDown.Downshift, {
|
|
2578
|
+
"id": _this19.$props.componentId + "-downshift",
|
|
2579
|
+
"handleChange": _this19.onSuggestionSelected,
|
|
2580
|
+
"handleMouseup": _this19.handleStateChange,
|
|
2581
|
+
"isOpen": _this19.$data.isOpen
|
|
2498
2582
|
}, {
|
|
2499
2583
|
"default": function _default(_ref8) {
|
|
2500
2584
|
var getInputEvents = _ref8.getInputEvents,
|
|
@@ -2550,21 +2634,21 @@ var SearchBox = vue.defineComponent({
|
|
|
2550
2634
|
}
|
|
2551
2635
|
};
|
|
2552
2636
|
var indexOffset = 0;
|
|
2553
|
-
return vue.createVNode("div", null, [
|
|
2637
|
+
return vue.createVNode("div", null, [_this19.hasCustomRenderer && _this19.getComponent({
|
|
2554
2638
|
isOpen: isOpen,
|
|
2555
2639
|
getItemProps: getItemProps,
|
|
2556
2640
|
getItemEvents: getItemEvents,
|
|
2557
2641
|
highlightedIndex: highlightedIndex
|
|
2558
|
-
}),
|
|
2559
|
-
"class": Input.suggestions(
|
|
2642
|
+
}), _this19.renderErrorComponent(), !_this19.hasCustomRenderer && isOpen && hasSuggestions ? vue.createVNode("ul", {
|
|
2643
|
+
"class": Input.suggestions(_this19.themePreset, _this19.theme) + " " + getClassName$1(_this19.$props.innerClass, 'list') + " " + Input.searchboxSuggestions(_this19.themePreset, _this19.theme) + "\n\t\t\t\t\t\t\t\t\t\t\t\t\t",
|
|
2560
2644
|
"ref": _dropdownULRef
|
|
2561
|
-
}, [
|
|
2562
|
-
"themePreset":
|
|
2645
|
+
}, [_this19.showAIScreen && vue.createVNode(SearchBoxAISection, {
|
|
2646
|
+
"themePreset": _this19.$props.themePreset
|
|
2563
2647
|
}, {
|
|
2564
2648
|
"default": function _default() {
|
|
2565
|
-
return [
|
|
2649
|
+
return [_this19.renderAIScreen(), ' ', _this19.renderErrorComponent(true)];
|
|
2566
2650
|
}
|
|
2567
|
-
}), !
|
|
2651
|
+
}), !_this19.showAIScreen && _this19.parsedSuggestions.map(function (item, itemIndex) {
|
|
2568
2652
|
var index = indexOffset + itemIndex;
|
|
2569
2653
|
if (Array.isArray(item)) {
|
|
2570
2654
|
var sectionHtml = xss(item[0].sectionLabel);
|
|
@@ -2573,7 +2657,7 @@ var SearchBox = vue.defineComponent({
|
|
|
2573
2657
|
"key": "section-" + itemIndex,
|
|
2574
2658
|
"class": "section-container"
|
|
2575
2659
|
}, [sectionHtml ? vue.createVNode("div", {
|
|
2576
|
-
"class": "section-header " + getClassName$1(
|
|
2660
|
+
"class": "section-header " + getClassName$1(_this19.$props.innerClass, 'section-label'),
|
|
2577
2661
|
"key": "" + item[0].sectionId,
|
|
2578
2662
|
"innerHTML": sectionHtml
|
|
2579
2663
|
}, null) : null, vue.createVNode("ul", {
|
|
@@ -2593,7 +2677,7 @@ var SearchBox = vue.defineComponent({
|
|
|
2593
2677
|
justifyContent: 'flex-start',
|
|
2594
2678
|
alignItems: 'center'
|
|
2595
2679
|
},
|
|
2596
|
-
"class": "" + (highlightedIndex === index + sectionIndex ? "active-li-item " + getClassName$1(
|
|
2680
|
+
"class": "" + (highlightedIndex === index + sectionIndex ? "active-li-item " + getClassName$1(_this19.$props.innerClass, 'active-suggestion-item') : "li-item " + getClassName$1(_this19.$props.innerClass, 'suggestion-item'))
|
|
2597
2681
|
}), [renderItem(sectionItem)]);
|
|
2598
2682
|
}
|
|
2599
2683
|
if (sectionItem._suggestion_type === '_internal_a_i_trigger') {
|
|
@@ -2607,9 +2691,9 @@ var SearchBox = vue.defineComponent({
|
|
|
2607
2691
|
justifyContent: 'flex-start',
|
|
2608
2692
|
alignItems: 'center'
|
|
2609
2693
|
},
|
|
2610
|
-
"class": "" + (highlightedIndex === index + sectionIndex ? "active-li-item " + getClassName$1(
|
|
2694
|
+
"class": "" + (highlightedIndex === index + sectionIndex ? "active-li-item " + getClassName$1(_this19.$props.innerClass, 'active-suggestion-item') : "li-item " + getClassName$1(_this19.$props.innerClass, 'suggestion-item'))
|
|
2611
2695
|
}), [vue.createVNode(SuggestionItem, {
|
|
2612
|
-
"currentValue":
|
|
2696
|
+
"currentValue": _this19.currentValue,
|
|
2613
2697
|
"suggestion": sectionItem
|
|
2614
2698
|
}, null)]);
|
|
2615
2699
|
}
|
|
@@ -2623,7 +2707,7 @@ var SearchBox = vue.defineComponent({
|
|
|
2623
2707
|
justifyContent: 'flex-start',
|
|
2624
2708
|
alignItems: 'center'
|
|
2625
2709
|
},
|
|
2626
|
-
"class": "" + (highlightedIndex === index + sectionIndex ? "active-li-item " + getClassName$1(
|
|
2710
|
+
"class": "" + (highlightedIndex === index + sectionIndex ? "active-li-item " + getClassName$1(_this19.$props.innerClass, 'active-suggestion-item') : "li-item " + getClassName$1(_this19.$props.innerClass, 'suggestion-item'))
|
|
2627
2711
|
}), [vue.createVNode("div", {
|
|
2628
2712
|
"style": {
|
|
2629
2713
|
padding: '0 10px 0 0',
|
|
@@ -2631,74 +2715,74 @@ var SearchBox = vue.defineComponent({
|
|
|
2631
2715
|
}
|
|
2632
2716
|
}, [vue.createVNode(CustomSvg, {
|
|
2633
2717
|
"key": sectionItem._suggestion_type + "-" + sectionIndex,
|
|
2634
|
-
"className": getClassName$1(
|
|
2718
|
+
"className": getClassName$1(_this19.$props.innerClass, sectionItem._suggestion_type + "-search-icon") || null,
|
|
2635
2719
|
"icon": getIcon(sectionItem._suggestion_type, sectionItem, suggestionsHaveIcon),
|
|
2636
2720
|
"type": sectionItem._suggestion_type + "-search-icon"
|
|
2637
2721
|
}, null)]), vue.createVNode(SuggestionItem, {
|
|
2638
|
-
"currentValue":
|
|
2722
|
+
"currentValue": _this19.currentValue,
|
|
2639
2723
|
"suggestion": sectionItem
|
|
2640
|
-
}, null),
|
|
2724
|
+
}, null), _this19.renderActionIcon(sectionItem)]);
|
|
2641
2725
|
})])]);
|
|
2642
2726
|
}
|
|
2643
2727
|
return vue.createVNode("div", null, [vue.createTextVNode("No suggestions")]);
|
|
2644
|
-
}), !
|
|
2728
|
+
}), !_this19.showAIScreen && _this19.parsedSuggestions.length && _this19.$props.showSuggestionsFooter ? _this19.suggestionsFooter() : null]) : _this19.renderNoSuggestions(_this19.normalizedSuggestions)]);
|
|
2645
2729
|
};
|
|
2646
2730
|
return vue.createVNode("div", {
|
|
2647
2731
|
"class": Input.suggestionsContainer
|
|
2648
2732
|
}, [vue.createVNode(InputGroup, {
|
|
2649
2733
|
"searchBox": true,
|
|
2650
2734
|
"ref": _inputGroupRef,
|
|
2651
|
-
"isOpen":
|
|
2735
|
+
"isOpen": _this19.$data.isOpen
|
|
2652
2736
|
}, {
|
|
2653
2737
|
"default": function _default() {
|
|
2654
2738
|
return [vue.createVNode(Input.Actions, null, {
|
|
2655
2739
|
"default": function _default() {
|
|
2656
|
-
return [
|
|
2740
|
+
return [_this19.renderInputAddonBefore(), _this19.renderLeftIcons()];
|
|
2657
2741
|
}
|
|
2658
2742
|
}), vue.createVNode(DropDown.InputWrapper, null, {
|
|
2659
2743
|
"default": function _default() {
|
|
2660
2744
|
return [vue.createVNode(Input.TextArea, vue.mergeProps(_transformOn(getInputEvents({
|
|
2661
|
-
onInput:
|
|
2745
|
+
onInput: _this19.onInputChange,
|
|
2662
2746
|
onBlur: function onBlur(e) {
|
|
2663
|
-
|
|
2747
|
+
_this19.$emit('blur', e, _this19.triggerQuery);
|
|
2664
2748
|
},
|
|
2665
|
-
onFocus:
|
|
2749
|
+
onFocus: _this19.handleFocus,
|
|
2666
2750
|
onKeyPress: function onKeyPress(e) {
|
|
2667
|
-
|
|
2668
|
-
|
|
2751
|
+
_this19.$emit('keyPress', e, _this19.triggerQuery);
|
|
2752
|
+
_this19.$emit('key-press', e, _this19.triggerQuery);
|
|
2669
2753
|
},
|
|
2670
2754
|
onKeyDown: function onKeyDown(e) {
|
|
2671
|
-
return
|
|
2755
|
+
return _this19.handleKeyDown(e, highlightedIndex);
|
|
2672
2756
|
},
|
|
2673
2757
|
onKeyUp: function onKeyUp(e) {
|
|
2674
|
-
|
|
2675
|
-
|
|
2758
|
+
_this19.$emit('keyUp', e, _this19.triggerQuery);
|
|
2759
|
+
_this19.$emit('key-up', e, _this19.triggerQuery);
|
|
2676
2760
|
},
|
|
2677
2761
|
onClick: function onClick() {
|
|
2678
2762
|
setHighlightedIndex(null);
|
|
2679
2763
|
}
|
|
2680
2764
|
})), {
|
|
2681
2765
|
"searchBox": true,
|
|
2682
|
-
"isOpen":
|
|
2683
|
-
"id":
|
|
2684
|
-
"ref":
|
|
2685
|
-
"class": getClassName$1(
|
|
2686
|
-
"placeholder":
|
|
2687
|
-
"autoFocus":
|
|
2766
|
+
"isOpen": _this19.$data.isOpen,
|
|
2767
|
+
"id": _this19.$props.componentId + "-input",
|
|
2768
|
+
"ref": _this19.$props.innerRef,
|
|
2769
|
+
"class": getClassName$1(_this19.$props.innerClass, 'input'),
|
|
2770
|
+
"placeholder": _this19.$props.placeholder,
|
|
2771
|
+
"autoFocus": _this19.$props.autoFocus
|
|
2688
2772
|
}, getInputProps({
|
|
2689
|
-
value:
|
|
2773
|
+
value: _this19.$data.currentValue === null ? '' : _this19.$data.currentValue
|
|
2690
2774
|
}), {
|
|
2691
|
-
"themePreset":
|
|
2775
|
+
"themePreset": _this19.themePreset,
|
|
2692
2776
|
"autocomplete": "off"
|
|
2693
2777
|
}), null), !expandSuggestionsContainer && renderSuggestionsDropdown()];
|
|
2694
2778
|
}
|
|
2695
2779
|
}), vue.createVNode(Input.Actions, null, {
|
|
2696
2780
|
"default": function _default() {
|
|
2697
|
-
return [
|
|
2781
|
+
return [_this19.renderRightIcons(), _this19.renderInputAddonAfter(), _this19.renderAskButtonElement(), _this19.renderEnterButtonElement()];
|
|
2698
2782
|
}
|
|
2699
2783
|
})];
|
|
2700
2784
|
}
|
|
2701
|
-
}), expandSuggestionsContainer && renderSuggestionsDropdown(),
|
|
2785
|
+
}), expandSuggestionsContainer && renderSuggestionsDropdown(), _this19.renderTags()]);
|
|
2702
2786
|
}
|
|
2703
2787
|
}) : vue.createVNode("div", {
|
|
2704
2788
|
"class": Input.suggestionsContainer
|
|
@@ -2709,43 +2793,43 @@ var SearchBox = vue.defineComponent({
|
|
|
2709
2793
|
"default": function _default() {
|
|
2710
2794
|
return [vue.createVNode(Input.Actions, null, {
|
|
2711
2795
|
"default": function _default() {
|
|
2712
|
-
return [
|
|
2796
|
+
return [_this19.renderInputAddonBefore(), _this19.renderLeftIcons()];
|
|
2713
2797
|
}
|
|
2714
2798
|
}), vue.createVNode(DropDown.InputWrapper, null, {
|
|
2715
2799
|
"default": function _default() {
|
|
2716
2800
|
return [vue.createVNode(Input.TextArea, vue.mergeProps(_transformOn({
|
|
2717
2801
|
blur: function blur(e) {
|
|
2718
|
-
|
|
2802
|
+
_this19.$emit('blur', e, _this19.triggerQuery);
|
|
2719
2803
|
},
|
|
2720
2804
|
keypress: function keypress(e) {
|
|
2721
|
-
|
|
2722
|
-
|
|
2805
|
+
_this19.$emit('keyPress', e, _this19.triggerQuery);
|
|
2806
|
+
_this19.$emit('key-press', e, _this19.triggerQuery);
|
|
2723
2807
|
},
|
|
2724
|
-
input:
|
|
2808
|
+
input: _this19.onInputChange,
|
|
2725
2809
|
focus: function focus(e) {
|
|
2726
|
-
|
|
2810
|
+
_this19.$emit('focus', e, _this19.triggerQuery);
|
|
2727
2811
|
},
|
|
2728
|
-
keydown:
|
|
2812
|
+
keydown: _this19.handleKeyDown,
|
|
2729
2813
|
keyup: function keyup(e) {
|
|
2730
|
-
|
|
2731
|
-
|
|
2814
|
+
_this19.$emit('keyUp', e, _this19.triggerQuery);
|
|
2815
|
+
_this19.$emit('key-up', e, _this19.triggerQuery);
|
|
2732
2816
|
}
|
|
2733
2817
|
}), {
|
|
2734
2818
|
"searchBox": true,
|
|
2735
|
-
"class": getClassName$1(
|
|
2736
|
-
"placeholder":
|
|
2737
|
-
"autofocus":
|
|
2738
|
-
"value":
|
|
2739
|
-
"iconPosition":
|
|
2740
|
-
"showIcon":
|
|
2741
|
-
"showClear":
|
|
2742
|
-
"ref":
|
|
2743
|
-
"themePreset":
|
|
2819
|
+
"class": getClassName$1(_this19.$props.innerClass, 'input') || '',
|
|
2820
|
+
"placeholder": _this19.$props.placeholder,
|
|
2821
|
+
"autofocus": _this19.$props.autoFocus,
|
|
2822
|
+
"value": _this19.$data.currentValue ? _this19.$data.currentValue : '',
|
|
2823
|
+
"iconPosition": _this19.$props.iconPosition,
|
|
2824
|
+
"showIcon": _this19.$props.showIcon,
|
|
2825
|
+
"showClear": _this19.$props.showClear,
|
|
2826
|
+
"ref": _this19.$props.innerRef,
|
|
2827
|
+
"themePreset": _this19.themePreset
|
|
2744
2828
|
}), null)];
|
|
2745
2829
|
}
|
|
2746
2830
|
}), vue.createVNode(Input.Actions, null, {
|
|
2747
2831
|
"default": function _default() {
|
|
2748
|
-
return [
|
|
2832
|
+
return [_this19.renderRightIcons(), _this19.renderInputAddonAfter(), _this19.renderEnterButtonElement()];
|
|
2749
2833
|
}
|
|
2750
2834
|
})];
|
|
2751
2835
|
}
|