@appbaseio/reactivesearch-vue 3.0.0-rc.8 → 3.0.0-rc.9
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 +405 -2181
- package/dist/@appbaseio/reactivesearch-vue.umd.js.map +1 -1
- package/dist/@appbaseio/reactivesearch-vue.umd.min.js +5 -5
- package/dist/@appbaseio/reactivesearch-vue.umd.min.js.map +1 -1
- package/dist/cjs/{DropDown-82d92f8b.js → DropDown-aef75c14.js} +4 -12
- package/dist/cjs/{Input-fcd780de.js → Input-56eba499.js} +16 -28
- 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 -4
- package/dist/cjs/{install-2a1c953d.js → install-e8141489.js} +169 -369
- package/dist/cjs/install.js +3 -4
- package/dist/cjs/version.js +1 -1
- package/dist/es/{DropDown-8075451b.js → DropDown-39fedff8.js} +5 -12
- package/dist/es/{Input-4cd74b38.js → Input-11d211d2.js} +17 -27
- 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 -5
- package/dist/es/{install-f4f2557b.js → install-b785dd55.js} +170 -370
- package/dist/es/install.js +3 -4
- package/dist/es/version.js +1 -1
- package/package.json +3 -4
|
@@ -26,9 +26,8 @@ var analytics = require('@appbaseio/reactivecore/lib/actions/analytics');
|
|
|
26
26
|
var ReactiveBase = require('./ReactiveBase.js');
|
|
27
27
|
var hotkeys = _interopDefault(require('hotkeys-js'));
|
|
28
28
|
var remarkable = require('remarkable');
|
|
29
|
-
var
|
|
30
|
-
var
|
|
31
|
-
var Input = require('./Input-fcd780de.js');
|
|
29
|
+
var DropDown = require('./DropDown-aef75c14.js');
|
|
30
|
+
var Input = require('./Input-56eba499.js');
|
|
32
31
|
var Container = require('./Container-29f049b2.js');
|
|
33
32
|
var Highlight = _interopDefault(require('vue-highlight-words'));
|
|
34
33
|
var query = require('@appbaseio/reactivecore/lib/actions/query');
|
|
@@ -53,13 +52,7 @@ var ResultList = require('./ResultList.js');
|
|
|
53
52
|
var StateProvider = require('./StateProvider.js');
|
|
54
53
|
|
|
55
54
|
var _templateObject;
|
|
56
|
-
var InputGroup = vueEmotion.styled('div')(_templateObject || (_templateObject = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n
|
|
57
|
-
var theme = _ref.theme,
|
|
58
|
-
searchBox = _ref.searchBox;
|
|
59
|
-
return searchBox && "background-color: " + (theme.colors.backgroundColor || '#fafafa') + ";\n\t\tcolor: " + (theme.colors.textColor || '#fff') + ";\n\n\t\t&:focus-within {\n\t\t\tbackground-color: " + (theme.colors.backgroundColor || '#fff') + ";\n\t\t}";
|
|
60
|
-
}, function (props) {
|
|
61
|
-
return props.isOpen && 'box-shadow: rgb(0 0 0 / 20%) 0px 0px 15px;';
|
|
62
|
-
});
|
|
55
|
+
var InputGroup = vueEmotion.styled('div')(_templateObject || (_templateObject = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tdisplay: flex;\n\talign-items: stretch;\n\twidth: 100%;\n"])));
|
|
63
56
|
InputGroup.defaultProps = {
|
|
64
57
|
className: 'input-group'
|
|
65
58
|
};
|
|
@@ -789,11 +782,8 @@ var _templateObject$4, _templateObject2;
|
|
|
789
782
|
var TagsContainer = vueEmotion.styled('div')(_templateObject$4 || (_templateObject$4 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tmargin-top: 10px;\n\twidth: 100%;\n"])));
|
|
790
783
|
var TagItem = vueEmotion.styled('span')(_templateObject2 || (_templateObject2 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tcursor: default;\n\tbox-sizing: border-box;\n\tmargin: 0 4px 4px 0;\n\tcolor: #000000d9;\n\tfont-size: 14px;\n\tfont-variant: tabular-nums;\n\tline-height: 1.5715;\n\tlist-style: none;\n\tfont-feature-settings: 'tnum';\n\tdisplay: inline-block;\n\theight: auto;\n\tpadding: 0 2px 0 7px;\n\tfont-size: 12px;\n\tline-height: 22px;\n\twhite-space: nowrap;\n\tbackground: #fafafa;\n\tborder: 1px solid #d9d9d9;\n\tborder-radius: 2px;\n\topacity: 1;\n\ttransition: all 0.3s;\n\n\tspan.close-icon {\n\t\tsvg {\n\t\t\tcursor: pointer;\n\t\t\theight: 15px;\n\t\t\tposition: relative;\n\t\t\ttop: 4px;\n\t\t\tfill: #262626;\n\t\t}\n\t}\n"])));
|
|
791
784
|
|
|
792
|
-
var _templateObject$5;
|
|
793
|
-
var
|
|
794
|
-
|
|
795
|
-
var _templateObject$6, _templateObject2$1, _templateObject3;
|
|
796
|
-
var skeletonAnimation = css.keyframes(_templateObject$6 || (_templateObject$6 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n 0% {\n background-position: 100% 0;\n }\n 100% {\n background-position: -200% 0;\n }\n"])));
|
|
785
|
+
var _templateObject$5, _templateObject2$1, _templateObject3;
|
|
786
|
+
var skeletonAnimation = css.keyframes(_templateObject$5 || (_templateObject$5 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n 0% {\n background-position: 100% 0;\n }\n 100% {\n background-position: -200% 0;\n }\n"])));
|
|
797
787
|
var SkeletonLoader = vueEmotion.styled('div')(_templateObject2$1 || (_templateObject2$1 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 10px;\n"])));
|
|
798
788
|
var SkeletonLine = vueEmotion.styled('div')(_templateObject3 || (_templateObject3 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\twidth: 100%;\n\theight: 20px;\n\tbackground: linear-gradient(\n\t\t90deg,\n\t\trgba(220, 220, 220, 0.5) 25%,\n\t\trgba(240, 240, 240, 0.9) 50%,\n\t\trgba(220, 220, 220, 0.5) 75%\n\t);\n\tbackground-size: 200% 100%;\n\tanimation: ", " 1.5s infinite;\n"])), skeletonAnimation);
|
|
799
789
|
var HorizontalSkeletonLoader = vue.defineComponent({
|
|
@@ -807,8 +797,8 @@ var HorizontalSkeletonLoader = vue.defineComponent({
|
|
|
807
797
|
}
|
|
808
798
|
});
|
|
809
799
|
|
|
810
|
-
var _templateObject$
|
|
811
|
-
var Chatbox = vueEmotion.styled('div')(_templateObject$
|
|
800
|
+
var _templateObject$6, _templateObject2$2, _templateObject3$1, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11;
|
|
801
|
+
var Chatbox = vueEmotion.styled('div')(_templateObject$6 || (_templateObject$6 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tposition: relative;\n\tmargin: 0 auto;\n\tpadding: 10px;\n\tbackground-color: #fafafa;\n\twidth: 100%;\n\tbox-shadow: rgb(0 0 0 / 20%) 0px 0px 6px;\n\tborder-radius: 6px;\n\tmargin-bottom: 20px;\n\tbackground-color: ", ";\n"])), function (props) {
|
|
812
802
|
return props.theme && props.theme.colors ? props.theme.colors.backgroundColor : '#fff';
|
|
813
803
|
});
|
|
814
804
|
var ChatContainer = vueEmotion.styled('div')(_templateObject2$2 || (_templateObject2$2 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tdisplay: flex;\n\tflex-direction: column;\n\theight: 100%;\n\tposition: relative;\n\t.--ai-answer-error-container {\n\t\ttext-align: center;\n\t\tposition: absolute;\n\t\tbottom: 0px;\n\t\t", ";\n\t\tz-index: 1;\n\t\tleft: 50%;\n\t\ttransform: translateX(-50%);\n\t\twidth: 100%;\n\n\t\t.--default-error-element {\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\talign-items: center;\n\t\t\tpadding: 10px;\n\t\t\tbackground-color: ", ";\n\t\t\tbox-shadow: 0 -5px 5px -2px\n\t\t\t\t", ";\n\n\t\t\tspan {\n\t\t\t\tmargin-bottom: 5px;\n\t\t\t}\n\n\t\t\tbutton {\n\t\t\t}\n\t\t}\n\t}\n\n\t", ";\n"])), function (props) {
|
|
@@ -883,8 +873,8 @@ var MessageInput = vueEmotion.styled(Input.TextArea)(_templateObject9 || (_templ
|
|
|
883
873
|
var SendButton = vueEmotion.styled(Button.Button)(_templateObject10 || (_templateObject10 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tborder: none;\n\tcolor: #ffffff;\n\tcursor: pointer;\n\tfont-size: 16px;\n\tmargin-left: 8px;\n\toutline: none;\n\tpadding: 10px;\n\ttext-align: center;\n\n\t&:disabled {\n\t\tcursor: not-allowed;\n\t}\n"])));
|
|
884
874
|
var AIFeedbackContainer = vueEmotion.styled('div')(_templateObject11 || (_templateObject11 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\t.--feedback-svgs-wrapper {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: flex-end;\n\t\tgap: 5px;\n\n\t\tsvg {\n\t\t\tcursor: pointer;\n\t\t\ttransition: all ease-in 0.1s;\n\t\t\t&.selected {\n\t\t\t\ttransform: scale(1.1);\n\t\t\t\tcursor: default;\n\t\t\t}\n\n\t\t\t&:hover {\n\t\t\t\ttransform: scale(1.1);\n\t\t\t}\n\t\t}\n\t}\n\n\t.--feedback-input-wrapper {\n\t\tdisplay: flex;\n\t\tgap: 7px;\n\t}\n"])));
|
|
885
875
|
|
|
886
|
-
var _templateObject$
|
|
887
|
-
var fadeInFromBottom = css.keyframes(_templateObject$
|
|
876
|
+
var _templateObject$7, _templateObject2$3, _templateObject3$2, _templateObject4$1, _templateObject5$1, _templateObject6$1, _templateObject7$1;
|
|
877
|
+
var fadeInFromBottom = css.keyframes(_templateObject$7 || (_templateObject$7 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n 0% {\n opacity: 0;\n transform: translateY(20px);\n }\n 100% {\n opacity: 1;\n transform: translateY(0);\n }\n"])));
|
|
888
878
|
var fadeInFromTop = css.keyframes(_templateObject2$3 || (_templateObject2$3 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n 0% {\n opacity: 0;\n transform: translateY(-20px);\n }\n 100% {\n opacity: 1;\n transform: translateY(0);\n }\n"])));
|
|
889
879
|
var SearchBoxAISection = vueEmotion.styled('div')(_templateObject3$2 || (_templateObject3$2 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tpadding: 10px;\n\tborder-radius: 4px;\n\tmin-height: 200px;\n\tpadding-top: 20px;\n\tposition: relative;\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: space-between;\n\tbackground-color: ", ";\n\tcolor: ", ";\n\t.--ai-answer-error-container {\n\t\tposition: absolute;\n\t\ttop: 50%;\n\t\tleft: 50%;\n\t\ttransform: translate(-50%, -50%);\n\t\t.--default-error-element {\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\talign-items: center;\n\t\t\tgap: 10px;\n\t\t}\n\t}\n"])), function (_ref) {
|
|
890
880
|
var themePreset = _ref.themePreset,
|
|
@@ -1157,26 +1147,6 @@ var SearchBox = vue.defineComponent({
|
|
|
1157
1147
|
},
|
|
1158
1148
|
stats: function stats() {
|
|
1159
1149
|
return getResultStats(this);
|
|
1160
|
-
},
|
|
1161
|
-
parsedSuggestions: function parsedSuggestions() {
|
|
1162
|
-
var suggestionsArray = [];
|
|
1163
|
-
if (Array.isArray(this.suggestions) && this.suggestions.length) {
|
|
1164
|
-
suggestionsArray = [].concat(withClickIds(this.suggestions));
|
|
1165
|
-
}
|
|
1166
|
-
var sectionsAccumulated = [];
|
|
1167
|
-
var sectionisedSuggestions = suggestionsArray.reduce(function (acc, d, currentIndex) {
|
|
1168
|
-
if (sectionsAccumulated.includes(d.sectionId)) return acc;
|
|
1169
|
-
if (d.sectionId) {
|
|
1170
|
-
acc[currentIndex] = suggestionsArray.filter(function (g) {
|
|
1171
|
-
return g.sectionId === d.sectionId;
|
|
1172
|
-
});
|
|
1173
|
-
sectionsAccumulated.push(d.sectionId);
|
|
1174
|
-
} else {
|
|
1175
|
-
acc[currentIndex] = d;
|
|
1176
|
-
}
|
|
1177
|
-
return acc;
|
|
1178
|
-
}, {});
|
|
1179
|
-
return Object.values(sectionisedSuggestions);
|
|
1180
1150
|
}
|
|
1181
1151
|
},
|
|
1182
1152
|
props: {
|
|
@@ -1243,20 +1213,12 @@ var SearchBox = vue.defineComponent({
|
|
|
1243
1213
|
distinctFieldConfig: vueTypes.types.props,
|
|
1244
1214
|
//
|
|
1245
1215
|
focusShortcuts: VueTypes.arrayOf(VueTypes.oneOfType([VueTypes.string, VueTypes.number])).def(['/']),
|
|
1246
|
-
showFocusShortcutsIcon: VueTypes.bool.def(true),
|
|
1247
1216
|
addonBefore: VueTypes.any,
|
|
1248
1217
|
addonAfter: VueTypes.any,
|
|
1249
|
-
showSuggestionsFooter: VueTypes.bool.def(true),
|
|
1250
1218
|
expandSuggestionsContainer: VueTypes.bool.def(true),
|
|
1251
|
-
renderSuggestionsFooter: VueTypes.func,
|
|
1252
1219
|
index: VueTypes.string,
|
|
1253
1220
|
popularSuggestionsConfig: VueTypes.object,
|
|
1254
1221
|
recentSuggestionsConfig: VueTypes.object,
|
|
1255
|
-
featuredSuggestionsConfig: VueTypes.shape({
|
|
1256
|
-
maxSuggestionsPerSection: VueTypes.number,
|
|
1257
|
-
sectionsOrder: VueTypes.arrayOf(VueTypes.string)
|
|
1258
|
-
}),
|
|
1259
|
-
customEvents: VueTypes.object,
|
|
1260
1222
|
applyStopwords: VueTypes.bool,
|
|
1261
1223
|
customStopwords: vueTypes.types.stringArray,
|
|
1262
1224
|
onData: vueTypes.types.func,
|
|
@@ -1702,52 +1664,12 @@ var SearchBox = vue.defineComponent({
|
|
|
1702
1664
|
}, e);
|
|
1703
1665
|
}
|
|
1704
1666
|
},
|
|
1705
|
-
handleFeaturedSuggestionClicked: function handleFeaturedSuggestionClicked(suggestion) {
|
|
1706
|
-
try {
|
|
1707
|
-
var _this$$refs2, _this$$refs2$this$$pr;
|
|
1708
|
-
if (suggestion.action === helper.featuredSuggestionsActionTypes.NAVIGATE) {
|
|
1709
|
-
var _JSON$parse = JSON.parse(suggestion.subAction),
|
|
1710
|
-
_JSON$parse$target = _JSON$parse.target,
|
|
1711
|
-
target = _JSON$parse$target === void 0 ? '_self' : _JSON$parse$target,
|
|
1712
|
-
_JSON$parse$link = _JSON$parse.link,
|
|
1713
|
-
link = _JSON$parse$link === void 0 ? '/' : _JSON$parse$link;
|
|
1714
|
-
if (typeof window !== 'undefined') {
|
|
1715
|
-
window.open(link, target);
|
|
1716
|
-
}
|
|
1717
|
-
}
|
|
1718
|
-
if (suggestion.action === helper.featuredSuggestionsActionTypes.FUNCTION) {
|
|
1719
|
-
var matchedValues = suggestion.subAction.match(/function\s*\(.*\)(.|\n)*/);
|
|
1720
|
-
var functionStr = matchedValues && matchedValues[0];
|
|
1721
|
-
// eslint-disable-next-line no-new-func
|
|
1722
|
-
var func = new Function("return " + functionStr)();
|
|
1723
|
-
func(suggestion, this.$data.currentValue, this.$props.customEvents);
|
|
1724
|
-
}
|
|
1725
|
-
if (suggestion.action === helper.featuredSuggestionsActionTypes.SELECT) {
|
|
1726
|
-
this.setValue(suggestion.value, true, this.$props, this.$options.isTagsMode.current ? reactivecore.causes.SUGGESTION_SELECT : reactivecore.causes.ENTER_PRESS);
|
|
1727
|
-
this.onValueSelectedHandler(suggestion.value, reactivecore.causes.SUGGESTION_SELECT);
|
|
1728
|
-
}
|
|
1729
|
-
// blur is important to close the dropdown
|
|
1730
|
-
// on selecting one of featured suggestions
|
|
1731
|
-
// else Downshift probably is focusing the dropdown
|
|
1732
|
-
// and not letting it close
|
|
1733
|
-
// eslint-disable-next-line no-unused-expressions
|
|
1734
|
-
(_this$$refs2 = this.$refs) == null ? void 0 : (_this$$refs2$this$$pr = _this$$refs2[this.$props.innerRef]) == null ? void 0 : _this$$refs2$this$$pr.blur();
|
|
1735
|
-
} catch (e) {
|
|
1736
|
-
console.error("Error: There was an error parsing the subAction for the featured suggestion with label, \"" + suggestion.label + "\"", e);
|
|
1737
|
-
}
|
|
1738
|
-
},
|
|
1739
1667
|
onSuggestionSelected: function onSuggestionSelected(suggestion) {
|
|
1740
1668
|
var _this4 = this;
|
|
1741
1669
|
if (!this.$props.enableAI) this.isOpen = false;else {
|
|
1742
1670
|
this.showAIScreen = true;
|
|
1743
1671
|
}
|
|
1744
1672
|
var value = this.$props.value;
|
|
1745
|
-
|
|
1746
|
-
// handle featured suggestions click event
|
|
1747
|
-
if (suggestion._suggestion_type === helper.suggestionTypes.Featured) {
|
|
1748
|
-
this.handleFeaturedSuggestionClicked(suggestion);
|
|
1749
|
-
return;
|
|
1750
|
-
}
|
|
1751
1673
|
// Record analytics for selected suggestions
|
|
1752
1674
|
this.triggerClickAnalytics(suggestion._click_id);
|
|
1753
1675
|
if (value === undefined) {
|
|
@@ -1903,13 +1825,6 @@ var SearchBox = vue.defineComponent({
|
|
|
1903
1825
|
customQuery: true
|
|
1904
1826
|
});
|
|
1905
1827
|
},
|
|
1906
|
-
suggestionsFooter: function suggestionsFooter() {
|
|
1907
|
-
return typeof renderSuggestionsFooter === 'function' ? this.$props.renderSuggestionsFooter() : vue.createVNode(AutosuggestFooterContainer, null, {
|
|
1908
|
-
"default": function _default() {
|
|
1909
|
-
return [vue.createVNode("div", null, [vue.createTextVNode("\u2191\u2193 Navigate")]), vue.createVNode("div", null, [vue.createTextVNode("\u21A9 Go")])];
|
|
1910
|
-
}
|
|
1911
|
-
});
|
|
1912
|
-
},
|
|
1913
1828
|
renderEnterButtonElement: function renderEnterButtonElement() {
|
|
1914
1829
|
var _this6 = this;
|
|
1915
1830
|
var _this$$props2 = this.$props,
|
|
@@ -1937,98 +1852,71 @@ var SearchBox = vue.defineComponent({
|
|
|
1937
1852
|
}
|
|
1938
1853
|
return null;
|
|
1939
1854
|
},
|
|
1940
|
-
|
|
1941
|
-
if (this.$props.focusShortcuts && this.$props.focusShortcuts.length) {
|
|
1942
|
-
var shortcut = this.$props.focusShortcuts[0];
|
|
1943
|
-
shortcut = shortcut.toLowerCase();
|
|
1944
|
-
shortcut = shortcut.replace('shift', '⬆️');
|
|
1945
|
-
shortcut = shortcut.replace('command', 'cmd');
|
|
1946
|
-
shortcut = shortcut.replace('control', 'ctrl');
|
|
1947
|
-
shortcut = shortcut.replace('option', 'alt');
|
|
1948
|
-
return shortcut.toUpperCase();
|
|
1949
|
-
}
|
|
1950
|
-
return '/';
|
|
1951
|
-
},
|
|
1952
|
-
renderLeftIcons: function renderLeftIcons() {
|
|
1855
|
+
renderIcons: function renderIcons() {
|
|
1953
1856
|
var _this7 = this;
|
|
1954
|
-
var _slot3;
|
|
1857
|
+
var _slot3, _slot4, _slot5;
|
|
1955
1858
|
var _this$$props3 = this.$props,
|
|
1956
1859
|
iconPosition = _this$$props3.iconPosition,
|
|
1860
|
+
showClear = _this$$props3.showClear,
|
|
1861
|
+
innerClass = _this$$props3.innerClass,
|
|
1862
|
+
getMicInstance = _this$$props3.getMicInstance,
|
|
1863
|
+
showVoiceSearch = _this$$props3.showVoiceSearch,
|
|
1957
1864
|
showIcon = _this$$props3.showIcon;
|
|
1958
|
-
return vue.createVNode("div", null, [vue.createVNode(DropDown.IconGroup, {
|
|
1959
|
-
"groupPosition": "left"
|
|
1960
|
-
}, {
|
|
1961
|
-
"default": function _default() {
|
|
1962
|
-
return [iconPosition === 'left' && showIcon && vue.createVNode(DropDown.IconWrapper, {
|
|
1963
|
-
"onClick": _this7.handleSearchIconClick
|
|
1964
|
-
}, _isSlot(_slot3 = _this7.renderIcon()) ? _slot3 : {
|
|
1965
|
-
"default": function _default() {
|
|
1966
|
-
return [_slot3];
|
|
1967
|
-
}
|
|
1968
|
-
})];
|
|
1969
|
-
}
|
|
1970
|
-
})]);
|
|
1971
|
-
},
|
|
1972
|
-
renderRightIcons: function renderRightIcons() {
|
|
1973
|
-
var _this8 = this;
|
|
1974
|
-
var _slot4, _slot5, _slot6;
|
|
1975
|
-
var _this$$props4 = this.$props,
|
|
1976
|
-
iconPosition = _this$$props4.iconPosition,
|
|
1977
|
-
showClear = _this$$props4.showClear,
|
|
1978
|
-
innerClass = _this$$props4.innerClass,
|
|
1979
|
-
getMicInstance = _this$$props4.getMicInstance,
|
|
1980
|
-
showVoiceSearch = _this$$props4.showVoiceSearch,
|
|
1981
|
-
showIcon = _this$$props4.showIcon,
|
|
1982
|
-
showFocusShortcutsIcon = _this$$props4.showFocusShortcutsIcon;
|
|
1983
1865
|
var renderMic = this.$slots.renderMic || this.$props.renderMic;
|
|
1984
1866
|
var currentValue = this.$data.currentValue;
|
|
1985
1867
|
return vue.createVNode("div", null, [vue.createVNode(DropDown.IconGroup, {
|
|
1986
|
-
"groupPosition": "right"
|
|
1868
|
+
"groupPosition": "right",
|
|
1869
|
+
"positionType": "absolute"
|
|
1987
1870
|
}, {
|
|
1988
1871
|
"default": function _default() {
|
|
1989
1872
|
return [currentValue && showClear && vue.createVNode(DropDown.IconWrapper, {
|
|
1990
|
-
"onClick":
|
|
1873
|
+
"onClick": _this7.clearValue,
|
|
1991
1874
|
"showIcon": showIcon,
|
|
1992
1875
|
"isClearIcon": true
|
|
1993
|
-
}, _isSlot(
|
|
1876
|
+
}, _isSlot(_slot3 = _this7.renderCancelIcon()) ? _slot3 : {
|
|
1994
1877
|
"default": function _default() {
|
|
1995
|
-
return [
|
|
1996
|
-
}
|
|
1997
|
-
}), showFocusShortcutsIcon && vue.createVNode(DropDown.ButtonIconWrapper, {
|
|
1998
|
-
"onClick": function onClick(e) {
|
|
1999
|
-
return _this8.focusSearchBox(e);
|
|
2000
|
-
}
|
|
2001
|
-
}, _isSlot(_slot5 = _this8.renderShortcut()) ? _slot5 : {
|
|
2002
|
-
"default": function _default() {
|
|
2003
|
-
return [_slot5];
|
|
1878
|
+
return [_slot3];
|
|
2004
1879
|
}
|
|
2005
1880
|
}), showVoiceSearch && vue.createVNode(Mic, {
|
|
2006
1881
|
"getInstance": getMicInstance,
|
|
2007
1882
|
"render": renderMic,
|
|
2008
|
-
"handleResult":
|
|
1883
|
+
"handleResult": _this7.handleVoiceResults,
|
|
2009
1884
|
"className": getClassName$1(innerClass, 'mic') || null
|
|
2010
1885
|
}, null), iconPosition === 'right' && showIcon && vue.createVNode(DropDown.IconWrapper, {
|
|
2011
|
-
"onClick":
|
|
2012
|
-
}, _isSlot(
|
|
1886
|
+
"onClick": _this7.handleSearchIconClick
|
|
1887
|
+
}, _isSlot(_slot4 = _this7.renderIcon()) ? _slot4 : {
|
|
2013
1888
|
"default": function _default() {
|
|
2014
|
-
return [
|
|
1889
|
+
return [_slot4];
|
|
1890
|
+
}
|
|
1891
|
+
})];
|
|
1892
|
+
}
|
|
1893
|
+
}), vue.createVNode(DropDown.IconGroup, {
|
|
1894
|
+
"groupPosition": "left",
|
|
1895
|
+
"positionType": "absolute"
|
|
1896
|
+
}, {
|
|
1897
|
+
"default": function _default() {
|
|
1898
|
+
return [iconPosition === 'left' && showIcon && vue.createVNode(DropDown.IconWrapper, {
|
|
1899
|
+
"onClick": _this7.handleSearchIconClick
|
|
1900
|
+
}, _isSlot(_slot5 = _this7.renderIcon()) ? _slot5 : {
|
|
1901
|
+
"default": function _default() {
|
|
1902
|
+
return [_slot5];
|
|
2015
1903
|
}
|
|
2016
1904
|
})];
|
|
2017
1905
|
}
|
|
2018
1906
|
})]);
|
|
2019
1907
|
},
|
|
2020
1908
|
focusSearchBox: function focusSearchBox(event) {
|
|
2021
|
-
var _this$$
|
|
1909
|
+
var _this$$refs2, _this$$refs2$this$$pr;
|
|
2022
1910
|
var elt = event.target || event.srcElement;
|
|
2023
1911
|
var tagName = elt.tagName;
|
|
2024
1912
|
if (elt.isContentEditable || tagName === 'INPUT' || tagName === 'SELECT' || tagName === 'TEXTAREA') {
|
|
2025
1913
|
// already in an input
|
|
2026
1914
|
return;
|
|
2027
1915
|
}
|
|
2028
|
-
(_this$$
|
|
1916
|
+
(_this$$refs2 = this.$refs) == null ? void 0 : (_this$$refs2$this$$pr = _this$$refs2[this.$props.innerRef]) == null ? void 0 : _this$$refs2$this$$pr.focus(); // eslint-disable-line
|
|
2029
1917
|
},
|
|
2030
1918
|
listenForFocusShortcuts: function listenForFocusShortcuts() {
|
|
2031
|
-
var
|
|
1919
|
+
var _this8 = this;
|
|
2032
1920
|
var _this$$props$focusSho = this.$props.focusShortcuts,
|
|
2033
1921
|
focusShortcuts = _this$$props$focusSho === void 0 ? ['/'] : _this$$props$focusSho;
|
|
2034
1922
|
if (index.isEmpty(focusShortcuts)) {
|
|
@@ -2043,7 +1931,7 @@ var SearchBox = vue.defineComponent({
|
|
|
2043
1931
|
function (event, handler) {
|
|
2044
1932
|
// Prevent the default refresh event under WINDOWS system
|
|
2045
1933
|
event.preventDefault();
|
|
2046
|
-
|
|
1934
|
+
_this8.focusSearchBox(event);
|
|
2047
1935
|
});
|
|
2048
1936
|
|
|
2049
1937
|
// if one of modifier keys are used, they are handled below
|
|
@@ -2053,7 +1941,7 @@ var SearchBox = vue.defineComponent({
|
|
|
2053
1941
|
for (var index$1 = 0; index$1 < modifierKeys.length; index$1 += 1) {
|
|
2054
1942
|
var element = modifierKeys[index$1];
|
|
2055
1943
|
if (hotkeys[element]) {
|
|
2056
|
-
|
|
1944
|
+
_this8.focusSearchBox(event);
|
|
2057
1945
|
break;
|
|
2058
1946
|
}
|
|
2059
1947
|
}
|
|
@@ -2065,34 +1953,19 @@ var SearchBox = vue.defineComponent({
|
|
|
2065
1953
|
this.currentValue = index.decodeHtml(value);
|
|
2066
1954
|
this.triggerDefaultQuery(value);
|
|
2067
1955
|
},
|
|
2068
|
-
|
|
2069
|
-
var
|
|
1956
|
+
renderAutoFill: function renderAutoFill(suggestion) {
|
|
1957
|
+
var _this9 = this;
|
|
2070
1958
|
var handleAutoFillClick = function handleAutoFillClick(e) {
|
|
2071
1959
|
e.stopPropagation();
|
|
2072
|
-
|
|
1960
|
+
_this9.onAutofillClick(suggestion);
|
|
2073
1961
|
};
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
transform: 'rotate(135deg)',
|
|
2079
|
-
pointerEvents: 'none'
|
|
2080
|
-
}
|
|
2081
|
-
}, null);
|
|
2082
|
-
}
|
|
2083
|
-
return null;
|
|
2084
|
-
}
|
|
2085
|
-
if (!suggestion._category) {
|
|
2086
|
-
/* 👇 avoid showing autofill for category suggestions👇 */
|
|
2087
|
-
|
|
2088
|
-
return vue.createVNode(AutoFillSvg, {
|
|
2089
|
-
"onClick": handleAutoFillClick
|
|
2090
|
-
}, null);
|
|
2091
|
-
}
|
|
2092
|
-
return null;
|
|
1962
|
+
/* 👇 avoid showing autofill for category suggestions👇 */
|
|
1963
|
+
return suggestion._category ? null : vue.createVNode(AutoFillSvg, {
|
|
1964
|
+
"onClick": handleAutoFillClick
|
|
1965
|
+
}, null);
|
|
2093
1966
|
},
|
|
2094
1967
|
renderTag: function renderTag(item) {
|
|
2095
|
-
var
|
|
1968
|
+
var _this10 = this;
|
|
2096
1969
|
var innerClass = this.$props.innerClass;
|
|
2097
1970
|
return vue.createVNode(TagItem, {
|
|
2098
1971
|
"class": getClassName$1(innerClass, 'selected-tag') || ''
|
|
@@ -2103,7 +1976,7 @@ var SearchBox = vue.defineComponent({
|
|
|
2103
1976
|
"aria-label": "delete-tag",
|
|
2104
1977
|
"class": "close-icon",
|
|
2105
1978
|
"onClick": function onClick() {
|
|
2106
|
-
return
|
|
1979
|
+
return _this10.clearTag(item);
|
|
2107
1980
|
}
|
|
2108
1981
|
}, [vue.createVNode(DropDown.CancelSvg, null, null)])];
|
|
2109
1982
|
}
|
|
@@ -2126,7 +1999,7 @@ var SearchBox = vue.defineComponent({
|
|
|
2126
1999
|
}
|
|
2127
2000
|
},
|
|
2128
2001
|
renderTags: function renderTags() {
|
|
2129
|
-
var
|
|
2002
|
+
var _this11 = this;
|
|
2130
2003
|
if (!Array.isArray(this.selectedTags)) {
|
|
2131
2004
|
return null;
|
|
2132
2005
|
}
|
|
@@ -2140,16 +2013,16 @@ var SearchBox = vue.defineComponent({
|
|
|
2140
2013
|
}) : vue.createVNode(TagsContainer, null, {
|
|
2141
2014
|
"default": function _default() {
|
|
2142
2015
|
return [tagsList.map(function (item) {
|
|
2143
|
-
return
|
|
2016
|
+
return _this11.renderTag(item);
|
|
2144
2017
|
}), shouldRenderClearAllTag && vue.createVNode(TagItem, {
|
|
2145
|
-
"class": getClassName$1(
|
|
2018
|
+
"class": getClassName$1(_this11.$props.innerClass, 'selected-tag') || ''
|
|
2146
2019
|
}, {
|
|
2147
2020
|
"default": function _default() {
|
|
2148
2021
|
return [vue.createVNode("span", null, [vue.createTextVNode("Clear All")]), vue.createVNode("span", {
|
|
2149
2022
|
"role": "img",
|
|
2150
2023
|
"aria-label": "delete-tag",
|
|
2151
2024
|
"class": "close-icon",
|
|
2152
|
-
"onClick":
|
|
2025
|
+
"onClick": _this11.clearAllTags
|
|
2153
2026
|
}, [vue.createVNode(DropDown.CancelSvg, null, null)])];
|
|
2154
2027
|
}
|
|
2155
2028
|
})];
|
|
@@ -2196,8 +2069,8 @@ var SearchBox = vue.defineComponent({
|
|
|
2196
2069
|
return vue.createVNode(HorizontalSkeletonLoader, null, null);
|
|
2197
2070
|
},
|
|
2198
2071
|
renderAIScreenFooter: function renderAIScreenFooter() {
|
|
2199
|
-
var
|
|
2200
|
-
var
|
|
2072
|
+
var _slot6;
|
|
2073
|
+
var _this12 = this;
|
|
2201
2074
|
var _this$$props$AIUIConf2 = this.$props.AIUIConfig,
|
|
2202
2075
|
AIUIConfig = _this$$props$AIUIConf2 === void 0 ? {} : _this$$props$AIUIConf2;
|
|
2203
2076
|
var _ref6 = AIUIConfig || {},
|
|
@@ -2211,9 +2084,9 @@ var SearchBox = vue.defineComponent({
|
|
|
2211
2084
|
"themePreset": this.$props.themePreset
|
|
2212
2085
|
}, {
|
|
2213
2086
|
"default": function _default() {
|
|
2214
|
-
return [vue.createTextVNode("Summary generated using the following sources:"), ' ', vue.createVNode(SourceTags, null, _isSlot(
|
|
2087
|
+
return [vue.createTextVNode("Summary generated using the following sources:"), ' ', vue.createVNode(SourceTags, null, _isSlot(_slot6 = _this12.getAISourceObjects().map(function (el) {
|
|
2215
2088
|
return vue.createVNode(Button.Button, {
|
|
2216
|
-
"class": "--ai-source-tag " + (getClassName$1(
|
|
2089
|
+
"class": "--ai-source-tag " + (getClassName$1(_this12.$props.innerClass, 'ai-source-tag') || ''),
|
|
2217
2090
|
"title": el[sourceDocumentLabel],
|
|
2218
2091
|
"info": true,
|
|
2219
2092
|
"onClick": function onClick() {
|
|
@@ -2224,16 +2097,16 @@ var SearchBox = vue.defineComponent({
|
|
|
2224
2097
|
return [el[sourceDocumentLabel]];
|
|
2225
2098
|
}
|
|
2226
2099
|
});
|
|
2227
|
-
})) ?
|
|
2100
|
+
})) ? _slot6 : {
|
|
2228
2101
|
"default": function _default() {
|
|
2229
|
-
return [
|
|
2102
|
+
return [_slot6];
|
|
2230
2103
|
}
|
|
2231
2104
|
})];
|
|
2232
2105
|
}
|
|
2233
2106
|
}) : null;
|
|
2234
2107
|
},
|
|
2235
2108
|
renderAIScreen: function renderAIScreen() {
|
|
2236
|
-
var
|
|
2109
|
+
var _this13 = this;
|
|
2237
2110
|
var customAIRenderer = this.$props.renderAIAnswer || this.$slots.renderAIAnswer;
|
|
2238
2111
|
if (customAIRenderer) {
|
|
2239
2112
|
return customAIRenderer({
|
|
@@ -2257,11 +2130,11 @@ var SearchBox = vue.defineComponent({
|
|
|
2257
2130
|
"hideUI": this.isAIResponseLoading || this.isLoading || !this.sessionIdFromStore,
|
|
2258
2131
|
"key": this.sessionIdFromStore,
|
|
2259
2132
|
"onFeedbackSubmit": function onFeedbackSubmit(useful, reason) {
|
|
2260
|
-
|
|
2133
|
+
_this13.feedbackState = {
|
|
2261
2134
|
isRecorded: true,
|
|
2262
2135
|
feedbackType: useful ? 'positive' : 'negative'
|
|
2263
2136
|
};
|
|
2264
|
-
|
|
2137
|
+
_this13.recordAISessionUsefulness(_this13.sessionIdFromStore, {
|
|
2265
2138
|
useful: useful,
|
|
2266
2139
|
reason: reason
|
|
2267
2140
|
});
|
|
@@ -2296,22 +2169,22 @@ var SearchBox = vue.defineComponent({
|
|
|
2296
2169
|
});
|
|
2297
2170
|
},
|
|
2298
2171
|
renderAskButtonElement: function renderAskButtonElement() {
|
|
2299
|
-
var
|
|
2300
|
-
var _this$$
|
|
2301
|
-
AIUIConfig = _this$$
|
|
2302
|
-
innerClass = _this$$
|
|
2172
|
+
var _this14 = this;
|
|
2173
|
+
var _this$$props4 = this.$props,
|
|
2174
|
+
AIUIConfig = _this$$props4.AIUIConfig,
|
|
2175
|
+
innerClass = _this$$props4.innerClass;
|
|
2303
2176
|
var _ref7 = AIUIConfig || {},
|
|
2304
2177
|
askButton = _ref7.askButton;
|
|
2305
2178
|
var renderAskButton = this.$slots.renderAskButton;
|
|
2306
2179
|
if (askButton) {
|
|
2307
2180
|
var getEnterButtonMarkup = function getEnterButtonMarkup() {
|
|
2308
2181
|
if (renderAskButton) {
|
|
2309
|
-
return renderAskButton(
|
|
2182
|
+
return renderAskButton(_this14.askButtonOnClick);
|
|
2310
2183
|
}
|
|
2311
2184
|
return vue.createVNode(Button.Button, {
|
|
2312
2185
|
"class": "enter-btn " + getClassName$1(innerClass, 'ask-button'),
|
|
2313
2186
|
"info": true,
|
|
2314
|
-
"onClick":
|
|
2187
|
+
"onClick": _this14.askButtonOnClick
|
|
2315
2188
|
}, {
|
|
2316
2189
|
"default": function _default() {
|
|
2317
2190
|
return [vue.createTextVNode("Ask")];
|
|
@@ -2326,7 +2199,7 @@ var SearchBox = vue.defineComponent({
|
|
|
2326
2199
|
}
|
|
2327
2200
|
},
|
|
2328
2201
|
render: function render() {
|
|
2329
|
-
var
|
|
2202
|
+
var _this15 = this;
|
|
2330
2203
|
var expandSuggestionsContainer = this.$props.expandSuggestionsContainer;
|
|
2331
2204
|
var _this$$slots = this.$slots,
|
|
2332
2205
|
recentSearchesIcon = _this$$slots.recentSearchesIcon,
|
|
@@ -2337,17 +2210,17 @@ var SearchBox = vue.defineComponent({
|
|
|
2337
2210
|
"class": this.$props.className
|
|
2338
2211
|
}, {
|
|
2339
2212
|
"default": function _default() {
|
|
2340
|
-
return [
|
|
2341
|
-
"class": getClassName$1(
|
|
2213
|
+
return [_this15.$props.title && vue.createVNode(Title.Title, {
|
|
2214
|
+
"class": getClassName$1(_this15.$props.innerClass, 'title') || ''
|
|
2342
2215
|
}, {
|
|
2343
2216
|
"default": function _default() {
|
|
2344
|
-
return [
|
|
2217
|
+
return [_this15.$props.title];
|
|
2345
2218
|
}
|
|
2346
|
-
}),
|
|
2347
|
-
"id":
|
|
2348
|
-
"handleChange":
|
|
2349
|
-
"handleMouseup":
|
|
2350
|
-
"isOpen":
|
|
2219
|
+
}), _this15.$props.autosuggest ? vue.createVNode(DropDown.Downshift, {
|
|
2220
|
+
"id": _this15.$props.componentId + "-downshift",
|
|
2221
|
+
"handleChange": _this15.onSuggestionSelected,
|
|
2222
|
+
"handleMouseup": _this15.handleStateChange,
|
|
2223
|
+
"isOpen": _this15.$data.isOpen
|
|
2351
2224
|
}, {
|
|
2352
2225
|
"default": function _default(_ref8) {
|
|
2353
2226
|
var getInputEvents = _ref8.getInputEvents,
|
|
@@ -2358,229 +2231,156 @@ var SearchBox = vue.defineComponent({
|
|
|
2358
2231
|
highlightedIndex = _ref8.highlightedIndex,
|
|
2359
2232
|
setHighlightedIndex = _ref8.setHighlightedIndex;
|
|
2360
2233
|
var renderSuggestionsDropdown = function renderSuggestionsDropdown() {
|
|
2361
|
-
var getIcon = function getIcon(iconType
|
|
2234
|
+
var getIcon = function getIcon(iconType) {
|
|
2362
2235
|
switch (iconType) {
|
|
2363
2236
|
case helper.suggestionTypes.Recent:
|
|
2364
2237
|
return recentSearchesIcon;
|
|
2365
2238
|
case helper.suggestionTypes.Popular:
|
|
2366
2239
|
return popularSearchesIcon;
|
|
2367
|
-
case helper.suggestionTypes.Featured:
|
|
2368
|
-
if (item.icon) {
|
|
2369
|
-
return function () {
|
|
2370
|
-
return vue.createVNode("div", {
|
|
2371
|
-
"style": {
|
|
2372
|
-
display: 'flex'
|
|
2373
|
-
},
|
|
2374
|
-
"innerHTML": xss(item.icon)
|
|
2375
|
-
}, null);
|
|
2376
|
-
};
|
|
2377
|
-
}
|
|
2378
|
-
if (item.iconURL) {
|
|
2379
|
-
return function () {
|
|
2380
|
-
return (// When you change below also change the empty icon below
|
|
2381
|
-
vue.createVNode("img", {
|
|
2382
|
-
"style": {
|
|
2383
|
-
maxHeight: '25px'
|
|
2384
|
-
},
|
|
2385
|
-
"src": xss(item.iconURL),
|
|
2386
|
-
"alt": item.value
|
|
2387
|
-
}, null)
|
|
2388
|
-
);
|
|
2389
|
-
};
|
|
2390
|
-
}
|
|
2391
|
-
// Render an empty icon when no icon is provided from the dashboard
|
|
2392
|
-
return function () {
|
|
2393
|
-
return vue.createVNode("span", {
|
|
2394
|
-
"style": {
|
|
2395
|
-
display: 'inline-block',
|
|
2396
|
-
height: '25px',
|
|
2397
|
-
width: leaveSpaceForIcon ? '25px' : 0
|
|
2398
|
-
}
|
|
2399
|
-
}, null);
|
|
2400
|
-
};
|
|
2401
2240
|
default:
|
|
2402
2241
|
return null;
|
|
2403
2242
|
}
|
|
2404
2243
|
};
|
|
2405
|
-
|
|
2406
|
-
return vue.createVNode("div", null, [_this16.hasCustomRenderer && _this16.getComponent({
|
|
2244
|
+
return vue.createVNode("div", null, [_this15.hasCustomRenderer && _this15.getComponent({
|
|
2407
2245
|
isOpen: isOpen,
|
|
2408
2246
|
getItemProps: getItemProps,
|
|
2409
2247
|
getItemEvents: getItemEvents,
|
|
2410
2248
|
highlightedIndex: highlightedIndex
|
|
2411
|
-
}),
|
|
2412
|
-
"class": Input.suggestions(
|
|
2249
|
+
}), _this15.renderErrorComponent(), !_this15.hasCustomRenderer && isOpen && hasSuggestions ? vue.createVNode("ul", {
|
|
2250
|
+
"class": Input.suggestions(_this15.themePreset, _this15.theme) + " " + getClassName$1(_this15.$props.innerClass, 'list'),
|
|
2413
2251
|
"ref": _dropdownULRef
|
|
2414
|
-
}, [
|
|
2415
|
-
"themePreset":
|
|
2252
|
+
}, [_this15.showAIScreen && vue.createVNode(SearchBoxAISection, {
|
|
2253
|
+
"themePreset": _this15.$props.themePreset
|
|
2416
2254
|
}, {
|
|
2417
2255
|
"default": function _default() {
|
|
2418
|
-
return [
|
|
2419
|
-
}
|
|
2420
|
-
}), !_this16.showAIScreen && _this16.parsedSuggestions.map(function (item, itemIndex) {
|
|
2421
|
-
var index = indexOffset + itemIndex;
|
|
2422
|
-
if (Array.isArray(item)) {
|
|
2423
|
-
var sectionHtml = xss(item[0].sectionLabel);
|
|
2424
|
-
indexOffset += item.length - 1;
|
|
2425
|
-
return vue.createVNode("div", {
|
|
2426
|
-
"class": "section-container"
|
|
2427
|
-
}, [sectionHtml ? vue.createVNode("div", {
|
|
2428
|
-
"class": "section-header " + getClassName$1(_this16.$props.innerClass, 'section-label'),
|
|
2429
|
-
"key": "" + item[0].sectionId,
|
|
2430
|
-
"innerHTML": sectionHtml
|
|
2431
|
-
}, null) : null, vue.createVNode("ul", {
|
|
2432
|
-
"class": "section-list"
|
|
2433
|
-
}, [item.map(function (sectionItem, sectionIndex) {
|
|
2434
|
-
var suggestionsHaveIcon = item.some(function (s) {
|
|
2435
|
-
return s.icon || s.iconURL;
|
|
2436
|
-
});
|
|
2437
|
-
return renderItem ? vue.createVNode("li", vue.mergeProps(getItemProps({
|
|
2438
|
-
item: sectionItem
|
|
2439
|
-
}), _transformOn(getItemEvents({
|
|
2440
|
-
item: sectionItem
|
|
2441
|
-
})), {
|
|
2442
|
-
"key": index + sectionIndex,
|
|
2443
|
-
"style": {
|
|
2444
|
-
justifyContent: 'flex-start',
|
|
2445
|
-
alignItems: 'center'
|
|
2446
|
-
},
|
|
2447
|
-
"class": "" + (highlightedIndex === index + sectionIndex ? "active-li-item " + getClassName$1(_this16.$props.innerClass, 'active-suggestion-item') : "li-item " + getClassName$1(_this16.$props.innerClass, 'suggestion-item'))
|
|
2448
|
-
}), [renderItem(sectionItem)]) : vue.createVNode("li", vue.mergeProps(getItemProps({
|
|
2449
|
-
item: sectionItem
|
|
2450
|
-
}), _transformOn(getItemEvents({
|
|
2451
|
-
item: sectionItem
|
|
2452
|
-
})), {
|
|
2453
|
-
"key": index + sectionIndex,
|
|
2454
|
-
"style": {
|
|
2455
|
-
justifyContent: 'flex-start',
|
|
2456
|
-
alignItems: 'center'
|
|
2457
|
-
},
|
|
2458
|
-
"class": "" + (highlightedIndex === index + sectionIndex ? "active-li-item " + getClassName$1(_this16.$props.innerClass, 'active-suggestion-item') : "li-item " + getClassName$1(_this16.$props.innerClass, 'suggestion-item'))
|
|
2459
|
-
}), [vue.createVNode("div", {
|
|
2460
|
-
"style": {
|
|
2461
|
-
padding: '0 10px 0 0',
|
|
2462
|
-
display: 'flex'
|
|
2463
|
-
}
|
|
2464
|
-
}, [vue.createVNode(CustomSvg, {
|
|
2465
|
-
"className": getClassName$1(_this16.$props.innerClass, sectionItem._suggestion_type + "-search-icon") || null,
|
|
2466
|
-
"icon": getIcon(sectionItem._suggestion_type, sectionItem, suggestionsHaveIcon),
|
|
2467
|
-
"type": sectionItem._suggestion_type + "-search-icon"
|
|
2468
|
-
}, null)]), vue.createVNode(SuggestionItem, {
|
|
2469
|
-
"currentValue": _this16.currentValue,
|
|
2470
|
-
"suggestion": sectionItem
|
|
2471
|
-
}, null), _this16.renderActionIcon(sectionItem)]);
|
|
2472
|
-
})])]);
|
|
2256
|
+
return [_this15.renderAIScreen(), ' ', _this15.renderErrorComponent(true)];
|
|
2473
2257
|
}
|
|
2474
|
-
|
|
2475
|
-
|
|
2258
|
+
}), !_this15.showAIScreen && _this15.normalizedSuggestions.map(function (item, index) {
|
|
2259
|
+
return renderItem ? vue.createVNode("li", vue.mergeProps(getItemProps({
|
|
2260
|
+
item: item
|
|
2261
|
+
}), getItemEvents({
|
|
2262
|
+
item: item
|
|
2263
|
+
}), {
|
|
2264
|
+
"key": index + 1 + "-" + item.value,
|
|
2265
|
+
"style": {
|
|
2266
|
+
backgroundColor: _this15.getBackgroundColor(highlightedIndex, index),
|
|
2267
|
+
justifyContent: 'flex-start',
|
|
2268
|
+
alignItems: 'center'
|
|
2269
|
+
}
|
|
2270
|
+
}), [renderItem(item)]) : vue.createVNode("li", vue.mergeProps(getItemProps({
|
|
2271
|
+
item: item
|
|
2272
|
+
}), _transformOn(getItemEvents({
|
|
2273
|
+
item: item
|
|
2274
|
+
})), {
|
|
2275
|
+
"key": index + 1 + "-" + item.value,
|
|
2276
|
+
"style": {
|
|
2277
|
+
backgroundColor: _this15.getBackgroundColor(highlightedIndex, index),
|
|
2278
|
+
justifyContent: 'flex-start',
|
|
2279
|
+
alignItems: 'center'
|
|
2280
|
+
}
|
|
2281
|
+
}), [vue.createVNode("div", {
|
|
2282
|
+
"style": {
|
|
2283
|
+
padding: '0 10px 0 0',
|
|
2284
|
+
display: 'flex'
|
|
2285
|
+
}
|
|
2286
|
+
}, [vue.createVNode(CustomSvg, {
|
|
2287
|
+
"className": getClassName$1(_this15.$props.innerClass, item._suggestion_type + "-search-icon") || null,
|
|
2288
|
+
"icon": getIcon(item._suggestion_type),
|
|
2289
|
+
"type": item._suggestion_type + "-search-icon"
|
|
2290
|
+
}, null)]), vue.createVNode(SuggestionItem, {
|
|
2291
|
+
"currentValue": _this15.currentValue,
|
|
2292
|
+
"suggestion": item
|
|
2293
|
+
}, null), _this15.renderAutoFill(item)]);
|
|
2294
|
+
})]) : _this15.renderNoSuggestions(_this15.normalizedSuggestions)]);
|
|
2476
2295
|
};
|
|
2477
2296
|
return vue.createVNode("div", {
|
|
2478
2297
|
"class": Input.suggestionsContainer
|
|
2479
2298
|
}, [vue.createVNode(InputGroup, {
|
|
2480
|
-
"searchBox": true,
|
|
2481
2299
|
"ref": _inputGroupRef
|
|
2482
2300
|
}, {
|
|
2483
2301
|
"default": function _default() {
|
|
2484
|
-
return [vue.createVNode(
|
|
2485
|
-
"default": function _default() {
|
|
2486
|
-
return [_this16.renderInputAddonBefore(), _this16.renderLeftIcons()];
|
|
2487
|
-
}
|
|
2488
|
-
}), vue.createVNode(DropDown.InputWrapper, null, {
|
|
2302
|
+
return [_this15.renderInputAddonBefore(), vue.createVNode(DropDown.InputWrapper, null, {
|
|
2489
2303
|
"default": function _default() {
|
|
2490
2304
|
return [vue.createVNode(Input.TextArea, vue.mergeProps(_transformOn(getInputEvents({
|
|
2491
|
-
onInput:
|
|
2305
|
+
onInput: _this15.onInputChange,
|
|
2492
2306
|
onBlur: function onBlur(e) {
|
|
2493
|
-
|
|
2307
|
+
_this15.$emit('blur', e, _this15.triggerQuery);
|
|
2494
2308
|
},
|
|
2495
|
-
onFocus:
|
|
2309
|
+
onFocus: _this15.handleFocus,
|
|
2496
2310
|
onKeyPress: function onKeyPress(e) {
|
|
2497
|
-
|
|
2498
|
-
|
|
2311
|
+
_this15.$emit('keyPress', e, _this15.triggerQuery);
|
|
2312
|
+
_this15.$emit('key-press', e, _this15.triggerQuery);
|
|
2499
2313
|
},
|
|
2500
2314
|
onKeyDown: function onKeyDown(e) {
|
|
2501
|
-
return
|
|
2315
|
+
return _this15.handleKeyDown(e, highlightedIndex);
|
|
2502
2316
|
},
|
|
2503
2317
|
onKeyUp: function onKeyUp(e) {
|
|
2504
|
-
|
|
2505
|
-
|
|
2318
|
+
_this15.$emit('keyUp', e, _this15.triggerQuery);
|
|
2319
|
+
_this15.$emit('key-up', e, _this15.triggerQuery);
|
|
2506
2320
|
},
|
|
2507
2321
|
onClick: function onClick() {
|
|
2508
2322
|
setHighlightedIndex(null);
|
|
2509
2323
|
}
|
|
2510
2324
|
})), {
|
|
2511
|
-
"id":
|
|
2512
|
-
"showIcon":
|
|
2513
|
-
"showClear":
|
|
2514
|
-
"iconPosition":
|
|
2515
|
-
"ref":
|
|
2516
|
-
"class": getClassName$1(
|
|
2517
|
-
"placeholder":
|
|
2518
|
-
"autoFocus":
|
|
2519
|
-
"
|
|
2520
|
-
"
|
|
2521
|
-
"showVoiceSearch": _this16.$props.showVoiceSearch
|
|
2325
|
+
"id": _this15.$props.componentId + "-input",
|
|
2326
|
+
"showIcon": _this15.$props.showIcon,
|
|
2327
|
+
"showClear": _this15.$props.showClear,
|
|
2328
|
+
"iconPosition": _this15.$props.iconPosition,
|
|
2329
|
+
"ref": _this15.$props.innerRef,
|
|
2330
|
+
"class": getClassName$1(_this15.$props.innerClass, 'input'),
|
|
2331
|
+
"placeholder": _this15.$props.placeholder,
|
|
2332
|
+
"autoFocus": _this15.$props.autoFocus,
|
|
2333
|
+
"showFocusShortcutsIcon": _this15.$props.showFocusShortcutsIcon,
|
|
2334
|
+
"showVoiceSearch": _this15.$props.showVoiceSearch
|
|
2522
2335
|
}, getInputProps({
|
|
2523
|
-
value:
|
|
2336
|
+
value: _this15.$data.currentValue === null ? '' : _this15.$data.currentValue
|
|
2524
2337
|
}), {
|
|
2525
|
-
"themePreset":
|
|
2338
|
+
"themePreset": _this15.themePreset,
|
|
2526
2339
|
"autocomplete": "off"
|
|
2527
|
-
}), null), !expandSuggestionsContainer && renderSuggestionsDropdown()];
|
|
2528
|
-
}
|
|
2529
|
-
}), vue.createVNode(Input.Actions, null, {
|
|
2530
|
-
"default": function _default() {
|
|
2531
|
-
return [_this16.renderRightIcons(), _this16.renderInputAddonAfter(), _this16.renderAskButtonElement(), _this16.renderEnterButtonElement()];
|
|
2340
|
+
}), null), _this15.renderIcons(), !expandSuggestionsContainer && renderSuggestionsDropdown()];
|
|
2532
2341
|
}
|
|
2533
|
-
})];
|
|
2342
|
+
}), _this15.renderInputAddonAfter(), _this15.renderAskButtonElement(), _this15.renderEnterButtonElement()];
|
|
2534
2343
|
}
|
|
2535
|
-
}), expandSuggestionsContainer && renderSuggestionsDropdown(),
|
|
2344
|
+
}), expandSuggestionsContainer && renderSuggestionsDropdown(), _this15.renderTags()]);
|
|
2536
2345
|
}
|
|
2537
2346
|
}) : vue.createVNode("div", {
|
|
2538
2347
|
"class": Input.suggestionsContainer
|
|
2539
2348
|
}, [vue.createVNode(InputGroup, {
|
|
2540
|
-
"searchBox": true,
|
|
2541
2349
|
"ref": _inputGroupRef
|
|
2542
2350
|
}, {
|
|
2543
2351
|
"default": function _default() {
|
|
2544
|
-
return [vue.createVNode(
|
|
2545
|
-
"default": function _default() {
|
|
2546
|
-
return [_this16.renderInputAddonBefore(), _this16.renderLeftIcons()];
|
|
2547
|
-
}
|
|
2548
|
-
}), vue.createVNode(DropDown.InputWrapper, null, {
|
|
2352
|
+
return [_this15.renderInputAddonBefore(), vue.createVNode(DropDown.InputWrapper, null, {
|
|
2549
2353
|
"default": function _default() {
|
|
2550
2354
|
return [vue.createVNode(Input.TextArea, vue.mergeProps(_transformOn({
|
|
2551
2355
|
blur: function blur(e) {
|
|
2552
|
-
|
|
2356
|
+
_this15.$emit('blur', e, _this15.triggerQuery);
|
|
2553
2357
|
},
|
|
2554
2358
|
keypress: function keypress(e) {
|
|
2555
|
-
|
|
2556
|
-
|
|
2359
|
+
_this15.$emit('keyPress', e, _this15.triggerQuery);
|
|
2360
|
+
_this15.$emit('key-press', e, _this15.triggerQuery);
|
|
2557
2361
|
},
|
|
2558
|
-
input:
|
|
2362
|
+
input: _this15.onInputChange,
|
|
2559
2363
|
focus: function focus(e) {
|
|
2560
|
-
|
|
2364
|
+
_this15.$emit('focus', e, _this15.triggerQuery);
|
|
2561
2365
|
},
|
|
2562
|
-
keydown:
|
|
2366
|
+
keydown: _this15.handleKeyDown,
|
|
2563
2367
|
keyup: function keyup(e) {
|
|
2564
|
-
|
|
2565
|
-
|
|
2368
|
+
_this15.$emit('keyUp', e, _this15.triggerQuery);
|
|
2369
|
+
_this15.$emit('key-up', e, _this15.triggerQuery);
|
|
2566
2370
|
}
|
|
2567
2371
|
}), {
|
|
2568
|
-
"class": getClassName$1(
|
|
2569
|
-
"placeholder":
|
|
2570
|
-
"autofocus":
|
|
2571
|
-
"value":
|
|
2572
|
-
"iconPosition":
|
|
2573
|
-
"showIcon":
|
|
2574
|
-
"showClear":
|
|
2575
|
-
"ref":
|
|
2576
|
-
"themePreset":
|
|
2577
|
-
}), null)];
|
|
2372
|
+
"class": getClassName$1(_this15.$props.innerClass, 'input') || '',
|
|
2373
|
+
"placeholder": _this15.$props.placeholder,
|
|
2374
|
+
"autofocus": _this15.$props.autoFocus,
|
|
2375
|
+
"value": _this15.$data.currentValue ? _this15.$data.currentValue : '',
|
|
2376
|
+
"iconPosition": _this15.$props.iconPosition,
|
|
2377
|
+
"showIcon": _this15.$props.showIcon,
|
|
2378
|
+
"showClear": _this15.$props.showClear,
|
|
2379
|
+
"ref": _this15.$props.innerRef,
|
|
2380
|
+
"themePreset": _this15.themePreset
|
|
2381
|
+
}), null), _this15.renderIcons()];
|
|
2578
2382
|
}
|
|
2579
|
-
}),
|
|
2580
|
-
"default": function _default() {
|
|
2581
|
-
return [_this16.renderRightIcons(), _this16.renderInputAddonAfter(), _this16.renderEnterButtonElement()];
|
|
2582
|
-
}
|
|
2583
|
-
})];
|
|
2383
|
+
}), _this15.renderInputAddonAfter(), _this15.renderEnterButtonElement()];
|
|
2584
2384
|
}
|
|
2585
2385
|
})])];
|
|
2586
2386
|
}
|
|
@@ -3265,8 +3065,8 @@ AIConnected.install = function (Vue) {
|
|
|
3265
3065
|
// Add componentType for SSR
|
|
3266
3066
|
AIConnected.componentType = constants.componentTypes.AIAnswer;
|
|
3267
3067
|
|
|
3268
|
-
var _templateObject$
|
|
3269
|
-
var HierarchicalMenuList = vueEmotion.styled('ul')(_templateObject$
|
|
3068
|
+
var _templateObject$8, _templateObject2$4;
|
|
3069
|
+
var HierarchicalMenuList = vueEmotion.styled('ul')(_templateObject$8 || (_templateObject$8 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tlist-style: none;\n\tpadding: 0;\n\tmargin: 0;\n\tmax-height: 0;\n\toverflow: hidden;\n\n\t&.--open {\n\t\tmax-height: 100%;\n\t}\n"])));
|
|
3270
3070
|
var HierarchicalMenuListItem = vueEmotion.styled('li')(_templateObject2$4 || (_templateObject2$4 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tfont-weight: 400;\n\tline-height: 1.5;\n\tbox-sizing: border-box;\n\n\ta {\n\t\tcolor: #424242;\n\t\ttext-decoration: none;\n\t\tgap: 5px;\n\t\t.--leaf-icon,\n\t\t.--folder-icon {\n\t\t\tline-height: 15px;\n\t\t\tsvg {\n\t\t\t\theight: 15px;\n\t\t\t}\n\t\t}\n\n\t\tinput {\n\t\t\tmargin: 0;\n\t\t\tcursor: pointer;\n\t\t}\n\t}\n\n\t.--switcher-icon {\n\t\ttransition: all 0.2s ease-in;\n\t\tmargin-right: 2px;\n\t}\n\t.--list-child {\n\t\tpadding-left: 1rem;\n\t\tposition: relative;\n\t\t&:before {\n\t\t\theight: 100%;\n\t\t\tcontent: '';\n\t\t\tposition: absolute;\n\t\t\tborder-left: 1px solid #787878;\n\t\t\twidth: 0;\n\t\t\tleft: 19px;\n\t\t\t", ";\n\t\t}\n\n\t\t&.--show-switcher-icon {\n\t\t\tpadding-left: 36px;\n\t\t}\n\t}\n\t.--list-item-label {\n\t\tline-height: 100%;\n\t}\n\t.--list-item-count {\n\t\tmargin-left: 10px;\n\t\tpadding: 0.1rem 0.4rem;\n\t\tfont-size: 0.8rem;\n\t\tcolor: #424242;\n\t\tbackground-color: #dee1e6;\n\t\tborder-radius: 8px;\n\t}\n\t&.-selected-item {\n\t\tfont-weight: 700 !important;\n\t}\n\t&.-expanded-item {\n\t\t& > a {\n\t\t\t& div > .--switcher-icon {\n\t\t\t\ttransform: rotate(90deg);\n\t\t\t}\n\t\t}\n\t}\n\t.--list-item-label-count-wrapper {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\t&:hover {\n\t\t\t.--list-item-count,\n\t\t\t.--list-item-label {\n\t\t\t\tfont-weight: 700;\n\t\t\t}\n\t\t}\n\t}\n"])), function (props) {
|
|
3271
3071
|
return !props.showLine && "\n\t\t\t\t\tdisplay: none;\n\t\t\t\t";
|
|
3272
3072
|
});
|