@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
|
@@ -4,7 +4,7 @@ import _transformOn from '@vue/babel-helper-vue-transform-on';
|
|
|
4
4
|
import { _ as _taggedTemplateLiteralLoose, a as _extends, b as _objectWithoutPropertiesLoose } from './_rollupPluginBabelHelpers-ded08042.js';
|
|
5
5
|
import { createVNode, createTextVNode, defineComponent, ref, watch, isVNode, mergeProps, h } from 'vue';
|
|
6
6
|
import VueTypes from 'vue-types';
|
|
7
|
-
import { getQueryOptions,
|
|
7
|
+
import { getQueryOptions, getObjectFromLocalStorage, suggestionTypes, getClassName as getClassName$2, setObjectInLocalStorage, recLookup, updateCustomQuery as updateCustomQuery$1, updateDefaultQuery as updateDefaultQuery$1, transformTreeListLocalStateIntoQueryComptaibleFormat, isEqual as isEqual$1, transformRawTreeListData, setDeep, getComponent as getComponent$1, getOptionsFromQuery, checkValueChange as checkValueChange$1, getAggsQuery, updateInternalQuery, isFunction as isFunction$1 } from '@appbaseio/reactivecore/lib/utils/helper';
|
|
8
8
|
import { styled } from '@appbaseio/vue-emotion';
|
|
9
9
|
import { css, keyframes } from '@emotion/css';
|
|
10
10
|
import { lighten } from 'polished';
|
|
@@ -22,9 +22,8 @@ import { recordAISessionUsefulness } from '@appbaseio/reactivecore/lib/actions/a
|
|
|
22
22
|
import ReactiveBase from './ReactiveBase.js';
|
|
23
23
|
import hotkeys from 'hotkeys-js';
|
|
24
24
|
import { Remarkable } from 'remarkable';
|
|
25
|
-
import
|
|
26
|
-
import {
|
|
27
|
-
import { n as noSuggestions, T as TextArea, I as Input, s as suggestionsContainer, A as Actions$1, a as suggestions, b as searchboxSuggestions } from './Input-4cd74b38.js';
|
|
25
|
+
import { I as IconWrapper, C as CancelSvg, a as IconGroup, D as Downshift, b as InputWrapper } from './DropDown-39fedff8.js';
|
|
26
|
+
import { n as noSuggestions, T as TextArea, I as Input, s as suggestionsContainer, a as suggestions } from './Input-11d211d2.js';
|
|
28
27
|
import { C as Container } from './Container-d00219f7.js';
|
|
29
28
|
import Highlight from 'vue-highlight-words';
|
|
30
29
|
import { fetchAIResponse, createAISession } from '@appbaseio/reactivecore/lib/actions/query';
|
|
@@ -49,13 +48,7 @@ import ResultList from './ResultList.js';
|
|
|
49
48
|
import StateProvider from './StateProvider.js';
|
|
50
49
|
|
|
51
50
|
var _templateObject;
|
|
52
|
-
var InputGroup = styled('div')(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n
|
|
53
|
-
var theme = _ref.theme,
|
|
54
|
-
searchBox = _ref.searchBox;
|
|
55
|
-
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}";
|
|
56
|
-
}, function (props) {
|
|
57
|
-
return props.isOpen && 'box-shadow: rgb(0 0 0 / 20%) 0px 0px 15px;';
|
|
58
|
-
});
|
|
51
|
+
var InputGroup = styled('div')(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n\tdisplay: flex;\n\talign-items: stretch;\n\twidth: 100%;\n"])));
|
|
59
52
|
InputGroup.defaultProps = {
|
|
60
53
|
className: 'input-group'
|
|
61
54
|
};
|
|
@@ -785,11 +778,8 @@ var _templateObject$4, _templateObject2;
|
|
|
785
778
|
var TagsContainer = styled('div')(_templateObject$4 || (_templateObject$4 = _taggedTemplateLiteralLoose(["\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tmargin-top: 10px;\n\twidth: 100%;\n"])));
|
|
786
779
|
var TagItem = styled('span')(_templateObject2 || (_templateObject2 = _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"])));
|
|
787
780
|
|
|
788
|
-
var _templateObject$5;
|
|
789
|
-
var
|
|
790
|
-
|
|
791
|
-
var _templateObject$6, _templateObject2$1, _templateObject3;
|
|
792
|
-
var skeletonAnimation = keyframes(_templateObject$6 || (_templateObject$6 = _taggedTemplateLiteralLoose(["\n 0% {\n background-position: 100% 0;\n }\n 100% {\n background-position: -200% 0;\n }\n"])));
|
|
781
|
+
var _templateObject$5, _templateObject2$1, _templateObject3;
|
|
782
|
+
var skeletonAnimation = keyframes(_templateObject$5 || (_templateObject$5 = _taggedTemplateLiteralLoose(["\n 0% {\n background-position: 100% 0;\n }\n 100% {\n background-position: -200% 0;\n }\n"])));
|
|
793
783
|
var SkeletonLoader = styled('div')(_templateObject2$1 || (_templateObject2$1 = _taggedTemplateLiteralLoose(["\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 10px;\n"])));
|
|
794
784
|
var SkeletonLine = styled('div')(_templateObject3 || (_templateObject3 = _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);
|
|
795
785
|
var HorizontalSkeletonLoader = defineComponent({
|
|
@@ -803,8 +793,8 @@ var HorizontalSkeletonLoader = defineComponent({
|
|
|
803
793
|
}
|
|
804
794
|
});
|
|
805
795
|
|
|
806
|
-
var _templateObject$
|
|
807
|
-
var Chatbox = styled('div')(_templateObject$
|
|
796
|
+
var _templateObject$6, _templateObject2$2, _templateObject3$1, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11;
|
|
797
|
+
var Chatbox = styled('div')(_templateObject$6 || (_templateObject$6 = _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) {
|
|
808
798
|
return props.theme && props.theme.colors ? props.theme.colors.backgroundColor : '#fff';
|
|
809
799
|
});
|
|
810
800
|
var ChatContainer = styled('div')(_templateObject2$2 || (_templateObject2$2 = _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) {
|
|
@@ -879,8 +869,8 @@ var MessageInput = styled(TextArea)(_templateObject9 || (_templateObject9 = _tag
|
|
|
879
869
|
var SendButton = styled(Button)(_templateObject10 || (_templateObject10 = _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"])));
|
|
880
870
|
var AIFeedbackContainer = styled('div')(_templateObject11 || (_templateObject11 = _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"])));
|
|
881
871
|
|
|
882
|
-
var _templateObject$
|
|
883
|
-
var fadeInFromBottom = keyframes(_templateObject$
|
|
872
|
+
var _templateObject$7, _templateObject2$3, _templateObject3$2, _templateObject4$1, _templateObject5$1, _templateObject6$1, _templateObject7$1;
|
|
873
|
+
var fadeInFromBottom = keyframes(_templateObject$7 || (_templateObject$7 = _taggedTemplateLiteralLoose(["\n 0% {\n opacity: 0;\n transform: translateY(20px);\n }\n 100% {\n opacity: 1;\n transform: translateY(0);\n }\n"])));
|
|
884
874
|
var fadeInFromTop = keyframes(_templateObject2$3 || (_templateObject2$3 = _taggedTemplateLiteralLoose(["\n 0% {\n opacity: 0;\n transform: translateY(-20px);\n }\n 100% {\n opacity: 1;\n transform: translateY(0);\n }\n"])));
|
|
885
875
|
var SearchBoxAISection = styled('div')(_templateObject3$2 || (_templateObject3$2 = _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) {
|
|
886
876
|
var themePreset = _ref.themePreset,
|
|
@@ -1153,26 +1143,6 @@ var SearchBox = defineComponent({
|
|
|
1153
1143
|
},
|
|
1154
1144
|
stats: function stats() {
|
|
1155
1145
|
return getResultStats(this);
|
|
1156
|
-
},
|
|
1157
|
-
parsedSuggestions: function parsedSuggestions() {
|
|
1158
|
-
var suggestionsArray = [];
|
|
1159
|
-
if (Array.isArray(this.suggestions) && this.suggestions.length) {
|
|
1160
|
-
suggestionsArray = [].concat(withClickIds(this.suggestions));
|
|
1161
|
-
}
|
|
1162
|
-
var sectionsAccumulated = [];
|
|
1163
|
-
var sectionisedSuggestions = suggestionsArray.reduce(function (acc, d, currentIndex) {
|
|
1164
|
-
if (sectionsAccumulated.includes(d.sectionId)) return acc;
|
|
1165
|
-
if (d.sectionId) {
|
|
1166
|
-
acc[currentIndex] = suggestionsArray.filter(function (g) {
|
|
1167
|
-
return g.sectionId === d.sectionId;
|
|
1168
|
-
});
|
|
1169
|
-
sectionsAccumulated.push(d.sectionId);
|
|
1170
|
-
} else {
|
|
1171
|
-
acc[currentIndex] = d;
|
|
1172
|
-
}
|
|
1173
|
-
return acc;
|
|
1174
|
-
}, {});
|
|
1175
|
-
return Object.values(sectionisedSuggestions);
|
|
1176
1146
|
}
|
|
1177
1147
|
},
|
|
1178
1148
|
props: {
|
|
@@ -1239,20 +1209,12 @@ var SearchBox = defineComponent({
|
|
|
1239
1209
|
distinctFieldConfig: types.props,
|
|
1240
1210
|
//
|
|
1241
1211
|
focusShortcuts: VueTypes.arrayOf(VueTypes.oneOfType([VueTypes.string, VueTypes.number])).def(['/']),
|
|
1242
|
-
showFocusShortcutsIcon: VueTypes.bool.def(true),
|
|
1243
1212
|
addonBefore: VueTypes.any,
|
|
1244
1213
|
addonAfter: VueTypes.any,
|
|
1245
|
-
showSuggestionsFooter: VueTypes.bool.def(true),
|
|
1246
1214
|
expandSuggestionsContainer: VueTypes.bool.def(true),
|
|
1247
|
-
renderSuggestionsFooter: VueTypes.func,
|
|
1248
1215
|
index: VueTypes.string,
|
|
1249
1216
|
popularSuggestionsConfig: VueTypes.object,
|
|
1250
1217
|
recentSuggestionsConfig: VueTypes.object,
|
|
1251
|
-
featuredSuggestionsConfig: VueTypes.shape({
|
|
1252
|
-
maxSuggestionsPerSection: VueTypes.number,
|
|
1253
|
-
sectionsOrder: VueTypes.arrayOf(VueTypes.string)
|
|
1254
|
-
}),
|
|
1255
|
-
customEvents: VueTypes.object,
|
|
1256
1218
|
applyStopwords: VueTypes.bool,
|
|
1257
1219
|
customStopwords: types.stringArray,
|
|
1258
1220
|
onData: types.func,
|
|
@@ -1698,52 +1660,12 @@ var SearchBox = defineComponent({
|
|
|
1698
1660
|
}, e);
|
|
1699
1661
|
}
|
|
1700
1662
|
},
|
|
1701
|
-
handleFeaturedSuggestionClicked: function handleFeaturedSuggestionClicked(suggestion) {
|
|
1702
|
-
try {
|
|
1703
|
-
var _this$$refs2, _this$$refs2$this$$pr;
|
|
1704
|
-
if (suggestion.action === featuredSuggestionsActionTypes.NAVIGATE) {
|
|
1705
|
-
var _JSON$parse = JSON.parse(suggestion.subAction),
|
|
1706
|
-
_JSON$parse$target = _JSON$parse.target,
|
|
1707
|
-
target = _JSON$parse$target === void 0 ? '_self' : _JSON$parse$target,
|
|
1708
|
-
_JSON$parse$link = _JSON$parse.link,
|
|
1709
|
-
link = _JSON$parse$link === void 0 ? '/' : _JSON$parse$link;
|
|
1710
|
-
if (typeof window !== 'undefined') {
|
|
1711
|
-
window.open(link, target);
|
|
1712
|
-
}
|
|
1713
|
-
}
|
|
1714
|
-
if (suggestion.action === featuredSuggestionsActionTypes.FUNCTION) {
|
|
1715
|
-
var matchedValues = suggestion.subAction.match(/function\s*\(.*\)(.|\n)*/);
|
|
1716
|
-
var functionStr = matchedValues && matchedValues[0];
|
|
1717
|
-
// eslint-disable-next-line no-new-func
|
|
1718
|
-
var func = new Function("return " + functionStr)();
|
|
1719
|
-
func(suggestion, this.$data.currentValue, this.$props.customEvents);
|
|
1720
|
-
}
|
|
1721
|
-
if (suggestion.action === featuredSuggestionsActionTypes.SELECT) {
|
|
1722
|
-
this.setValue(suggestion.value, true, this.$props, this.$options.isTagsMode.current ? causes.SUGGESTION_SELECT : causes.ENTER_PRESS);
|
|
1723
|
-
this.onValueSelectedHandler(suggestion.value, causes.SUGGESTION_SELECT);
|
|
1724
|
-
}
|
|
1725
|
-
// blur is important to close the dropdown
|
|
1726
|
-
// on selecting one of featured suggestions
|
|
1727
|
-
// else Downshift probably is focusing the dropdown
|
|
1728
|
-
// and not letting it close
|
|
1729
|
-
// eslint-disable-next-line no-unused-expressions
|
|
1730
|
-
(_this$$refs2 = this.$refs) == null ? void 0 : (_this$$refs2$this$$pr = _this$$refs2[this.$props.innerRef]) == null ? void 0 : _this$$refs2$this$$pr.blur();
|
|
1731
|
-
} catch (e) {
|
|
1732
|
-
console.error("Error: There was an error parsing the subAction for the featured suggestion with label, \"" + suggestion.label + "\"", e);
|
|
1733
|
-
}
|
|
1734
|
-
},
|
|
1735
1663
|
onSuggestionSelected: function onSuggestionSelected(suggestion) {
|
|
1736
1664
|
var _this4 = this;
|
|
1737
1665
|
if (!this.$props.enableAI) this.isOpen = false;else {
|
|
1738
1666
|
this.showAIScreen = true;
|
|
1739
1667
|
}
|
|
1740
1668
|
var value = this.$props.value;
|
|
1741
|
-
|
|
1742
|
-
// handle featured suggestions click event
|
|
1743
|
-
if (suggestion._suggestion_type === suggestionTypes.Featured) {
|
|
1744
|
-
this.handleFeaturedSuggestionClicked(suggestion);
|
|
1745
|
-
return;
|
|
1746
|
-
}
|
|
1747
1669
|
// Record analytics for selected suggestions
|
|
1748
1670
|
this.triggerClickAnalytics(suggestion._click_id);
|
|
1749
1671
|
if (value === undefined) {
|
|
@@ -1899,13 +1821,6 @@ var SearchBox = defineComponent({
|
|
|
1899
1821
|
customQuery: true
|
|
1900
1822
|
});
|
|
1901
1823
|
},
|
|
1902
|
-
suggestionsFooter: function suggestionsFooter() {
|
|
1903
|
-
return typeof renderSuggestionsFooter === 'function' ? this.$props.renderSuggestionsFooter() : createVNode(AutosuggestFooterContainer, null, {
|
|
1904
|
-
"default": function _default() {
|
|
1905
|
-
return [createVNode("div", null, [createTextVNode("\u2191\u2193 Navigate")]), createVNode("div", null, [createTextVNode("\u21A9 Go")])];
|
|
1906
|
-
}
|
|
1907
|
-
});
|
|
1908
|
-
},
|
|
1909
1824
|
renderEnterButtonElement: function renderEnterButtonElement() {
|
|
1910
1825
|
var _this6 = this;
|
|
1911
1826
|
var _this$$props2 = this.$props,
|
|
@@ -1933,98 +1848,71 @@ var SearchBox = defineComponent({
|
|
|
1933
1848
|
}
|
|
1934
1849
|
return null;
|
|
1935
1850
|
},
|
|
1936
|
-
|
|
1937
|
-
if (this.$props.focusShortcuts && this.$props.focusShortcuts.length) {
|
|
1938
|
-
var shortcut = this.$props.focusShortcuts[0];
|
|
1939
|
-
shortcut = shortcut.toLowerCase();
|
|
1940
|
-
shortcut = shortcut.replace('shift', '⬆️');
|
|
1941
|
-
shortcut = shortcut.replace('command', 'cmd');
|
|
1942
|
-
shortcut = shortcut.replace('control', 'ctrl');
|
|
1943
|
-
shortcut = shortcut.replace('option', 'alt');
|
|
1944
|
-
return shortcut.toUpperCase();
|
|
1945
|
-
}
|
|
1946
|
-
return '/';
|
|
1947
|
-
},
|
|
1948
|
-
renderLeftIcons: function renderLeftIcons() {
|
|
1851
|
+
renderIcons: function renderIcons() {
|
|
1949
1852
|
var _this7 = this;
|
|
1950
|
-
var _slot3;
|
|
1853
|
+
var _slot3, _slot4, _slot5;
|
|
1951
1854
|
var _this$$props3 = this.$props,
|
|
1952
1855
|
iconPosition = _this$$props3.iconPosition,
|
|
1856
|
+
showClear = _this$$props3.showClear,
|
|
1857
|
+
innerClass = _this$$props3.innerClass,
|
|
1858
|
+
getMicInstance = _this$$props3.getMicInstance,
|
|
1859
|
+
showVoiceSearch = _this$$props3.showVoiceSearch,
|
|
1953
1860
|
showIcon = _this$$props3.showIcon;
|
|
1954
|
-
return createVNode("div", null, [createVNode(IconGroup, {
|
|
1955
|
-
"groupPosition": "left"
|
|
1956
|
-
}, {
|
|
1957
|
-
"default": function _default() {
|
|
1958
|
-
return [iconPosition === 'left' && showIcon && createVNode(IconWrapper, {
|
|
1959
|
-
"onClick": _this7.handleSearchIconClick
|
|
1960
|
-
}, _isSlot(_slot3 = _this7.renderIcon()) ? _slot3 : {
|
|
1961
|
-
"default": function _default() {
|
|
1962
|
-
return [_slot3];
|
|
1963
|
-
}
|
|
1964
|
-
})];
|
|
1965
|
-
}
|
|
1966
|
-
})]);
|
|
1967
|
-
},
|
|
1968
|
-
renderRightIcons: function renderRightIcons() {
|
|
1969
|
-
var _this8 = this;
|
|
1970
|
-
var _slot4, _slot5, _slot6;
|
|
1971
|
-
var _this$$props4 = this.$props,
|
|
1972
|
-
iconPosition = _this$$props4.iconPosition,
|
|
1973
|
-
showClear = _this$$props4.showClear,
|
|
1974
|
-
innerClass = _this$$props4.innerClass,
|
|
1975
|
-
getMicInstance = _this$$props4.getMicInstance,
|
|
1976
|
-
showVoiceSearch = _this$$props4.showVoiceSearch,
|
|
1977
|
-
showIcon = _this$$props4.showIcon,
|
|
1978
|
-
showFocusShortcutsIcon = _this$$props4.showFocusShortcutsIcon;
|
|
1979
1861
|
var renderMic = this.$slots.renderMic || this.$props.renderMic;
|
|
1980
1862
|
var currentValue = this.$data.currentValue;
|
|
1981
1863
|
return createVNode("div", null, [createVNode(IconGroup, {
|
|
1982
|
-
"groupPosition": "right"
|
|
1864
|
+
"groupPosition": "right",
|
|
1865
|
+
"positionType": "absolute"
|
|
1983
1866
|
}, {
|
|
1984
1867
|
"default": function _default() {
|
|
1985
1868
|
return [currentValue && showClear && createVNode(IconWrapper, {
|
|
1986
|
-
"onClick":
|
|
1869
|
+
"onClick": _this7.clearValue,
|
|
1987
1870
|
"showIcon": showIcon,
|
|
1988
1871
|
"isClearIcon": true
|
|
1989
|
-
}, _isSlot(
|
|
1872
|
+
}, _isSlot(_slot3 = _this7.renderCancelIcon()) ? _slot3 : {
|
|
1990
1873
|
"default": function _default() {
|
|
1991
|
-
return [
|
|
1992
|
-
}
|
|
1993
|
-
}), showFocusShortcutsIcon && createVNode(ButtonIconWrapper, {
|
|
1994
|
-
"onClick": function onClick(e) {
|
|
1995
|
-
return _this8.focusSearchBox(e);
|
|
1996
|
-
}
|
|
1997
|
-
}, _isSlot(_slot5 = _this8.renderShortcut()) ? _slot5 : {
|
|
1998
|
-
"default": function _default() {
|
|
1999
|
-
return [_slot5];
|
|
1874
|
+
return [_slot3];
|
|
2000
1875
|
}
|
|
2001
1876
|
}), showVoiceSearch && createVNode(Mic, {
|
|
2002
1877
|
"getInstance": getMicInstance,
|
|
2003
1878
|
"render": renderMic,
|
|
2004
|
-
"handleResult":
|
|
1879
|
+
"handleResult": _this7.handleVoiceResults,
|
|
2005
1880
|
"className": getClassName$1(innerClass, 'mic') || null
|
|
2006
1881
|
}, null), iconPosition === 'right' && showIcon && createVNode(IconWrapper, {
|
|
2007
|
-
"onClick":
|
|
2008
|
-
}, _isSlot(
|
|
1882
|
+
"onClick": _this7.handleSearchIconClick
|
|
1883
|
+
}, _isSlot(_slot4 = _this7.renderIcon()) ? _slot4 : {
|
|
2009
1884
|
"default": function _default() {
|
|
2010
|
-
return [
|
|
1885
|
+
return [_slot4];
|
|
1886
|
+
}
|
|
1887
|
+
})];
|
|
1888
|
+
}
|
|
1889
|
+
}), createVNode(IconGroup, {
|
|
1890
|
+
"groupPosition": "left",
|
|
1891
|
+
"positionType": "absolute"
|
|
1892
|
+
}, {
|
|
1893
|
+
"default": function _default() {
|
|
1894
|
+
return [iconPosition === 'left' && showIcon && createVNode(IconWrapper, {
|
|
1895
|
+
"onClick": _this7.handleSearchIconClick
|
|
1896
|
+
}, _isSlot(_slot5 = _this7.renderIcon()) ? _slot5 : {
|
|
1897
|
+
"default": function _default() {
|
|
1898
|
+
return [_slot5];
|
|
2011
1899
|
}
|
|
2012
1900
|
})];
|
|
2013
1901
|
}
|
|
2014
1902
|
})]);
|
|
2015
1903
|
},
|
|
2016
1904
|
focusSearchBox: function focusSearchBox(event) {
|
|
2017
|
-
var _this$$
|
|
1905
|
+
var _this$$refs2, _this$$refs2$this$$pr;
|
|
2018
1906
|
var elt = event.target || event.srcElement;
|
|
2019
1907
|
var tagName = elt.tagName;
|
|
2020
1908
|
if (elt.isContentEditable || tagName === 'INPUT' || tagName === 'SELECT' || tagName === 'TEXTAREA') {
|
|
2021
1909
|
// already in an input
|
|
2022
1910
|
return;
|
|
2023
1911
|
}
|
|
2024
|
-
(_this$$
|
|
1912
|
+
(_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
|
|
2025
1913
|
},
|
|
2026
1914
|
listenForFocusShortcuts: function listenForFocusShortcuts() {
|
|
2027
|
-
var
|
|
1915
|
+
var _this8 = this;
|
|
2028
1916
|
var _this$$props$focusSho = this.$props.focusShortcuts,
|
|
2029
1917
|
focusShortcuts = _this$$props$focusSho === void 0 ? ['/'] : _this$$props$focusSho;
|
|
2030
1918
|
if (isEmpty(focusShortcuts)) {
|
|
@@ -2039,7 +1927,7 @@ var SearchBox = defineComponent({
|
|
|
2039
1927
|
function (event, handler) {
|
|
2040
1928
|
// Prevent the default refresh event under WINDOWS system
|
|
2041
1929
|
event.preventDefault();
|
|
2042
|
-
|
|
1930
|
+
_this8.focusSearchBox(event);
|
|
2043
1931
|
});
|
|
2044
1932
|
|
|
2045
1933
|
// if one of modifier keys are used, they are handled below
|
|
@@ -2049,7 +1937,7 @@ var SearchBox = defineComponent({
|
|
|
2049
1937
|
for (var index = 0; index < modifierKeys.length; index += 1) {
|
|
2050
1938
|
var element = modifierKeys[index];
|
|
2051
1939
|
if (hotkeys[element]) {
|
|
2052
|
-
|
|
1940
|
+
_this8.focusSearchBox(event);
|
|
2053
1941
|
break;
|
|
2054
1942
|
}
|
|
2055
1943
|
}
|
|
@@ -2061,34 +1949,19 @@ var SearchBox = defineComponent({
|
|
|
2061
1949
|
this.currentValue = decodeHtml(value);
|
|
2062
1950
|
this.triggerDefaultQuery(value);
|
|
2063
1951
|
},
|
|
2064
|
-
|
|
2065
|
-
var
|
|
1952
|
+
renderAutoFill: function renderAutoFill(suggestion) {
|
|
1953
|
+
var _this9 = this;
|
|
2066
1954
|
var handleAutoFillClick = function handleAutoFillClick(e) {
|
|
2067
1955
|
e.stopPropagation();
|
|
2068
|
-
|
|
1956
|
+
_this9.onAutofillClick(suggestion);
|
|
2069
1957
|
};
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
transform: 'rotate(135deg)',
|
|
2075
|
-
pointerEvents: 'none'
|
|
2076
|
-
}
|
|
2077
|
-
}, null);
|
|
2078
|
-
}
|
|
2079
|
-
return null;
|
|
2080
|
-
}
|
|
2081
|
-
if (!suggestion._category) {
|
|
2082
|
-
/* 👇 avoid showing autofill for category suggestions👇 */
|
|
2083
|
-
|
|
2084
|
-
return createVNode(AutoFillSvg, {
|
|
2085
|
-
"onClick": handleAutoFillClick
|
|
2086
|
-
}, null);
|
|
2087
|
-
}
|
|
2088
|
-
return null;
|
|
1958
|
+
/* 👇 avoid showing autofill for category suggestions👇 */
|
|
1959
|
+
return suggestion._category ? null : createVNode(AutoFillSvg, {
|
|
1960
|
+
"onClick": handleAutoFillClick
|
|
1961
|
+
}, null);
|
|
2089
1962
|
},
|
|
2090
1963
|
renderTag: function renderTag(item) {
|
|
2091
|
-
var
|
|
1964
|
+
var _this10 = this;
|
|
2092
1965
|
var innerClass = this.$props.innerClass;
|
|
2093
1966
|
return createVNode(TagItem, {
|
|
2094
1967
|
"class": getClassName$1(innerClass, 'selected-tag') || ''
|
|
@@ -2099,7 +1972,7 @@ var SearchBox = defineComponent({
|
|
|
2099
1972
|
"aria-label": "delete-tag",
|
|
2100
1973
|
"class": "close-icon",
|
|
2101
1974
|
"onClick": function onClick() {
|
|
2102
|
-
return
|
|
1975
|
+
return _this10.clearTag(item);
|
|
2103
1976
|
}
|
|
2104
1977
|
}, [createVNode(CancelSvg, null, null)])];
|
|
2105
1978
|
}
|
|
@@ -2122,7 +1995,7 @@ var SearchBox = defineComponent({
|
|
|
2122
1995
|
}
|
|
2123
1996
|
},
|
|
2124
1997
|
renderTags: function renderTags() {
|
|
2125
|
-
var
|
|
1998
|
+
var _this11 = this;
|
|
2126
1999
|
if (!Array.isArray(this.selectedTags)) {
|
|
2127
2000
|
return null;
|
|
2128
2001
|
}
|
|
@@ -2136,16 +2009,16 @@ var SearchBox = defineComponent({
|
|
|
2136
2009
|
}) : createVNode(TagsContainer, null, {
|
|
2137
2010
|
"default": function _default() {
|
|
2138
2011
|
return [tagsList.map(function (item) {
|
|
2139
|
-
return
|
|
2012
|
+
return _this11.renderTag(item);
|
|
2140
2013
|
}), shouldRenderClearAllTag && createVNode(TagItem, {
|
|
2141
|
-
"class": getClassName$1(
|
|
2014
|
+
"class": getClassName$1(_this11.$props.innerClass, 'selected-tag') || ''
|
|
2142
2015
|
}, {
|
|
2143
2016
|
"default": function _default() {
|
|
2144
2017
|
return [createVNode("span", null, [createTextVNode("Clear All")]), createVNode("span", {
|
|
2145
2018
|
"role": "img",
|
|
2146
2019
|
"aria-label": "delete-tag",
|
|
2147
2020
|
"class": "close-icon",
|
|
2148
|
-
"onClick":
|
|
2021
|
+
"onClick": _this11.clearAllTags
|
|
2149
2022
|
}, [createVNode(CancelSvg, null, null)])];
|
|
2150
2023
|
}
|
|
2151
2024
|
})];
|
|
@@ -2192,8 +2065,8 @@ var SearchBox = defineComponent({
|
|
|
2192
2065
|
return createVNode(HorizontalSkeletonLoader, null, null);
|
|
2193
2066
|
},
|
|
2194
2067
|
renderAIScreenFooter: function renderAIScreenFooter() {
|
|
2195
|
-
var
|
|
2196
|
-
var
|
|
2068
|
+
var _slot6;
|
|
2069
|
+
var _this12 = this;
|
|
2197
2070
|
var _this$$props$AIUIConf2 = this.$props.AIUIConfig,
|
|
2198
2071
|
AIUIConfig = _this$$props$AIUIConf2 === void 0 ? {} : _this$$props$AIUIConf2;
|
|
2199
2072
|
var _ref6 = AIUIConfig || {},
|
|
@@ -2207,9 +2080,9 @@ var SearchBox = defineComponent({
|
|
|
2207
2080
|
"themePreset": this.$props.themePreset
|
|
2208
2081
|
}, {
|
|
2209
2082
|
"default": function _default() {
|
|
2210
|
-
return [createTextVNode("Summary generated using the following sources:"), ' ', createVNode(SourceTags, null, _isSlot(
|
|
2083
|
+
return [createTextVNode("Summary generated using the following sources:"), ' ', createVNode(SourceTags, null, _isSlot(_slot6 = _this12.getAISourceObjects().map(function (el) {
|
|
2211
2084
|
return createVNode(Button, {
|
|
2212
|
-
"class": "--ai-source-tag " + (getClassName$1(
|
|
2085
|
+
"class": "--ai-source-tag " + (getClassName$1(_this12.$props.innerClass, 'ai-source-tag') || ''),
|
|
2213
2086
|
"title": el[sourceDocumentLabel],
|
|
2214
2087
|
"info": true,
|
|
2215
2088
|
"onClick": function onClick() {
|
|
@@ -2220,16 +2093,16 @@ var SearchBox = defineComponent({
|
|
|
2220
2093
|
return [el[sourceDocumentLabel]];
|
|
2221
2094
|
}
|
|
2222
2095
|
});
|
|
2223
|
-
})) ?
|
|
2096
|
+
})) ? _slot6 : {
|
|
2224
2097
|
"default": function _default() {
|
|
2225
|
-
return [
|
|
2098
|
+
return [_slot6];
|
|
2226
2099
|
}
|
|
2227
2100
|
})];
|
|
2228
2101
|
}
|
|
2229
2102
|
}) : null;
|
|
2230
2103
|
},
|
|
2231
2104
|
renderAIScreen: function renderAIScreen() {
|
|
2232
|
-
var
|
|
2105
|
+
var _this13 = this;
|
|
2233
2106
|
var customAIRenderer = this.$props.renderAIAnswer || this.$slots.renderAIAnswer;
|
|
2234
2107
|
if (customAIRenderer) {
|
|
2235
2108
|
return customAIRenderer({
|
|
@@ -2253,11 +2126,11 @@ var SearchBox = defineComponent({
|
|
|
2253
2126
|
"hideUI": this.isAIResponseLoading || this.isLoading || !this.sessionIdFromStore,
|
|
2254
2127
|
"key": this.sessionIdFromStore,
|
|
2255
2128
|
"onFeedbackSubmit": function onFeedbackSubmit(useful, reason) {
|
|
2256
|
-
|
|
2129
|
+
_this13.feedbackState = {
|
|
2257
2130
|
isRecorded: true,
|
|
2258
2131
|
feedbackType: useful ? 'positive' : 'negative'
|
|
2259
2132
|
};
|
|
2260
|
-
|
|
2133
|
+
_this13.recordAISessionUsefulness(_this13.sessionIdFromStore, {
|
|
2261
2134
|
useful: useful,
|
|
2262
2135
|
reason: reason
|
|
2263
2136
|
});
|
|
@@ -2292,22 +2165,22 @@ var SearchBox = defineComponent({
|
|
|
2292
2165
|
});
|
|
2293
2166
|
},
|
|
2294
2167
|
renderAskButtonElement: function renderAskButtonElement() {
|
|
2295
|
-
var
|
|
2296
|
-
var _this$$
|
|
2297
|
-
AIUIConfig = _this$$
|
|
2298
|
-
innerClass = _this$$
|
|
2168
|
+
var _this14 = this;
|
|
2169
|
+
var _this$$props4 = this.$props,
|
|
2170
|
+
AIUIConfig = _this$$props4.AIUIConfig,
|
|
2171
|
+
innerClass = _this$$props4.innerClass;
|
|
2299
2172
|
var _ref7 = AIUIConfig || {},
|
|
2300
2173
|
askButton = _ref7.askButton;
|
|
2301
2174
|
var renderAskButton = this.$slots.renderAskButton;
|
|
2302
2175
|
if (askButton) {
|
|
2303
2176
|
var getEnterButtonMarkup = function getEnterButtonMarkup() {
|
|
2304
2177
|
if (renderAskButton) {
|
|
2305
|
-
return renderAskButton(
|
|
2178
|
+
return renderAskButton(_this14.askButtonOnClick);
|
|
2306
2179
|
}
|
|
2307
2180
|
return createVNode(Button, {
|
|
2308
2181
|
"class": "enter-btn " + getClassName$1(innerClass, 'ask-button'),
|
|
2309
2182
|
"info": true,
|
|
2310
|
-
"onClick":
|
|
2183
|
+
"onClick": _this14.askButtonOnClick
|
|
2311
2184
|
}, {
|
|
2312
2185
|
"default": function _default() {
|
|
2313
2186
|
return [createTextVNode("Ask")];
|
|
@@ -2322,7 +2195,7 @@ var SearchBox = defineComponent({
|
|
|
2322
2195
|
}
|
|
2323
2196
|
},
|
|
2324
2197
|
render: function render() {
|
|
2325
|
-
var
|
|
2198
|
+
var _this15 = this;
|
|
2326
2199
|
var expandSuggestionsContainer = this.$props.expandSuggestionsContainer;
|
|
2327
2200
|
var _this$$slots = this.$slots,
|
|
2328
2201
|
recentSearchesIcon = _this$$slots.recentSearchesIcon,
|
|
@@ -2333,17 +2206,17 @@ var SearchBox = defineComponent({
|
|
|
2333
2206
|
"class": this.$props.className
|
|
2334
2207
|
}, {
|
|
2335
2208
|
"default": function _default() {
|
|
2336
|
-
return [
|
|
2337
|
-
"class": getClassName$1(
|
|
2209
|
+
return [_this15.$props.title && createVNode(Title, {
|
|
2210
|
+
"class": getClassName$1(_this15.$props.innerClass, 'title') || ''
|
|
2338
2211
|
}, {
|
|
2339
2212
|
"default": function _default() {
|
|
2340
|
-
return [
|
|
2213
|
+
return [_this15.$props.title];
|
|
2341
2214
|
}
|
|
2342
|
-
}),
|
|
2343
|
-
"id":
|
|
2344
|
-
"handleChange":
|
|
2345
|
-
"handleMouseup":
|
|
2346
|
-
"isOpen":
|
|
2215
|
+
}), _this15.$props.autosuggest ? createVNode(Downshift, {
|
|
2216
|
+
"id": _this15.$props.componentId + "-downshift",
|
|
2217
|
+
"handleChange": _this15.onSuggestionSelected,
|
|
2218
|
+
"handleMouseup": _this15.handleStateChange,
|
|
2219
|
+
"isOpen": _this15.$data.isOpen
|
|
2347
2220
|
}, {
|
|
2348
2221
|
"default": function _default(_ref8) {
|
|
2349
2222
|
var getInputEvents = _ref8.getInputEvents,
|
|
@@ -2354,229 +2227,156 @@ var SearchBox = defineComponent({
|
|
|
2354
2227
|
highlightedIndex = _ref8.highlightedIndex,
|
|
2355
2228
|
setHighlightedIndex = _ref8.setHighlightedIndex;
|
|
2356
2229
|
var renderSuggestionsDropdown = function renderSuggestionsDropdown() {
|
|
2357
|
-
var getIcon = function getIcon(iconType
|
|
2230
|
+
var getIcon = function getIcon(iconType) {
|
|
2358
2231
|
switch (iconType) {
|
|
2359
2232
|
case suggestionTypes.Recent:
|
|
2360
2233
|
return recentSearchesIcon;
|
|
2361
2234
|
case suggestionTypes.Popular:
|
|
2362
2235
|
return popularSearchesIcon;
|
|
2363
|
-
case suggestionTypes.Featured:
|
|
2364
|
-
if (item.icon) {
|
|
2365
|
-
return function () {
|
|
2366
|
-
return createVNode("div", {
|
|
2367
|
-
"style": {
|
|
2368
|
-
display: 'flex'
|
|
2369
|
-
},
|
|
2370
|
-
"innerHTML": xss(item.icon)
|
|
2371
|
-
}, null);
|
|
2372
|
-
};
|
|
2373
|
-
}
|
|
2374
|
-
if (item.iconURL) {
|
|
2375
|
-
return function () {
|
|
2376
|
-
return (// When you change below also change the empty icon below
|
|
2377
|
-
createVNode("img", {
|
|
2378
|
-
"style": {
|
|
2379
|
-
maxHeight: '25px'
|
|
2380
|
-
},
|
|
2381
|
-
"src": xss(item.iconURL),
|
|
2382
|
-
"alt": item.value
|
|
2383
|
-
}, null)
|
|
2384
|
-
);
|
|
2385
|
-
};
|
|
2386
|
-
}
|
|
2387
|
-
// Render an empty icon when no icon is provided from the dashboard
|
|
2388
|
-
return function () {
|
|
2389
|
-
return createVNode("span", {
|
|
2390
|
-
"style": {
|
|
2391
|
-
display: 'inline-block',
|
|
2392
|
-
height: '25px',
|
|
2393
|
-
width: leaveSpaceForIcon ? '25px' : 0
|
|
2394
|
-
}
|
|
2395
|
-
}, null);
|
|
2396
|
-
};
|
|
2397
2236
|
default:
|
|
2398
2237
|
return null;
|
|
2399
2238
|
}
|
|
2400
2239
|
};
|
|
2401
|
-
|
|
2402
|
-
return createVNode("div", null, [_this16.hasCustomRenderer && _this16.getComponent({
|
|
2240
|
+
return createVNode("div", null, [_this15.hasCustomRenderer && _this15.getComponent({
|
|
2403
2241
|
isOpen: isOpen,
|
|
2404
2242
|
getItemProps: getItemProps,
|
|
2405
2243
|
getItemEvents: getItemEvents,
|
|
2406
2244
|
highlightedIndex: highlightedIndex
|
|
2407
|
-
}),
|
|
2408
|
-
"class": suggestions(
|
|
2245
|
+
}), _this15.renderErrorComponent(), !_this15.hasCustomRenderer && isOpen && hasSuggestions ? createVNode("ul", {
|
|
2246
|
+
"class": suggestions(_this15.themePreset, _this15.theme) + " " + getClassName$1(_this15.$props.innerClass, 'list'),
|
|
2409
2247
|
"ref": _dropdownULRef
|
|
2410
|
-
}, [
|
|
2411
|
-
"themePreset":
|
|
2248
|
+
}, [_this15.showAIScreen && createVNode(SearchBoxAISection, {
|
|
2249
|
+
"themePreset": _this15.$props.themePreset
|
|
2412
2250
|
}, {
|
|
2413
2251
|
"default": function _default() {
|
|
2414
|
-
return [
|
|
2415
|
-
}
|
|
2416
|
-
}), !_this16.showAIScreen && _this16.parsedSuggestions.map(function (item, itemIndex) {
|
|
2417
|
-
var index = indexOffset + itemIndex;
|
|
2418
|
-
if (Array.isArray(item)) {
|
|
2419
|
-
var sectionHtml = xss(item[0].sectionLabel);
|
|
2420
|
-
indexOffset += item.length - 1;
|
|
2421
|
-
return createVNode("div", {
|
|
2422
|
-
"class": "section-container"
|
|
2423
|
-
}, [sectionHtml ? createVNode("div", {
|
|
2424
|
-
"class": "section-header " + getClassName$1(_this16.$props.innerClass, 'section-label'),
|
|
2425
|
-
"key": "" + item[0].sectionId,
|
|
2426
|
-
"innerHTML": sectionHtml
|
|
2427
|
-
}, null) : null, createVNode("ul", {
|
|
2428
|
-
"class": "section-list"
|
|
2429
|
-
}, [item.map(function (sectionItem, sectionIndex) {
|
|
2430
|
-
var suggestionsHaveIcon = item.some(function (s) {
|
|
2431
|
-
return s.icon || s.iconURL;
|
|
2432
|
-
});
|
|
2433
|
-
return renderItem ? createVNode("li", mergeProps(getItemProps({
|
|
2434
|
-
item: sectionItem
|
|
2435
|
-
}), _transformOn(getItemEvents({
|
|
2436
|
-
item: sectionItem
|
|
2437
|
-
})), {
|
|
2438
|
-
"key": index + sectionIndex,
|
|
2439
|
-
"style": {
|
|
2440
|
-
justifyContent: 'flex-start',
|
|
2441
|
-
alignItems: 'center'
|
|
2442
|
-
},
|
|
2443
|
-
"class": "" + (highlightedIndex === index + sectionIndex ? "active-li-item " + getClassName$1(_this16.$props.innerClass, 'active-suggestion-item') : "li-item " + getClassName$1(_this16.$props.innerClass, 'suggestion-item'))
|
|
2444
|
-
}), [renderItem(sectionItem)]) : createVNode("li", mergeProps(getItemProps({
|
|
2445
|
-
item: sectionItem
|
|
2446
|
-
}), _transformOn(getItemEvents({
|
|
2447
|
-
item: sectionItem
|
|
2448
|
-
})), {
|
|
2449
|
-
"key": index + sectionIndex,
|
|
2450
|
-
"style": {
|
|
2451
|
-
justifyContent: 'flex-start',
|
|
2452
|
-
alignItems: 'center'
|
|
2453
|
-
},
|
|
2454
|
-
"class": "" + (highlightedIndex === index + sectionIndex ? "active-li-item " + getClassName$1(_this16.$props.innerClass, 'active-suggestion-item') : "li-item " + getClassName$1(_this16.$props.innerClass, 'suggestion-item'))
|
|
2455
|
-
}), [createVNode("div", {
|
|
2456
|
-
"style": {
|
|
2457
|
-
padding: '0 10px 0 0',
|
|
2458
|
-
display: 'flex'
|
|
2459
|
-
}
|
|
2460
|
-
}, [createVNode(CustomSvg, {
|
|
2461
|
-
"className": getClassName$1(_this16.$props.innerClass, sectionItem._suggestion_type + "-search-icon") || null,
|
|
2462
|
-
"icon": getIcon(sectionItem._suggestion_type, sectionItem, suggestionsHaveIcon),
|
|
2463
|
-
"type": sectionItem._suggestion_type + "-search-icon"
|
|
2464
|
-
}, null)]), createVNode(SuggestionItem, {
|
|
2465
|
-
"currentValue": _this16.currentValue,
|
|
2466
|
-
"suggestion": sectionItem
|
|
2467
|
-
}, null), _this16.renderActionIcon(sectionItem)]);
|
|
2468
|
-
})])]);
|
|
2252
|
+
return [_this15.renderAIScreen(), ' ', _this15.renderErrorComponent(true)];
|
|
2469
2253
|
}
|
|
2470
|
-
|
|
2471
|
-
|
|
2254
|
+
}), !_this15.showAIScreen && _this15.normalizedSuggestions.map(function (item, index) {
|
|
2255
|
+
return renderItem ? createVNode("li", mergeProps(getItemProps({
|
|
2256
|
+
item: item
|
|
2257
|
+
}), getItemEvents({
|
|
2258
|
+
item: item
|
|
2259
|
+
}), {
|
|
2260
|
+
"key": index + 1 + "-" + item.value,
|
|
2261
|
+
"style": {
|
|
2262
|
+
backgroundColor: _this15.getBackgroundColor(highlightedIndex, index),
|
|
2263
|
+
justifyContent: 'flex-start',
|
|
2264
|
+
alignItems: 'center'
|
|
2265
|
+
}
|
|
2266
|
+
}), [renderItem(item)]) : createVNode("li", mergeProps(getItemProps({
|
|
2267
|
+
item: item
|
|
2268
|
+
}), _transformOn(getItemEvents({
|
|
2269
|
+
item: item
|
|
2270
|
+
})), {
|
|
2271
|
+
"key": index + 1 + "-" + item.value,
|
|
2272
|
+
"style": {
|
|
2273
|
+
backgroundColor: _this15.getBackgroundColor(highlightedIndex, index),
|
|
2274
|
+
justifyContent: 'flex-start',
|
|
2275
|
+
alignItems: 'center'
|
|
2276
|
+
}
|
|
2277
|
+
}), [createVNode("div", {
|
|
2278
|
+
"style": {
|
|
2279
|
+
padding: '0 10px 0 0',
|
|
2280
|
+
display: 'flex'
|
|
2281
|
+
}
|
|
2282
|
+
}, [createVNode(CustomSvg, {
|
|
2283
|
+
"className": getClassName$1(_this15.$props.innerClass, item._suggestion_type + "-search-icon") || null,
|
|
2284
|
+
"icon": getIcon(item._suggestion_type),
|
|
2285
|
+
"type": item._suggestion_type + "-search-icon"
|
|
2286
|
+
}, null)]), createVNode(SuggestionItem, {
|
|
2287
|
+
"currentValue": _this15.currentValue,
|
|
2288
|
+
"suggestion": item
|
|
2289
|
+
}, null), _this15.renderAutoFill(item)]);
|
|
2290
|
+
})]) : _this15.renderNoSuggestions(_this15.normalizedSuggestions)]);
|
|
2472
2291
|
};
|
|
2473
2292
|
return createVNode("div", {
|
|
2474
2293
|
"class": suggestionsContainer
|
|
2475
2294
|
}, [createVNode(InputGroup, {
|
|
2476
|
-
"searchBox": true,
|
|
2477
2295
|
"ref": _inputGroupRef
|
|
2478
2296
|
}, {
|
|
2479
2297
|
"default": function _default() {
|
|
2480
|
-
return [createVNode(
|
|
2481
|
-
"default": function _default() {
|
|
2482
|
-
return [_this16.renderInputAddonBefore(), _this16.renderLeftIcons()];
|
|
2483
|
-
}
|
|
2484
|
-
}), createVNode(InputWrapper, null, {
|
|
2298
|
+
return [_this15.renderInputAddonBefore(), createVNode(InputWrapper, null, {
|
|
2485
2299
|
"default": function _default() {
|
|
2486
2300
|
return [createVNode(TextArea, mergeProps(_transformOn(getInputEvents({
|
|
2487
|
-
onInput:
|
|
2301
|
+
onInput: _this15.onInputChange,
|
|
2488
2302
|
onBlur: function onBlur(e) {
|
|
2489
|
-
|
|
2303
|
+
_this15.$emit('blur', e, _this15.triggerQuery);
|
|
2490
2304
|
},
|
|
2491
|
-
onFocus:
|
|
2305
|
+
onFocus: _this15.handleFocus,
|
|
2492
2306
|
onKeyPress: function onKeyPress(e) {
|
|
2493
|
-
|
|
2494
|
-
|
|
2307
|
+
_this15.$emit('keyPress', e, _this15.triggerQuery);
|
|
2308
|
+
_this15.$emit('key-press', e, _this15.triggerQuery);
|
|
2495
2309
|
},
|
|
2496
2310
|
onKeyDown: function onKeyDown(e) {
|
|
2497
|
-
return
|
|
2311
|
+
return _this15.handleKeyDown(e, highlightedIndex);
|
|
2498
2312
|
},
|
|
2499
2313
|
onKeyUp: function onKeyUp(e) {
|
|
2500
|
-
|
|
2501
|
-
|
|
2314
|
+
_this15.$emit('keyUp', e, _this15.triggerQuery);
|
|
2315
|
+
_this15.$emit('key-up', e, _this15.triggerQuery);
|
|
2502
2316
|
},
|
|
2503
2317
|
onClick: function onClick() {
|
|
2504
2318
|
setHighlightedIndex(null);
|
|
2505
2319
|
}
|
|
2506
2320
|
})), {
|
|
2507
|
-
"id":
|
|
2508
|
-
"showIcon":
|
|
2509
|
-
"showClear":
|
|
2510
|
-
"iconPosition":
|
|
2511
|
-
"ref":
|
|
2512
|
-
"class": getClassName$1(
|
|
2513
|
-
"placeholder":
|
|
2514
|
-
"autoFocus":
|
|
2515
|
-
"
|
|
2516
|
-
"
|
|
2517
|
-
"showVoiceSearch": _this16.$props.showVoiceSearch
|
|
2321
|
+
"id": _this15.$props.componentId + "-input",
|
|
2322
|
+
"showIcon": _this15.$props.showIcon,
|
|
2323
|
+
"showClear": _this15.$props.showClear,
|
|
2324
|
+
"iconPosition": _this15.$props.iconPosition,
|
|
2325
|
+
"ref": _this15.$props.innerRef,
|
|
2326
|
+
"class": getClassName$1(_this15.$props.innerClass, 'input'),
|
|
2327
|
+
"placeholder": _this15.$props.placeholder,
|
|
2328
|
+
"autoFocus": _this15.$props.autoFocus,
|
|
2329
|
+
"showFocusShortcutsIcon": _this15.$props.showFocusShortcutsIcon,
|
|
2330
|
+
"showVoiceSearch": _this15.$props.showVoiceSearch
|
|
2518
2331
|
}, getInputProps({
|
|
2519
|
-
value:
|
|
2332
|
+
value: _this15.$data.currentValue === null ? '' : _this15.$data.currentValue
|
|
2520
2333
|
}), {
|
|
2521
|
-
"themePreset":
|
|
2334
|
+
"themePreset": _this15.themePreset,
|
|
2522
2335
|
"autocomplete": "off"
|
|
2523
|
-
}), null), !expandSuggestionsContainer && renderSuggestionsDropdown()];
|
|
2524
|
-
}
|
|
2525
|
-
}), createVNode(Actions$1, null, {
|
|
2526
|
-
"default": function _default() {
|
|
2527
|
-
return [_this16.renderRightIcons(), _this16.renderInputAddonAfter(), _this16.renderAskButtonElement(), _this16.renderEnterButtonElement()];
|
|
2336
|
+
}), null), _this15.renderIcons(), !expandSuggestionsContainer && renderSuggestionsDropdown()];
|
|
2528
2337
|
}
|
|
2529
|
-
})];
|
|
2338
|
+
}), _this15.renderInputAddonAfter(), _this15.renderAskButtonElement(), _this15.renderEnterButtonElement()];
|
|
2530
2339
|
}
|
|
2531
|
-
}), expandSuggestionsContainer && renderSuggestionsDropdown(),
|
|
2340
|
+
}), expandSuggestionsContainer && renderSuggestionsDropdown(), _this15.renderTags()]);
|
|
2532
2341
|
}
|
|
2533
2342
|
}) : createVNode("div", {
|
|
2534
2343
|
"class": suggestionsContainer
|
|
2535
2344
|
}, [createVNode(InputGroup, {
|
|
2536
|
-
"searchBox": true,
|
|
2537
2345
|
"ref": _inputGroupRef
|
|
2538
2346
|
}, {
|
|
2539
2347
|
"default": function _default() {
|
|
2540
|
-
return [createVNode(
|
|
2541
|
-
"default": function _default() {
|
|
2542
|
-
return [_this16.renderInputAddonBefore(), _this16.renderLeftIcons()];
|
|
2543
|
-
}
|
|
2544
|
-
}), createVNode(InputWrapper, null, {
|
|
2348
|
+
return [_this15.renderInputAddonBefore(), createVNode(InputWrapper, null, {
|
|
2545
2349
|
"default": function _default() {
|
|
2546
2350
|
return [createVNode(TextArea, mergeProps(_transformOn({
|
|
2547
2351
|
blur: function blur(e) {
|
|
2548
|
-
|
|
2352
|
+
_this15.$emit('blur', e, _this15.triggerQuery);
|
|
2549
2353
|
},
|
|
2550
2354
|
keypress: function keypress(e) {
|
|
2551
|
-
|
|
2552
|
-
|
|
2355
|
+
_this15.$emit('keyPress', e, _this15.triggerQuery);
|
|
2356
|
+
_this15.$emit('key-press', e, _this15.triggerQuery);
|
|
2553
2357
|
},
|
|
2554
|
-
input:
|
|
2358
|
+
input: _this15.onInputChange,
|
|
2555
2359
|
focus: function focus(e) {
|
|
2556
|
-
|
|
2360
|
+
_this15.$emit('focus', e, _this15.triggerQuery);
|
|
2557
2361
|
},
|
|
2558
|
-
keydown:
|
|
2362
|
+
keydown: _this15.handleKeyDown,
|
|
2559
2363
|
keyup: function keyup(e) {
|
|
2560
|
-
|
|
2561
|
-
|
|
2364
|
+
_this15.$emit('keyUp', e, _this15.triggerQuery);
|
|
2365
|
+
_this15.$emit('key-up', e, _this15.triggerQuery);
|
|
2562
2366
|
}
|
|
2563
2367
|
}), {
|
|
2564
|
-
"class": getClassName$1(
|
|
2565
|
-
"placeholder":
|
|
2566
|
-
"autofocus":
|
|
2567
|
-
"value":
|
|
2568
|
-
"iconPosition":
|
|
2569
|
-
"showIcon":
|
|
2570
|
-
"showClear":
|
|
2571
|
-
"ref":
|
|
2572
|
-
"themePreset":
|
|
2573
|
-
}), null)];
|
|
2368
|
+
"class": getClassName$1(_this15.$props.innerClass, 'input') || '',
|
|
2369
|
+
"placeholder": _this15.$props.placeholder,
|
|
2370
|
+
"autofocus": _this15.$props.autoFocus,
|
|
2371
|
+
"value": _this15.$data.currentValue ? _this15.$data.currentValue : '',
|
|
2372
|
+
"iconPosition": _this15.$props.iconPosition,
|
|
2373
|
+
"showIcon": _this15.$props.showIcon,
|
|
2374
|
+
"showClear": _this15.$props.showClear,
|
|
2375
|
+
"ref": _this15.$props.innerRef,
|
|
2376
|
+
"themePreset": _this15.themePreset
|
|
2377
|
+
}), null), _this15.renderIcons()];
|
|
2574
2378
|
}
|
|
2575
|
-
}),
|
|
2576
|
-
"default": function _default() {
|
|
2577
|
-
return [_this16.renderRightIcons(), _this16.renderInputAddonAfter(), _this16.renderEnterButtonElement()];
|
|
2578
|
-
}
|
|
2579
|
-
})];
|
|
2379
|
+
}), _this15.renderInputAddonAfter(), _this15.renderEnterButtonElement()];
|
|
2580
2380
|
}
|
|
2581
2381
|
})])];
|
|
2582
2382
|
}
|
|
@@ -3261,8 +3061,8 @@ AIConnected.install = function (Vue) {
|
|
|
3261
3061
|
// Add componentType for SSR
|
|
3262
3062
|
AIConnected.componentType = componentTypes.AIAnswer;
|
|
3263
3063
|
|
|
3264
|
-
var _templateObject$
|
|
3265
|
-
var HierarchicalMenuList = styled('ul')(_templateObject$
|
|
3064
|
+
var _templateObject$8, _templateObject2$4;
|
|
3065
|
+
var HierarchicalMenuList = styled('ul')(_templateObject$8 || (_templateObject$8 = _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"])));
|
|
3266
3066
|
var HierarchicalMenuListItem = styled('li')(_templateObject2$4 || (_templateObject2$4 = _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) {
|
|
3267
3067
|
return !props.showLine && "\n\t\t\t\t\tdisplay: none;\n\t\t\t\t";
|
|
3268
3068
|
});
|