@appbaseio/reactivesearch-vue 3.0.0-rc.9 → 3.1.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/@appbaseio/reactivesearch-vue.umd.js +23301 -40095
- package/dist/@appbaseio/reactivesearch-vue.umd.js.map +1 -1
- package/dist/@appbaseio/reactivesearch-vue.umd.min.js +32 -32
- package/dist/@appbaseio/reactivesearch-vue.umd.min.js.map +1 -1
- package/dist/cjs/{Button-f96a0570.js → Button-d4da7470.js} +7 -14
- package/dist/cjs/{ComponentWrapper-0b9ffb1a.js → ComponentWrapper-b5c78446.js} +1 -4
- package/dist/cjs/{DropDown-aef75c14.js → DropDown-ec31bd3f.js} +5 -8
- package/dist/cjs/DynamicRangeSlider.js +3 -3
- package/dist/cjs/{Input-56eba499.js → Input-497be42a.js} +1 -71
- package/dist/cjs/MultiDropdownList.js +7 -8
- package/dist/cjs/MultiList.js +5 -5
- package/dist/cjs/MultiRange.js +4 -4
- package/dist/cjs/{Pagination-bcf8af5f.js → Pagination-b953a80a.js} +2 -2
- package/dist/cjs/{PreferencesConsumer-85dee673.js → PreferencesConsumer-7bee3c57.js} +1 -1
- package/dist/cjs/RangeInput.js +5 -5
- package/dist/cjs/RangeSlider.js +4 -4
- package/dist/cjs/ReactiveBase.js +23 -21
- package/dist/cjs/ReactiveComponent.js +4 -4
- package/dist/cjs/ReactiveGoogleMap.js +6 -7
- package/dist/cjs/ReactiveList.js +6 -6
- package/dist/cjs/ResultCard.js +1 -1
- package/dist/cjs/ResultList.js +1 -1
- package/dist/cjs/SelectedFilters.js +3 -4
- package/dist/cjs/SingleDropdownList.js +7 -8
- package/dist/cjs/SingleList.js +5 -5
- package/dist/cjs/SingleRange.js +4 -4
- package/dist/cjs/StateProvider.js +1 -1
- package/dist/cjs/ToggleButton.js +5 -6
- package/dist/cjs/{index-779ed366.js → index-1f41363f.js} +7 -3
- package/dist/cjs/index.js +9 -12
- package/dist/cjs/{install-e8141489.js → install-fd2155c7.js} +164 -1342
- package/dist/cjs/install.js +9 -11
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/{vueTypes-a5f1745e.js → vueTypes-1bf00978.js} +0 -18
- package/dist/es/{Button-5c2cf399.js → Button-fd869491.js} +7 -14
- package/dist/es/{ComponentWrapper-a2635cfc.js → ComponentWrapper-e91c9d43.js} +1 -4
- package/dist/es/{DropDown-39fedff8.js → DropDown-74c20431.js} +5 -8
- package/dist/es/DynamicRangeSlider.js +3 -3
- package/dist/es/{Input-11d211d2.js → Input-f7499ef8.js} +2 -71
- package/dist/es/MultiDropdownList.js +7 -8
- package/dist/es/MultiList.js +5 -5
- package/dist/es/MultiRange.js +4 -4
- package/dist/es/{Pagination-50fc3ef5.js → Pagination-c2745bec.js} +2 -2
- package/dist/es/{PreferencesConsumer-b058d14e.js → PreferencesConsumer-0856ed43.js} +1 -1
- package/dist/es/RangeInput.js +5 -5
- package/dist/es/RangeSlider.js +4 -4
- package/dist/es/ReactiveBase.js +23 -21
- package/dist/es/ReactiveComponent.js +4 -4
- package/dist/es/ReactiveGoogleMap.js +6 -7
- package/dist/es/ReactiveList.js +6 -6
- package/dist/es/ResultCard.js +1 -1
- package/dist/es/ResultList.js +1 -1
- package/dist/es/SelectedFilters.js +3 -4
- package/dist/es/SingleDropdownList.js +7 -8
- package/dist/es/SingleList.js +5 -5
- package/dist/es/SingleRange.js +4 -4
- package/dist/es/StateProvider.js +1 -1
- package/dist/es/ToggleButton.js +5 -6
- package/dist/es/{index-882489e1.js → index-104f1dfb.js} +7 -3
- package/dist/es/index.js +10 -12
- package/dist/es/{install-b785dd55.js → install-db7d6387.js} +170 -1347
- package/dist/es/install.js +9 -11
- package/dist/es/version.js +1 -1
- package/dist/es/{vueTypes-09cab4d3.js → vueTypes-f1923c72.js} +0 -18
- package/package.json +4 -5
|
@@ -1,32 +1,28 @@
|
|
|
1
1
|
import { helper, Actions, causes } from '@appbaseio/reactivecore';
|
|
2
|
-
import { SEARCH_COMPONENTS_MODES, componentTypes,
|
|
2
|
+
import { SEARCH_COMPONENTS_MODES, componentTypes, TREELIST_VALUES_PATH_SEPARATOR } from '@appbaseio/reactivecore/lib/utils/constants';
|
|
3
3
|
import _transformOn from '@vue/babel-helper-vue-transform-on';
|
|
4
|
-
import { _ as _taggedTemplateLiteralLoose, a as _extends
|
|
5
|
-
import { createVNode, createTextVNode, defineComponent,
|
|
4
|
+
import { _ as _taggedTemplateLiteralLoose, a as _extends } from './_rollupPluginBabelHelpers-ded08042.js';
|
|
5
|
+
import { createVNode, createTextVNode, defineComponent, isVNode, mergeProps, h } from 'vue';
|
|
6
6
|
import VueTypes from 'vue-types';
|
|
7
|
-
import { getQueryOptions,
|
|
7
|
+
import { getQueryOptions, suggestionTypes, recLookup, getClassName as getClassName$2, 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
|
-
import { css
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { t as types } from './vueTypes-09cab4d3.js';
|
|
9
|
+
import { css } from '@emotion/css';
|
|
10
|
+
import { B as Button } from './Button-fd869491.js';
|
|
11
|
+
import { t as types } from './vueTypes-f1923c72.js';
|
|
13
12
|
import { RLConnected as ReactiveList } from './ReactiveList.js';
|
|
14
13
|
import { getInternalComponentID } from '@appbaseio/reactivecore/lib/utils/transform';
|
|
15
|
-
import { g as getComponent, h as hasCustomRenderer, f as decodeHtml, i as isQueryIdentical, u as updateDefaultQuery, j as updateCustomQuery, a as isFunction, k as isEmpty, p as parseFocusShortcuts, l as extractModifierKeysFromFocusShortcuts, c as connect } from './index-
|
|
16
|
-
import { C as ComponentWrapper } from './ComponentWrapper-
|
|
17
|
-
import { P as PreferencesConsumer } from './PreferencesConsumer-
|
|
14
|
+
import { g as getComponent, h as hasCustomRenderer, f as decodeHtml, i as isQueryIdentical, u as updateDefaultQuery, j as updateCustomQuery, a as isFunction, k as isEmpty, p as parseFocusShortcuts, l as extractModifierKeysFromFocusShortcuts, c as connect } from './index-104f1dfb.js';
|
|
15
|
+
import { C as ComponentWrapper } from './ComponentWrapper-e91c9d43.js';
|
|
16
|
+
import { P as PreferencesConsumer } from './PreferencesConsumer-0856ed43.js';
|
|
18
17
|
import { T as Title } from './Title-863dfa42.js';
|
|
19
18
|
import { L as ListItem } from './ListItem-e3c6acf4.js';
|
|
20
19
|
import { F as Flex } from './Flex-25792bc3.js';
|
|
21
|
-
import { recordAISessionUsefulness } from '@appbaseio/reactivecore/lib/actions/analytics';
|
|
22
20
|
import ReactiveBase from './ReactiveBase.js';
|
|
23
21
|
import hotkeys from 'hotkeys-js';
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import { n as noSuggestions, T as TextArea, I as Input, s as suggestionsContainer, a as suggestions } from './Input-11d211d2.js';
|
|
22
|
+
import { I as IconWrapper, C as CancelSvg, a as IconGroup, D as Downshift, b as InputWrapper } from './DropDown-74c20431.js';
|
|
23
|
+
import { n as noSuggestions, s as suggestionsContainer, I as Input, a as suggestions } from './Input-f7499ef8.js';
|
|
27
24
|
import { C as Container } from './Container-d00219f7.js';
|
|
28
25
|
import Highlight from 'vue-highlight-words';
|
|
29
|
-
import { fetchAIResponse, createAISession } from '@appbaseio/reactivecore/lib/actions/query';
|
|
30
26
|
import { replaceDiacritics } from '@appbaseio/reactivecore/lib/utils/suggestions';
|
|
31
27
|
import { C as Checkbox, R as Radio } from './FormControlList-fe6eaee4.js';
|
|
32
28
|
import { s as sanitizeObject } from './utils-d7dd4f4e.js';
|
|
@@ -48,7 +44,7 @@ import ResultList from './ResultList.js';
|
|
|
48
44
|
import StateProvider from './StateProvider.js';
|
|
49
45
|
|
|
50
46
|
var _templateObject;
|
|
51
|
-
var InputGroup = styled('div')(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n
|
|
47
|
+
var InputGroup = styled('div')(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: stretch;\n width: 100%;\n"])));
|
|
52
48
|
InputGroup.defaultProps = {
|
|
53
49
|
className: 'input-group'
|
|
54
50
|
};
|
|
@@ -778,306 +774,9 @@ var _templateObject$4, _templateObject2;
|
|
|
778
774
|
var TagsContainer = styled('div')(_templateObject$4 || (_templateObject$4 = _taggedTemplateLiteralLoose(["\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tmargin-top: 10px;\n\twidth: 100%;\n"])));
|
|
779
775
|
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"])));
|
|
780
776
|
|
|
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"])));
|
|
783
|
-
var SkeletonLoader = styled('div')(_templateObject2$1 || (_templateObject2$1 = _taggedTemplateLiteralLoose(["\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 10px;\n"])));
|
|
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);
|
|
785
|
-
var HorizontalSkeletonLoader = defineComponent({
|
|
786
|
-
name: 'HorizontalSkeletonLoader',
|
|
787
|
-
render: function render() {
|
|
788
|
-
return createVNode(SkeletonLoader, null, {
|
|
789
|
-
"default": function _default() {
|
|
790
|
-
return [createVNode(SkeletonLine, null, null), createVNode(SkeletonLine, null, null), createVNode(SkeletonLine, null, null), createVNode(SkeletonLine, null, null)];
|
|
791
|
-
}
|
|
792
|
-
});
|
|
793
|
-
}
|
|
794
|
-
});
|
|
795
|
-
|
|
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) {
|
|
798
|
-
return props.theme && props.theme.colors ? props.theme.colors.backgroundColor : '#fff';
|
|
799
|
-
});
|
|
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) {
|
|
801
|
-
return props.showInput ? 'bottom: 48px;' : '';
|
|
802
|
-
}, function (props) {
|
|
803
|
-
return props.theme && props.theme.colors && props.theme.colors.backgroundColor ? props.theme.colors.backgroundColor : '#fff';
|
|
804
|
-
}, function (props) {
|
|
805
|
-
return props.theme && props.theme.colors && props.theme.colors.backgroundColor ? props.theme.colors.backgroundColor : '#fff';
|
|
806
|
-
}, function (props) {
|
|
807
|
-
return props.showInput ? ".--ai-answer-feedback-container {\n\t\tmargin-top: 15px;\n\t\tmargin-bottom: -10px;\n\t}" : ".--ai-answer-feedback-container {\n\t\tmargin-top: 4px;\n\t}";
|
|
808
|
-
});
|
|
809
|
-
var MessagesContainer = styled('div')(_templateObject3$1 || (_templateObject3$1 = _taggedTemplateLiteralLoose(["\n\tmax-height: 400px;\n overflow-y: auto;\n\tpadding: 10px;\n\tdisplay: flex;\n\tflex-direction: column;\n\tmin-height: 200px;\n\n}};\n"])));
|
|
810
|
-
var typingDots = keyframes(_templateObject4 || (_templateObject4 = _taggedTemplateLiteralLoose(["\n 0% {\n transform: translateY(0);\n }\n 50% {\n transform: translateY(-70%);\n }\n 100% {\n transform: translateY(0);\n }\n"])));
|
|
811
|
-
var TypingIndicator = styled('div')(_templateObject5 || (_templateObject5 = _taggedTemplateLiteralLoose(["\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tmargin: 5px !important;\n"])));
|
|
812
|
-
var TypingDot = styled('div')(_templateObject6 || (_templateObject6 = _taggedTemplateLiteralLoose(["\n\twidth: 6px;\n\theight: 6px;\n\tbackground-color: ", ";\n\tborder-radius: 50%;\n\tmargin: 0 2px !important;\n\tanimation: ", " 1s infinite;\n\t&:nth-child(2) {\n\t\tanimation-delay: 0.2s;\n\t}\n\t&:nth-child(3) {\n\t\tanimation-delay: 0.4s;\n\t}\n"])), function (props) {
|
|
813
|
-
var finalColor;
|
|
814
|
-
if (props.isSender) {
|
|
815
|
-
finalColor = props.themePreset !== 'dark' ? props.theme.colors.primaryTextColor : props.theme.colors.textColor;
|
|
816
|
-
} else {
|
|
817
|
-
finalColor = props.themePreset !== 'dark' ? props.theme.colors.borderColor : props.theme.colors.textColor;
|
|
818
|
-
}
|
|
819
|
-
return finalColor;
|
|
820
|
-
}, typingDots);
|
|
821
|
-
var resetCSS = function resetCSS(props) {
|
|
822
|
-
return "\n\thtml,\n\tbody,\n\tdiv,\n\tspan,\n\tapplet,\n\tobject,\n\tiframe,\n\th1,\n\th2,\n\th3,\n\th4,\n\th5,\n\th6,\n\tp,\n\tblockquote,\n\tpre,\n\ta,\n\tabbr,\n\tacronym,\n\taddress,\n\tbig,\n\tcite,\n\tcode,\n\tdel,\n\tdfn,\n\tem,\n\timg,\n\tins,\n\tkbd,\n\tq,\n\ts,\n\tsamp,\n\tsmall,\n\tstrike,\n\tstrong,\n\tsub,\n\tsup,\n\ttt,\n\tvar,\n\tb,\n\tu,\n\ti,\n\tcenter,\n\tdl,\n\tdt,\n\tdd,\n\tol,\n\tul,\n\tli,\n\tfieldset,\n\tform,\n\tlabel,\n\tlegend,\n\ttable,\n\tcaption,\n\ttbody,\n\ttfoot,\n\tthead,\n\ttr,\n\tth,\n\ttd,\n\tarticle,\n\taside,\n\tcanvas,\n\tdetails,\n\tembed,\n\tfigure,\n\tfigcaption,\n\tfooter,\n\theader,\n\thgroup,\n\tmenu,\n\tnav,\n\toutput,\n\truby,\n\tsection,\n\tsummary,\n\ttime,\n\tmark,\n\taudio,\n\tvideo {\n\t\tmargin: 0;\n\t\tpadding: 0;\n\t\tborder: 0;\n\t\tfont-size: 100%;\n\t\tfont: inherit;\n\t\tvertical-align: baseline;\n\t\toverflow-wrap: anywhere;\n\t}\n\tpre {\n\t\tmargin: 10px auto;\n\t}\n\ttable {\n\t\tmargin: 10px auto;\n\t\tborder-collapse: collapse;\n\t\tborder-spacing: 0;\n\t}\n\ttr {\n\t\tborder-bottom: 1px solid #ccc;\n\t}\n\tth,\n\ttd {\n\t\ttext-align: left;\n\t\tpadding: 4px;\n\t\tborder: 1px solid;\n\t\tborder-collapse: collapse;\n\t}\n\tpre,\n\tcode {\n\t\tpadding: 0.6em 0.4em;\n\t\tbackground: " + (
|
|
823
|
-
// eslint-disable-next-line no-nested-ternary
|
|
824
|
-
props.isSender ? props.themePreset !== 'dark' ? props.theme.colors.primaryColor : props.theme.colors.borderColor : props.theme.colors.borderColor) + ";\n\t}\n\n\tcode {\n\t\tline-height: normal;\n\n\t\tcolor: " + (
|
|
825
|
-
// eslint-disable-next-line no-nested-ternary
|
|
826
|
-
props.isSender ? props.themePreset !== 'dark' ? props.theme.colors.primaryTextColor : props.theme.colors.textColor : props.theme.colors.primaryTextColor) + ";\n\t\tborder-radius: 3px;\n\t\tfont-size: 85%;\n\t\tpadding: 0.2em 0.4em;\n\t\tmargin-top: 5px;\n\t\tdisplay: inline-block;\n\t\toverflow: auto;\n\t\twidth: fit-content;\n\t\tmax-width: 100%;\n\t}\n\tul,\n\tol {\n\t\tlist-style-position: inside;\n\t\tpadding-left: 10px;\n\n\t}\n\n\tli{\n\t\tdisplay: list-item;\n\t\tcursor: default;\n\t\tpadding: initial;\n\n\t\t&:hover{\n\t\t\tbackground-color: initial;\n\t\t}\n\t}\n\tp {\n\t\tmargin: inherit;\n\t}\n";
|
|
827
|
-
};
|
|
828
|
-
var messageBGColor = function messageBGColor(props) {
|
|
829
|
-
var finalBGColor;
|
|
830
|
-
if (props.isSender) {
|
|
831
|
-
finalBGColor = props.themePreset !== 'dark' ? props.theme.colors.primaryColor : props.theme.colors.borderColor;
|
|
832
|
-
} else {
|
|
833
|
-
finalBGColor = props.themePreset !== 'dark' ? lighten(0.53, props.theme.colors.borderColor) : props.theme.colors.backgroundColor;
|
|
834
|
-
}
|
|
835
|
-
return finalBGColor;
|
|
836
|
-
};
|
|
837
|
-
var Message = styled('div')(_templateObject7 || (_templateObject7 = _taggedTemplateLiteralLoose(["\n\tbackground-color: ", ";\n\tcolor: ", ";\n\tborder: 1px solid\n\t\t", ";\n\tpadding: 10px;\n\tborder-radius: 7px;\n\tmargin-bottom: 10px;\n\tmax-width: 80%;\n\talign-self: ", ";\n\tdisplay: inline-block;\n\tposition: relative;\n\toverflow-wrap: anywhere;\n\t", "\n"])), function (props) {
|
|
838
|
-
return messageBGColor(props);
|
|
839
|
-
}, function (props) {
|
|
840
|
-
var finalColor;
|
|
841
|
-
if (props.isSender) {
|
|
842
|
-
finalColor = props.themePreset !== 'dark' ? props.theme.colors.primaryTextColor : props.theme.colors.textColor;
|
|
843
|
-
} else {
|
|
844
|
-
finalColor = props.themePreset !== 'dark' ? props.theme.colors.borderColor : props.theme.colors.textColor;
|
|
845
|
-
}
|
|
846
|
-
return finalColor;
|
|
847
|
-
}, function (props) {
|
|
848
|
-
return props.themePreset === 'dark' ? 'currentColor' : messageBGColor(props);
|
|
849
|
-
}, function (props) {
|
|
850
|
-
return props.isSender ? 'flex-end' : 'flex-start';
|
|
851
|
-
}, function (props) {
|
|
852
|
-
return resetCSS(props);
|
|
853
|
-
});
|
|
854
|
-
var MessageInputContainer = styled('form')(_templateObject8 || (_templateObject8 = _taggedTemplateLiteralLoose(["\n\tdisplay: flex;\n\tpadding-top: 12px;\n\talign-items: stretch;\n\tmargin-top: 10px;\n\t.ai-enter-button-wrapper {\n\t\talign-self: baseline;\n\t\theight: 41px;\n\t}\n"])));
|
|
855
|
-
var MessageInput = styled(TextArea)(_templateObject9 || (_templateObject9 = _taggedTemplateLiteralLoose(["\n\twidth: 100%;\n\tborder-radius: 5px;\n\tborder: 1px solid #ccc;\n\tbackground-color: ", ";\n\tcolor: ", ";\n\n\t::placeholder {\n\t\tcolor: ", ";\n\t}\n\n\t:-ms-input-placeholder {\n\t\tcolor: ", ";\n\t}\n\n\t::-ms-input-placeholder {\n\t\tcolor: ", ";\n\t}\n\t", "\n"])), function (props) {
|
|
856
|
-
return props.themePreset === 'dark' ? props.theme.colors.borderColor : '#fff';
|
|
857
|
-
}, function (props) {
|
|
858
|
-
return props.themePreset === 'dark' ? props.theme.colors.titleColor : props.theme.colors.textColor;
|
|
859
|
-
}, function (props) {
|
|
860
|
-
return props.theme.colors.textColor;
|
|
861
|
-
}, function (props) {
|
|
862
|
-
return props.theme.colors.textColor;
|
|
863
|
-
}, function (props) {
|
|
864
|
-
return props.theme.colors.textColor;
|
|
865
|
-
}, function (_ref) {
|
|
866
|
-
var enterButton = _ref.enterButton;
|
|
867
|
-
return enterButton && "\n\t\t border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n\t";
|
|
868
|
-
});
|
|
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"])));
|
|
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"])));
|
|
871
|
-
|
|
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"])));
|
|
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"])));
|
|
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) {
|
|
876
|
-
var themePreset = _ref.themePreset,
|
|
877
|
-
theme = _ref.theme;
|
|
878
|
-
return themePreset === 'dark' ? '#424242' : theme.colors.backgroundColor;
|
|
879
|
-
}, function (_ref2) {
|
|
880
|
-
var theme = _ref2.theme;
|
|
881
|
-
return theme.colors.textColor;
|
|
882
|
-
});
|
|
883
|
-
var Question = styled('div')(_templateObject4$1 || (_templateObject4$1 = _taggedTemplateLiteralLoose(["\n\tfont-weight: bold;\n\tmargin-bottom: 5px;\n\tanimation: ", " 0.5s ease-out;\n"])), fadeInFromTop);
|
|
884
|
-
var Answer = styled('div')(_templateObject5$1 || (_templateObject5$1 = _taggedTemplateLiteralLoose(["\n\t", "\n\tposition: relative;\n\tmargin-bottom: 5px;\n\tmin-height: 100px;\n\toverflow: auto;\n\twhite-space: pre-wrap;\n\tpre {\n\t\twhite-space: pre-wrap;\n\t}\n\tcode,\n\tpre {\n\t\tdisplay: revert;\n\t}\n"])), function (props) {
|
|
885
|
-
return resetCSS(props);
|
|
886
|
-
});
|
|
887
|
-
var Footer = styled('div')(_templateObject6$1 || (_templateObject6$1 = _taggedTemplateLiteralLoose(["\n\tcolor: #777;\n\tdisplay: inline-flex;\n\talign-items: center;\n\tgap: 1rem;\n\tflex-wrap: wrap;\n\tanimation: ", " 0.5s ease-out;\n\tpadding: 10px 0;\n\tbackground: white;\n\tbackground-color: ", ";\n\tcolor: ", ";\n"])), fadeInFromBottom, function (_ref3) {
|
|
888
|
-
var themePreset = _ref3.themePreset,
|
|
889
|
-
theme = _ref3.theme;
|
|
890
|
-
return themePreset === 'dark' ? '#424242' : theme.colors.backgroundColor;
|
|
891
|
-
}, function (_ref4) {
|
|
892
|
-
var theme = _ref4.theme;
|
|
893
|
-
return theme.colors.textColor;
|
|
894
|
-
});
|
|
895
|
-
var SourceTags = styled('div')(_templateObject7$1 || (_templateObject7$1 = _taggedTemplateLiteralLoose(["\n\tdisplay: flex;\n\tgap: 8px;\n\tflex-wrap: wrap;\n\t.--ai-source-tag {\n\t\tdisplay: inline-block;\n\t\tmax-width: 200px;\n\t\twhite-space: nowrap;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t}\n"])));
|
|
896
|
-
|
|
897
|
-
var ThumbsUpSvg = {
|
|
898
|
-
name: 'ThumbsUpSvg',
|
|
899
|
-
props: ['clickHandler', 'className'],
|
|
900
|
-
render: function render() {
|
|
901
|
-
return createVNode("svg", {
|
|
902
|
-
"stroke": "currentColor",
|
|
903
|
-
"fill": "none",
|
|
904
|
-
"strokeWidth": "2",
|
|
905
|
-
"viewBox": "0 0 24 24",
|
|
906
|
-
"strokeLinecap": "round",
|
|
907
|
-
"strokeLinejoin": "round",
|
|
908
|
-
"class": this.$props.className,
|
|
909
|
-
"height": "1em",
|
|
910
|
-
"width": "1em",
|
|
911
|
-
"xmlns": "http://www.w3.org/2000/svg",
|
|
912
|
-
"onClick": this.$props.clickHandler
|
|
913
|
-
}, [createVNode("path", {
|
|
914
|
-
"d": "M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3"
|
|
915
|
-
}, null)]);
|
|
916
|
-
}
|
|
917
|
-
};
|
|
918
|
-
|
|
919
|
-
var ThumbsDownSvg = {
|
|
920
|
-
name: 'ThumbsDownSvg',
|
|
921
|
-
props: ['clickHandler', 'className'],
|
|
922
|
-
render: function render() {
|
|
923
|
-
return createVNode("svg", {
|
|
924
|
-
"stroke": "currentColor",
|
|
925
|
-
"fill": "none",
|
|
926
|
-
"strokeWidth": "2",
|
|
927
|
-
"viewBox": "0 0 24 24",
|
|
928
|
-
"strokeLinecap": "round",
|
|
929
|
-
"strokeLinejoin": "round",
|
|
930
|
-
"class": this.$props.className,
|
|
931
|
-
"height": "1em",
|
|
932
|
-
"width": "1em",
|
|
933
|
-
"xmlns": "http://www.w3.org/2000/svg",
|
|
934
|
-
"onClick": this.$props.clickHandler
|
|
935
|
-
}, [createVNode("path", {
|
|
936
|
-
"d": "M10 15v4a3 3 0 0 0 3 3l4-9V2H5.72a2 2 0 0 0-2 1.7l-1.38 9a2 2 0 0 0 2 2.3zm7-13h2.67A2.31 2.31 0 0 1 22 4v7a2.31 2.31 0 0 1-2.33 2H17"
|
|
937
|
-
}, null), ' ']);
|
|
938
|
-
}
|
|
939
|
-
};
|
|
940
|
-
|
|
941
|
-
var AIFeedback = defineComponent({
|
|
942
|
-
name: 'FeedbackComponent',
|
|
943
|
-
props: {
|
|
944
|
-
onFeedbackSubmit: {
|
|
945
|
-
type: Function,
|
|
946
|
-
"default": function _default() {}
|
|
947
|
-
},
|
|
948
|
-
hideUI: {
|
|
949
|
-
type: Boolean,
|
|
950
|
-
"default": false
|
|
951
|
-
},
|
|
952
|
-
overrideState: {
|
|
953
|
-
type: Object,
|
|
954
|
-
"default": function _default() {
|
|
955
|
-
return {};
|
|
956
|
-
}
|
|
957
|
-
}
|
|
958
|
-
},
|
|
959
|
-
setup: function setup(props, _ref) {
|
|
960
|
-
var emit = _ref.emit;
|
|
961
|
-
var showInput = ref(false);
|
|
962
|
-
var feedbackType = ref(null);
|
|
963
|
-
var feedbackText = ref('');
|
|
964
|
-
var feedbackRecorded = ref(false);
|
|
965
|
-
var handleButtonClick = function handleButtonClick(type) {
|
|
966
|
-
if (feedbackType.value === type) {
|
|
967
|
-
feedbackType.value = null;
|
|
968
|
-
showInput.value = false;
|
|
969
|
-
} else {
|
|
970
|
-
feedbackType.value = type;
|
|
971
|
-
showInput.value = true;
|
|
972
|
-
}
|
|
973
|
-
};
|
|
974
|
-
var handleInputChange = function handleInputChange(e) {
|
|
975
|
-
feedbackText.value = e.target.value;
|
|
976
|
-
};
|
|
977
|
-
var handleSubmit = function handleSubmit() {
|
|
978
|
-
emit('feedback-submit', feedbackType.value === 'positive', feedbackText.value);
|
|
979
|
-
feedbackText.value = '';
|
|
980
|
-
showInput.value = false;
|
|
981
|
-
feedbackRecorded.value = true;
|
|
982
|
-
};
|
|
983
|
-
var handleCancel = function handleCancel() {
|
|
984
|
-
feedbackType.value = null;
|
|
985
|
-
feedbackText.value = '';
|
|
986
|
-
showInput.value = false;
|
|
987
|
-
};
|
|
988
|
-
watch(function () {
|
|
989
|
-
return props.overrideState;
|
|
990
|
-
}, function (newValue) {
|
|
991
|
-
if (newValue && newValue.isRecorded) {
|
|
992
|
-
feedbackRecorded.value = true;
|
|
993
|
-
feedbackType.value = newValue.feedbackType || 'positive';
|
|
994
|
-
}
|
|
995
|
-
});
|
|
996
|
-
if (props.overrideState && props.overrideState.isRecorded) {
|
|
997
|
-
feedbackRecorded.value = true;
|
|
998
|
-
feedbackType.value = props.overrideState.feedbackType || 'positive';
|
|
999
|
-
}
|
|
1000
|
-
return {
|
|
1001
|
-
showInput: showInput,
|
|
1002
|
-
feedbackType: feedbackType,
|
|
1003
|
-
feedbackText: feedbackText,
|
|
1004
|
-
feedbackRecorded: feedbackRecorded,
|
|
1005
|
-
handleButtonClick: handleButtonClick,
|
|
1006
|
-
handleInputChange: handleInputChange,
|
|
1007
|
-
handleSubmit: handleSubmit,
|
|
1008
|
-
handleCancel: handleCancel
|
|
1009
|
-
};
|
|
1010
|
-
},
|
|
1011
|
-
render: function render() {
|
|
1012
|
-
var _this = this;
|
|
1013
|
-
if (this.$props.hideUI) {
|
|
1014
|
-
return null;
|
|
1015
|
-
}
|
|
1016
|
-
if (this.feedbackRecorded) {
|
|
1017
|
-
return createVNode(AIFeedbackContainer, null, {
|
|
1018
|
-
"default": function _default() {
|
|
1019
|
-
return [createVNode("div", {
|
|
1020
|
-
"class": "--feedback-svgs-wrapper"
|
|
1021
|
-
}, [_this.feedbackType === 'positive' ? createVNode(ThumbsUpSvg, {
|
|
1022
|
-
"class": "selected"
|
|
1023
|
-
}, null) : createVNode(ThumbsDownSvg, {
|
|
1024
|
-
"class": "selected"
|
|
1025
|
-
}, null)])];
|
|
1026
|
-
}
|
|
1027
|
-
});
|
|
1028
|
-
}
|
|
1029
|
-
return createVNode(AIFeedbackContainer, null, {
|
|
1030
|
-
"default": function _default() {
|
|
1031
|
-
return [!_this.showInput && createVNode("div", {
|
|
1032
|
-
"class": "--feedback-svgs-wrapper"
|
|
1033
|
-
}, [createVNode(ThumbsUpSvg, {
|
|
1034
|
-
"class": _this.feedbackType === 'positive' ? 'selected' : '',
|
|
1035
|
-
"onClick": function onClick() {
|
|
1036
|
-
return _this.handleButtonClick('positive');
|
|
1037
|
-
}
|
|
1038
|
-
}, null), createVNode(ThumbsDownSvg, {
|
|
1039
|
-
"class": _this.feedbackType === 'negative' ? 'selected' : '',
|
|
1040
|
-
"onClick": function onClick() {
|
|
1041
|
-
return _this.handleButtonClick('negative');
|
|
1042
|
-
}
|
|
1043
|
-
}, null)]), _this.showInput && createVNode("div", {
|
|
1044
|
-
"class": "--feedback-input-wrapper"
|
|
1045
|
-
}, [createVNode(Input, {
|
|
1046
|
-
"show": _this.showInput,
|
|
1047
|
-
"placeholder": _this.feedbackType === 'positive' ? 'What do you like about the response?' : 'What was the issue with the response? How can it be improved?',
|
|
1048
|
-
"value": _this.feedbackText,
|
|
1049
|
-
"onInput": _this.handleInputChange
|
|
1050
|
-
}, null), createVNode(Button, {
|
|
1051
|
-
"primary": true,
|
|
1052
|
-
"onClick": _this.handleSubmit
|
|
1053
|
-
}, {
|
|
1054
|
-
"default": function _default() {
|
|
1055
|
-
return [createTextVNode("Submit")];
|
|
1056
|
-
}
|
|
1057
|
-
}), createVNode(Button, {
|
|
1058
|
-
"onClick": _this.handleCancel
|
|
1059
|
-
}, {
|
|
1060
|
-
"default": function _default() {
|
|
1061
|
-
return [createTextVNode("Cancel")];
|
|
1062
|
-
}
|
|
1063
|
-
})])];
|
|
1064
|
-
}
|
|
1065
|
-
});
|
|
1066
|
-
}
|
|
1067
|
-
});
|
|
1068
|
-
|
|
1069
|
-
var _excluded = ["_source"];
|
|
1070
777
|
function _isSlot(s) {
|
|
1071
778
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
|
|
1072
779
|
}
|
|
1073
|
-
var md = new Remarkable();
|
|
1074
|
-
md.set({
|
|
1075
|
-
html: true,
|
|
1076
|
-
breaks: true,
|
|
1077
|
-
xhtmlOut: true
|
|
1078
|
-
});
|
|
1079
|
-
var _dropdownULRef = 'dropdownULRef';
|
|
1080
|
-
var _inputGroupRef = 'inputGroupRef';
|
|
1081
780
|
var updateQuery = Actions.updateQuery,
|
|
1082
781
|
setCustomQuery = Actions.setCustomQuery,
|
|
1083
782
|
setDefaultQuery = Actions.setDefaultQuery,
|
|
@@ -1098,11 +797,7 @@ var SearchBox = defineComponent({
|
|
|
1098
797
|
currentValue: '',
|
|
1099
798
|
selectedTags: [],
|
|
1100
799
|
isOpen: false,
|
|
1101
|
-
normalizedSuggestions: []
|
|
1102
|
-
showAIScreen: false,
|
|
1103
|
-
showAIScreenFooter: false,
|
|
1104
|
-
showFeedbackComponent: false,
|
|
1105
|
-
feedbackState: null
|
|
800
|
+
normalizedSuggestions: []
|
|
1106
801
|
};
|
|
1107
802
|
this.internalComponent = props.componentId + "__internal";
|
|
1108
803
|
return this.__state;
|
|
@@ -1224,10 +919,7 @@ var SearchBox = defineComponent({
|
|
|
1224
919
|
mode: VueTypes.oneOf(['select', 'tag']).def('select'),
|
|
1225
920
|
renderSelectedTags: VueTypes.any,
|
|
1226
921
|
searchboxId: VueTypes.string,
|
|
1227
|
-
endpoint: types.endpointConfig
|
|
1228
|
-
enableAI: VueTypes.bool.def(false),
|
|
1229
|
-
AIConfig: types.AIConfig,
|
|
1230
|
-
AIUIConfig: types.AIUIConfig
|
|
922
|
+
endpoint: types.endpointConfig
|
|
1231
923
|
},
|
|
1232
924
|
mounted: function mounted() {
|
|
1233
925
|
this.listenForFocusShortcuts();
|
|
@@ -1273,7 +965,6 @@ var SearchBox = defineComponent({
|
|
|
1273
965
|
suggestionsList = [].concat(withClickIds(this.$props.defaultSuggestions));
|
|
1274
966
|
}
|
|
1275
967
|
this.normalizedSuggestions = suggestionsList;
|
|
1276
|
-
this.handleTextAreaHeightChange();
|
|
1277
968
|
},
|
|
1278
969
|
selectedValue: function selectedValue(newVal, oldVal) {
|
|
1279
970
|
if (!isEqual(newVal, oldVal) && (this.$options.isTagsMode ? !isEqual(this.$data.selectedTags, newVal) : this.$data.currentValue !== newVal)) {
|
|
@@ -1335,45 +1026,6 @@ var SearchBox = defineComponent({
|
|
|
1335
1026
|
if (!isEqual(newVal, oldVal)) {
|
|
1336
1027
|
this.handleTextChange = _debounce(this.handleText, newVal);
|
|
1337
1028
|
}
|
|
1338
|
-
},
|
|
1339
|
-
isAITyping: function isAITyping(newVal, oldVal) {
|
|
1340
|
-
var _this = this;
|
|
1341
|
-
var scrollAIContainer = function scrollAIContainer() {
|
|
1342
|
-
var dropdownEle = _this.$refs[_dropdownULRef];
|
|
1343
|
-
if (dropdownEle) {
|
|
1344
|
-
dropdownEle.scrollTo({
|
|
1345
|
-
top: dropdownEle.scrollHeight,
|
|
1346
|
-
behavior: 'smooth'
|
|
1347
|
-
});
|
|
1348
|
-
}
|
|
1349
|
-
};
|
|
1350
|
-
if (!newVal && oldVal) {
|
|
1351
|
-
this.showAIScreenFooter = true;
|
|
1352
|
-
if (this.$props.AIUIConfig && typeof this.$props.AIUIConfig.showFeedback === 'boolean' ? this.$props.AIUIConfig.showFeedback : true) {
|
|
1353
|
-
this.showFeedbackComponent = true;
|
|
1354
|
-
}
|
|
1355
|
-
setTimeout(function () {
|
|
1356
|
-
scrollAIContainer();
|
|
1357
|
-
}, 500);
|
|
1358
|
-
} else if (newVal) {
|
|
1359
|
-
this.scrollTimerRef = setTimeout(function () {
|
|
1360
|
-
scrollAIContainer();
|
|
1361
|
-
}, 2000);
|
|
1362
|
-
}
|
|
1363
|
-
},
|
|
1364
|
-
showAIScreen: function showAIScreen(newVal) {
|
|
1365
|
-
if (newVal) {
|
|
1366
|
-
var _this$$refs;
|
|
1367
|
-
if ((_this$$refs = this.$refs) != null && _this$$refs[this.$props.innerRef] && this.$refs[this.$props.innerRef].$el) {
|
|
1368
|
-
this.$refs[this.$props.innerRef].$el.blur();
|
|
1369
|
-
}
|
|
1370
|
-
} else {
|
|
1371
|
-
this.feedbackState = null;
|
|
1372
|
-
this.showFeedbackComponent = false;
|
|
1373
|
-
}
|
|
1374
|
-
},
|
|
1375
|
-
currentValue: function currentValue() {
|
|
1376
|
-
this.handleTextAreaHeightChange();
|
|
1377
1029
|
}
|
|
1378
1030
|
},
|
|
1379
1031
|
methods: {
|
|
@@ -1399,20 +1051,9 @@ var SearchBox = defineComponent({
|
|
|
1399
1051
|
data: this.normalizedSuggestions,
|
|
1400
1052
|
rawData: this.rawData,
|
|
1401
1053
|
value: currentValue,
|
|
1402
|
-
resultStats: this.stats
|
|
1403
|
-
AIData: {
|
|
1404
|
-
question: this.AIResponse && this.AIResponse.response && this.AIResponse.response.question,
|
|
1405
|
-
answer: this.AIResponse && this.AIResponse.response && this.AIResponse.response.answer && this.AIResponse.response.answer.text,
|
|
1406
|
-
documentIds: this.AIResponse && this.AIResponse.response && this.AIResponse.response.answer && this.AIResponse.response.answer.documentIds || [],
|
|
1407
|
-
showAIScreen: this.showAIScreen,
|
|
1408
|
-
sources: this.getAISourceObjects(),
|
|
1409
|
-
isAILoading: this.isAIResponseLoading,
|
|
1410
|
-
AIError: this.AIResponseError
|
|
1411
|
-
}
|
|
1054
|
+
resultStats: this.stats
|
|
1412
1055
|
};
|
|
1413
|
-
return
|
|
1414
|
-
"ref": _dropdownULRef
|
|
1415
|
-
}, [getComponent(data, this)]);
|
|
1056
|
+
return getComponent(data, this);
|
|
1416
1057
|
},
|
|
1417
1058
|
// returns size and aggs property
|
|
1418
1059
|
getBasicQueryOptions: function getBasicQueryOptions() {
|
|
@@ -1434,7 +1075,7 @@ var SearchBox = defineComponent({
|
|
|
1434
1075
|
}
|
|
1435
1076
|
},
|
|
1436
1077
|
setValue: function setValue(value, isDefaultValue, props, cause, toggleIsOpen, categoryValue) {
|
|
1437
|
-
var
|
|
1078
|
+
var _this = this;
|
|
1438
1079
|
if (isDefaultValue === void 0) {
|
|
1439
1080
|
isDefaultValue = false;
|
|
1440
1081
|
}
|
|
@@ -1448,65 +1089,60 @@ var SearchBox = defineComponent({
|
|
|
1448
1089
|
categoryValue = undefined;
|
|
1449
1090
|
}
|
|
1450
1091
|
var performUpdate = function performUpdate() {
|
|
1451
|
-
if (
|
|
1092
|
+
if (_this.$options.isTagsMode && isEqual(value, _this.selectedTags)) {
|
|
1452
1093
|
return;
|
|
1453
1094
|
}
|
|
1454
|
-
if (
|
|
1455
|
-
if (Array.isArray(
|
|
1095
|
+
if (_this.$options.isTagsMode && cause === causes.SUGGESTION_SELECT) {
|
|
1096
|
+
if (Array.isArray(_this.selectedTags) && _this.selectedTags.length) {
|
|
1456
1097
|
// check if value already present in selectedTags
|
|
1457
|
-
if (typeof value === 'string' &&
|
|
1458
|
-
|
|
1098
|
+
if (typeof value === 'string' && _this.selectedTags.includes(value)) {
|
|
1099
|
+
_this.isOpen = false;
|
|
1459
1100
|
return;
|
|
1460
1101
|
}
|
|
1461
|
-
|
|
1102
|
+
_this.selectedTags = [].concat(_this.selectedTags);
|
|
1462
1103
|
if (typeof value === 'string' && !!value) {
|
|
1463
|
-
|
|
1464
|
-
} else if (Array.isArray(value) && !isEqual(
|
|
1465
|
-
|
|
1104
|
+
_this.selectedTags.push(value);
|
|
1105
|
+
} else if (Array.isArray(value) && !isEqual(_this.selectedTags, value)) {
|
|
1106
|
+
_this.selectedTags = value;
|
|
1466
1107
|
}
|
|
1467
1108
|
} else if (value) {
|
|
1468
|
-
|
|
1109
|
+
_this.selectedTags = typeof value !== 'string' ? value : [].concat(value);
|
|
1469
1110
|
}
|
|
1470
|
-
|
|
1111
|
+
_this.currentValue = '';
|
|
1471
1112
|
} else {
|
|
1472
|
-
|
|
1113
|
+
_this.currentValue = decodeHtml(value);
|
|
1473
1114
|
}
|
|
1474
1115
|
var queryHandlerValue = value;
|
|
1475
|
-
if (
|
|
1476
|
-
queryHandlerValue = Array.isArray(
|
|
1116
|
+
if (_this.$options.isTagsMode && cause === causes.SUGGESTION_SELECT) {
|
|
1117
|
+
queryHandlerValue = Array.isArray(_this.selectedTags) && _this.selectedTags.length ? _this.selectedTags : undefined;
|
|
1477
1118
|
}
|
|
1478
1119
|
if (isDefaultValue) {
|
|
1479
|
-
if (
|
|
1120
|
+
if (_this.$props.autosuggest) {
|
|
1480
1121
|
if (toggleIsOpen) {
|
|
1481
|
-
|
|
1122
|
+
_this.isOpen = false;
|
|
1482
1123
|
}
|
|
1483
|
-
if (typeof
|
|
1484
|
-
enableAI: true
|
|
1485
|
-
} : {});
|
|
1124
|
+
if (typeof _this.currentValue === 'string') _this.triggerDefaultQuery(_this.currentValue);
|
|
1486
1125
|
} // in case of strict selection only SUGGESTION_SELECT should be able
|
|
1487
1126
|
// to set the query otherwise the value should reset
|
|
1488
1127
|
if (props.strictSelection) {
|
|
1489
|
-
if (cause === causes.SUGGESTION_SELECT || (
|
|
1490
|
-
|
|
1128
|
+
if (cause === causes.SUGGESTION_SELECT || (_this.$options.isTagsMode ? _this.selectedTags.length === 0 : value === '')) {
|
|
1129
|
+
_this.triggerCustomQuery(queryHandlerValue, _this.$options.isTagsMode ? undefined : categoryValue);
|
|
1491
1130
|
} else {
|
|
1492
|
-
|
|
1131
|
+
_this.setValue('', true);
|
|
1493
1132
|
}
|
|
1494
1133
|
} else if (props.value === undefined || cause === causes.SUGGESTION_SELECT || cause === causes.CLEAR_VALUE) {
|
|
1495
|
-
|
|
1134
|
+
_this.triggerCustomQuery(queryHandlerValue, _this.$options.isTagsMode ? undefined : categoryValue);
|
|
1496
1135
|
}
|
|
1497
1136
|
} else {
|
|
1498
1137
|
// debounce for handling text while typing
|
|
1499
|
-
|
|
1138
|
+
_this.handleTextChange(value, cause);
|
|
1500
1139
|
}
|
|
1501
|
-
|
|
1502
|
-
|
|
1140
|
+
_this.$emit('valueChange', value);
|
|
1141
|
+
_this.$emit('value-change', value);
|
|
1503
1142
|
};
|
|
1504
1143
|
checkValueChange(props.componentId, value, props.beforeValueChange, performUpdate);
|
|
1505
1144
|
},
|
|
1506
|
-
triggerDefaultQuery: function triggerDefaultQuery(paramValue
|
|
1507
|
-
if (meta === void 0) {
|
|
1508
|
-
meta = {};
|
|
1509
|
-
}
|
|
1145
|
+
triggerDefaultQuery: function triggerDefaultQuery(paramValue) {
|
|
1510
1146
|
if (!this.$props.autosuggest) {
|
|
1511
1147
|
return;
|
|
1512
1148
|
}
|
|
@@ -1525,8 +1161,7 @@ var SearchBox = defineComponent({
|
|
|
1525
1161
|
componentId: this.internalComponent,
|
|
1526
1162
|
query: query,
|
|
1527
1163
|
value: value,
|
|
1528
|
-
componentType: componentTypes.searchBox
|
|
1529
|
-
meta: meta
|
|
1164
|
+
componentType: componentTypes.searchBox
|
|
1530
1165
|
});
|
|
1531
1166
|
},
|
|
1532
1167
|
triggerCustomQuery: function triggerCustomQuery(paramValue, categoryValue) {
|
|
@@ -1610,8 +1245,8 @@ var SearchBox = defineComponent({
|
|
|
1610
1245
|
this.recordSuggestionClick(searchPosition, docId);
|
|
1611
1246
|
},
|
|
1612
1247
|
clearValue: function clearValue() {
|
|
1613
|
-
this.setValue('', false, this.$props,
|
|
1614
|
-
this.onValueSelectedHandler('',
|
|
1248
|
+
this.setValue('', false, this.$props, causes.CLEAR_VALUE, false);
|
|
1249
|
+
this.onValueSelectedHandler('', causes.CLEAR_VALUE);
|
|
1615
1250
|
},
|
|
1616
1251
|
handleKeyDown: function handleKeyDown(event, highlightedIndex) {
|
|
1617
1252
|
if (highlightedIndex === void 0) {
|
|
@@ -1622,12 +1257,9 @@ var SearchBox = defineComponent({
|
|
|
1622
1257
|
if (this.$props.autosuggest === false) {
|
|
1623
1258
|
this.enterButtonOnClick();
|
|
1624
1259
|
} else if (highlightedIndex === null) {
|
|
1625
|
-
this.setValue(event.target.value, true, this.$props, this.$options.isTagsMode ? causes.SUGGESTION_SELECT : undefined
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
if (this.$props.enableAI && !this.showAIScreen) {
|
|
1629
|
-
this.showAIScreen = true;
|
|
1630
|
-
}
|
|
1260
|
+
this.setValue(event.target.value, true, this.$props, this.$options.isTagsMode ? causes.SUGGESTION_SELECT : undefined // to handle tags
|
|
1261
|
+
);
|
|
1262
|
+
|
|
1631
1263
|
this.onValueSelectedHandler(event.target.value, causes.ENTER_PRESS);
|
|
1632
1264
|
}
|
|
1633
1265
|
}
|
|
@@ -1637,21 +1269,18 @@ var SearchBox = defineComponent({
|
|
|
1637
1269
|
this.$emit('key-down', event, this.triggerQuery);
|
|
1638
1270
|
},
|
|
1639
1271
|
onInputChange: function onInputChange(e) {
|
|
1640
|
-
var
|
|
1272
|
+
var _this2 = this;
|
|
1641
1273
|
var inputValue = e.target.value;
|
|
1642
1274
|
if (!this.$data.isOpen && this.$props.autosuggest) {
|
|
1643
1275
|
this.isOpen = true;
|
|
1644
1276
|
}
|
|
1645
|
-
if (this.showAIScreen) {
|
|
1646
|
-
this.showAIScreen = false;
|
|
1647
|
-
}
|
|
1648
1277
|
var value = this.$props.value;
|
|
1649
1278
|
if (value === undefined) {
|
|
1650
|
-
this.setValue(inputValue, false, this.$props, undefined);
|
|
1279
|
+
this.setValue(inputValue, false, this.$props, inputValue === '' ? causes.CLEAR_VALUE : undefined);
|
|
1651
1280
|
} else {
|
|
1652
1281
|
this.$emit('change', inputValue, function (_ref3) {
|
|
1653
1282
|
var isOpen = _ref3.isOpen;
|
|
1654
|
-
return
|
|
1283
|
+
return _this2.triggerQuery({
|
|
1655
1284
|
defaultQuery: true,
|
|
1656
1285
|
customQuery: true,
|
|
1657
1286
|
value: inputValue,
|
|
@@ -1661,10 +1290,8 @@ var SearchBox = defineComponent({
|
|
|
1661
1290
|
}
|
|
1662
1291
|
},
|
|
1663
1292
|
onSuggestionSelected: function onSuggestionSelected(suggestion) {
|
|
1664
|
-
var
|
|
1665
|
-
|
|
1666
|
-
this.showAIScreen = true;
|
|
1667
|
-
}
|
|
1293
|
+
var _this3 = this;
|
|
1294
|
+
this.isOpen = false;
|
|
1668
1295
|
var value = this.$props.value;
|
|
1669
1296
|
// Record analytics for selected suggestions
|
|
1670
1297
|
this.triggerClickAnalytics(suggestion._click_id);
|
|
@@ -1684,10 +1311,10 @@ var SearchBox = defineComponent({
|
|
|
1684
1311
|
this.setValue(emitValue, true, this.$props, causes.SUGGESTION_SELECT, false, suggestion._category);
|
|
1685
1312
|
this.$emit('change', emitValue, function (_ref4) {
|
|
1686
1313
|
var isOpen = _ref4.isOpen;
|
|
1687
|
-
return
|
|
1314
|
+
return _this3.triggerQuery(_extends({
|
|
1688
1315
|
isOpen: isOpen,
|
|
1689
1316
|
value: emitValue
|
|
1690
|
-
}, !
|
|
1317
|
+
}, !_this3.$options.isTagsMode && {
|
|
1691
1318
|
categoryValue: suggestion._category
|
|
1692
1319
|
}));
|
|
1693
1320
|
});
|
|
@@ -1721,26 +1348,9 @@ var SearchBox = defineComponent({
|
|
|
1721
1348
|
}
|
|
1722
1349
|
return null;
|
|
1723
1350
|
},
|
|
1724
|
-
renderErrorComponent: function renderErrorComponent(
|
|
1725
|
-
var
|
|
1726
|
-
if (isAIError === void 0) {
|
|
1727
|
-
isAIError = false;
|
|
1728
|
-
}
|
|
1351
|
+
renderErrorComponent: function renderErrorComponent() {
|
|
1352
|
+
var _this4 = this;
|
|
1729
1353
|
var renderError = this.$slots.renderError || this.$props.renderError;
|
|
1730
|
-
if (isAIError) {
|
|
1731
|
-
if (this.showAIScreen && this.AIResponseError && !this.isAIResponseLoading) {
|
|
1732
|
-
if (renderError) {
|
|
1733
|
-
return createVNode("div", {
|
|
1734
|
-
"class": "--ai-answer-error-container " + (getClassName$1(this.$props.innerClass, 'ai-error') || '')
|
|
1735
|
-
}, [renderError(this.AIResponseError)]);
|
|
1736
|
-
}
|
|
1737
|
-
return createVNode("div", {
|
|
1738
|
-
"class": "--ai-answer-error-container " + (getClassName$1(this.$props.innerClass, 'ai-error') || '')
|
|
1739
|
-
}, [createVNode("div", {
|
|
1740
|
-
"class": "--default-error-element"
|
|
1741
|
-
}, [createVNode("span", null, [typeof this.AIResponseError === 'string' ? this.AIResponseError : this.AIResponseError.message ? this.AIResponseError.message : 'There was an error in generating the response.', this.AIResponseError.code ? "Code:\n\t\t\t\t\t\t\t" + this.AIResponseError.code : ''])])]);
|
|
1742
|
-
}
|
|
1743
|
-
}
|
|
1744
1354
|
if (this.error && renderError && this.$data.currentValue && !this.isLoading) {
|
|
1745
1355
|
return createVNode(SuggestionWrapper, {
|
|
1746
1356
|
"innerClass": this.$props.innerClass,
|
|
@@ -1749,7 +1359,7 @@ var SearchBox = defineComponent({
|
|
|
1749
1359
|
"themePreset": this.themePreset
|
|
1750
1360
|
}, {
|
|
1751
1361
|
"default": function _default() {
|
|
1752
|
-
return [isFunction(renderError) ? renderError(
|
|
1362
|
+
return [isFunction(renderError) ? renderError(_this4.error) : renderError];
|
|
1753
1363
|
}
|
|
1754
1364
|
});
|
|
1755
1365
|
}
|
|
@@ -1814,7 +1424,6 @@ var SearchBox = defineComponent({
|
|
|
1814
1424
|
return null;
|
|
1815
1425
|
},
|
|
1816
1426
|
enterButtonOnClick: function enterButtonOnClick() {
|
|
1817
|
-
this.showAIScreen = false;
|
|
1818
1427
|
this.triggerQuery({
|
|
1819
1428
|
isOpen: false,
|
|
1820
1429
|
value: this.currentValue,
|
|
@@ -1822,7 +1431,7 @@ var SearchBox = defineComponent({
|
|
|
1822
1431
|
});
|
|
1823
1432
|
},
|
|
1824
1433
|
renderEnterButtonElement: function renderEnterButtonElement() {
|
|
1825
|
-
var
|
|
1434
|
+
var _this5 = this;
|
|
1826
1435
|
var _this$$props2 = this.$props,
|
|
1827
1436
|
enterButton = _this$$props2.enterButton,
|
|
1828
1437
|
innerClass = _this$$props2.innerClass;
|
|
@@ -1830,12 +1439,12 @@ var SearchBox = defineComponent({
|
|
|
1830
1439
|
if (enterButton) {
|
|
1831
1440
|
var getEnterButtonMarkup = function getEnterButtonMarkup() {
|
|
1832
1441
|
if (renderEnterButton) {
|
|
1833
|
-
return renderEnterButton(
|
|
1442
|
+
return renderEnterButton(_this5.enterButtonOnClick);
|
|
1834
1443
|
}
|
|
1835
1444
|
return createVNode(Button, {
|
|
1836
1445
|
"class": "enter-btn " + getClassName$1(innerClass, 'enter-button'),
|
|
1837
1446
|
"primary": true,
|
|
1838
|
-
"onClick":
|
|
1447
|
+
"onClick": _this5.enterButtonOnClick
|
|
1839
1448
|
}, {
|
|
1840
1449
|
"default": function _default() {
|
|
1841
1450
|
return [createTextVNode("Search")];
|
|
@@ -1849,7 +1458,7 @@ var SearchBox = defineComponent({
|
|
|
1849
1458
|
return null;
|
|
1850
1459
|
},
|
|
1851
1460
|
renderIcons: function renderIcons() {
|
|
1852
|
-
var
|
|
1461
|
+
var _this6 = this;
|
|
1853
1462
|
var _slot3, _slot4, _slot5;
|
|
1854
1463
|
var _this$$props3 = this.$props,
|
|
1855
1464
|
iconPosition = _this$$props3.iconPosition,
|
|
@@ -1866,21 +1475,21 @@ var SearchBox = defineComponent({
|
|
|
1866
1475
|
}, {
|
|
1867
1476
|
"default": function _default() {
|
|
1868
1477
|
return [currentValue && showClear && createVNode(IconWrapper, {
|
|
1869
|
-
"onClick":
|
|
1478
|
+
"onClick": _this6.clearValue,
|
|
1870
1479
|
"showIcon": showIcon,
|
|
1871
1480
|
"isClearIcon": true
|
|
1872
|
-
}, _isSlot(_slot3 =
|
|
1481
|
+
}, _isSlot(_slot3 = _this6.renderCancelIcon()) ? _slot3 : {
|
|
1873
1482
|
"default": function _default() {
|
|
1874
1483
|
return [_slot3];
|
|
1875
1484
|
}
|
|
1876
1485
|
}), showVoiceSearch && createVNode(Mic, {
|
|
1877
1486
|
"getInstance": getMicInstance,
|
|
1878
1487
|
"render": renderMic,
|
|
1879
|
-
"handleResult":
|
|
1488
|
+
"handleResult": _this6.handleVoiceResults,
|
|
1880
1489
|
"className": getClassName$1(innerClass, 'mic') || null
|
|
1881
1490
|
}, null), iconPosition === 'right' && showIcon && createVNode(IconWrapper, {
|
|
1882
|
-
"onClick":
|
|
1883
|
-
}, _isSlot(_slot4 =
|
|
1491
|
+
"onClick": _this6.handleSearchIconClick
|
|
1492
|
+
}, _isSlot(_slot4 = _this6.renderIcon()) ? _slot4 : {
|
|
1884
1493
|
"default": function _default() {
|
|
1885
1494
|
return [_slot4];
|
|
1886
1495
|
}
|
|
@@ -1892,8 +1501,8 @@ var SearchBox = defineComponent({
|
|
|
1892
1501
|
}, {
|
|
1893
1502
|
"default": function _default() {
|
|
1894
1503
|
return [iconPosition === 'left' && showIcon && createVNode(IconWrapper, {
|
|
1895
|
-
"onClick":
|
|
1896
|
-
}, _isSlot(_slot5 =
|
|
1504
|
+
"onClick": _this6.handleSearchIconClick
|
|
1505
|
+
}, _isSlot(_slot5 = _this6.renderIcon()) ? _slot5 : {
|
|
1897
1506
|
"default": function _default() {
|
|
1898
1507
|
return [_slot5];
|
|
1899
1508
|
}
|
|
@@ -1902,17 +1511,17 @@ var SearchBox = defineComponent({
|
|
|
1902
1511
|
})]);
|
|
1903
1512
|
},
|
|
1904
1513
|
focusSearchBox: function focusSearchBox(event) {
|
|
1905
|
-
var _this$$
|
|
1514
|
+
var _this$$refs, _this$$refs$this$$pro;
|
|
1906
1515
|
var elt = event.target || event.srcElement;
|
|
1907
1516
|
var tagName = elt.tagName;
|
|
1908
1517
|
if (elt.isContentEditable || tagName === 'INPUT' || tagName === 'SELECT' || tagName === 'TEXTAREA') {
|
|
1909
1518
|
// already in an input
|
|
1910
1519
|
return;
|
|
1911
1520
|
}
|
|
1912
|
-
(_this$$
|
|
1521
|
+
(_this$$refs = this.$refs) == null ? void 0 : (_this$$refs$this$$pro = _this$$refs[this.$props.innerRef]) == null ? void 0 : _this$$refs$this$$pro.focus(); // eslint-disable-line
|
|
1913
1522
|
},
|
|
1914
1523
|
listenForFocusShortcuts: function listenForFocusShortcuts() {
|
|
1915
|
-
var
|
|
1524
|
+
var _this7 = this;
|
|
1916
1525
|
var _this$$props$focusSho = this.$props.focusShortcuts,
|
|
1917
1526
|
focusShortcuts = _this$$props$focusSho === void 0 ? ['/'] : _this$$props$focusSho;
|
|
1918
1527
|
if (isEmpty(focusShortcuts)) {
|
|
@@ -1927,7 +1536,7 @@ var SearchBox = defineComponent({
|
|
|
1927
1536
|
function (event, handler) {
|
|
1928
1537
|
// Prevent the default refresh event under WINDOWS system
|
|
1929
1538
|
event.preventDefault();
|
|
1930
|
-
|
|
1539
|
+
_this7.focusSearchBox(event);
|
|
1931
1540
|
});
|
|
1932
1541
|
|
|
1933
1542
|
// if one of modifier keys are used, they are handled below
|
|
@@ -1937,7 +1546,7 @@ var SearchBox = defineComponent({
|
|
|
1937
1546
|
for (var index = 0; index < modifierKeys.length; index += 1) {
|
|
1938
1547
|
var element = modifierKeys[index];
|
|
1939
1548
|
if (hotkeys[element]) {
|
|
1940
|
-
|
|
1549
|
+
_this7.focusSearchBox(event);
|
|
1941
1550
|
break;
|
|
1942
1551
|
}
|
|
1943
1552
|
}
|
|
@@ -1950,10 +1559,10 @@ var SearchBox = defineComponent({
|
|
|
1950
1559
|
this.triggerDefaultQuery(value);
|
|
1951
1560
|
},
|
|
1952
1561
|
renderAutoFill: function renderAutoFill(suggestion) {
|
|
1953
|
-
var
|
|
1562
|
+
var _this8 = this;
|
|
1954
1563
|
var handleAutoFillClick = function handleAutoFillClick(e) {
|
|
1955
1564
|
e.stopPropagation();
|
|
1956
|
-
|
|
1565
|
+
_this8.onAutofillClick(suggestion);
|
|
1957
1566
|
};
|
|
1958
1567
|
/* 👇 avoid showing autofill for category suggestions👇 */
|
|
1959
1568
|
return suggestion._category ? null : createVNode(AutoFillSvg, {
|
|
@@ -1961,7 +1570,7 @@ var SearchBox = defineComponent({
|
|
|
1961
1570
|
}, null);
|
|
1962
1571
|
},
|
|
1963
1572
|
renderTag: function renderTag(item) {
|
|
1964
|
-
var
|
|
1573
|
+
var _this9 = this;
|
|
1965
1574
|
var innerClass = this.$props.innerClass;
|
|
1966
1575
|
return createVNode(TagItem, {
|
|
1967
1576
|
"class": getClassName$1(innerClass, 'selected-tag') || ''
|
|
@@ -1972,7 +1581,7 @@ var SearchBox = defineComponent({
|
|
|
1972
1581
|
"aria-label": "delete-tag",
|
|
1973
1582
|
"class": "close-icon",
|
|
1974
1583
|
"onClick": function onClick() {
|
|
1975
|
-
return
|
|
1584
|
+
return _this9.clearTag(item);
|
|
1976
1585
|
}
|
|
1977
1586
|
}, [createVNode(CancelSvg, null, null)])];
|
|
1978
1587
|
}
|
|
@@ -1995,7 +1604,7 @@ var SearchBox = defineComponent({
|
|
|
1995
1604
|
}
|
|
1996
1605
|
},
|
|
1997
1606
|
renderTags: function renderTags() {
|
|
1998
|
-
var
|
|
1607
|
+
var _this10 = this;
|
|
1999
1608
|
if (!Array.isArray(this.selectedTags)) {
|
|
2000
1609
|
return null;
|
|
2001
1610
|
}
|
|
@@ -2009,193 +1618,25 @@ var SearchBox = defineComponent({
|
|
|
2009
1618
|
}) : createVNode(TagsContainer, null, {
|
|
2010
1619
|
"default": function _default() {
|
|
2011
1620
|
return [tagsList.map(function (item) {
|
|
2012
|
-
return
|
|
1621
|
+
return _this10.renderTag(item);
|
|
2013
1622
|
}), shouldRenderClearAllTag && createVNode(TagItem, {
|
|
2014
|
-
"class": getClassName$1(
|
|
1623
|
+
"class": getClassName$1(_this10.$props.innerClass, 'selected-tag') || ''
|
|
2015
1624
|
}, {
|
|
2016
1625
|
"default": function _default() {
|
|
2017
1626
|
return [createVNode("span", null, [createTextVNode("Clear All")]), createVNode("span", {
|
|
2018
1627
|
"role": "img",
|
|
2019
1628
|
"aria-label": "delete-tag",
|
|
2020
1629
|
"class": "close-icon",
|
|
2021
|
-
"onClick":
|
|
1630
|
+
"onClick": _this10.clearAllTags
|
|
2022
1631
|
}, [createVNode(CancelSvg, null, null)])];
|
|
2023
1632
|
}
|
|
2024
1633
|
})];
|
|
2025
1634
|
}
|
|
2026
1635
|
});
|
|
2027
|
-
},
|
|
2028
|
-
getAISourceObjects: function getAISourceObjects() {
|
|
2029
|
-
var localCache = getObjectFromLocalStorage(AI_LOCAL_CACHE_KEY) && getObjectFromLocalStorage(AI_LOCAL_CACHE_KEY)[this.componentId];
|
|
2030
|
-
var sourceObjects = [];
|
|
2031
|
-
if (!this.AIResponse) return sourceObjects;
|
|
2032
|
-
var docIds = this.AIResponse && this.AIResponse.response && this.AIResponse.response.answer && this.AIResponse.response.answer.documentIds || [];
|
|
2033
|
-
if (localCache && localCache.meta && localCache.meta.hits && localCache.meta.hits.hits) {
|
|
2034
|
-
docIds.forEach(function (id) {
|
|
2035
|
-
var foundSourceObj = localCache.meta.hits.hits.find(function (hit) {
|
|
2036
|
-
return hit._id === id;
|
|
2037
|
-
}) || {};
|
|
2038
|
-
if (foundSourceObj) {
|
|
2039
|
-
var _foundSourceObj$_sour = foundSourceObj._source,
|
|
2040
|
-
_source = _foundSourceObj$_sour === void 0 ? {} : _foundSourceObj$_sour,
|
|
2041
|
-
rest = _objectWithoutPropertiesLoose(foundSourceObj, _excluded);
|
|
2042
|
-
sourceObjects.push(_extends({}, rest, _source));
|
|
2043
|
-
}
|
|
2044
|
-
});
|
|
2045
|
-
} else {
|
|
2046
|
-
sourceObjects.push.apply(sourceObjects, docIds.map(function (id) {
|
|
2047
|
-
return {
|
|
2048
|
-
_id: id
|
|
2049
|
-
};
|
|
2050
|
-
}));
|
|
2051
|
-
}
|
|
2052
|
-
return sourceObjects;
|
|
2053
|
-
},
|
|
2054
|
-
renderAIScreenLoader: function renderAIScreenLoader() {
|
|
2055
|
-
var _this$$props$AIUIConf = this.$props.AIUIConfig,
|
|
2056
|
-
AIUIConfig = _this$$props$AIUIConf === void 0 ? {} : _this$$props$AIUIConf;
|
|
2057
|
-
var _ref5 = AIUIConfig || {},
|
|
2058
|
-
loaderMessage = _ref5.loaderMessage;
|
|
2059
|
-
if (loaderMessage) {
|
|
2060
|
-
return loaderMessage;
|
|
2061
|
-
}
|
|
2062
|
-
if (this.$slots.AILoaderMessage) {
|
|
2063
|
-
return this.$slots.AILoaderMessage();
|
|
2064
|
-
}
|
|
2065
|
-
return createVNode(HorizontalSkeletonLoader, null, null);
|
|
2066
|
-
},
|
|
2067
|
-
renderAIScreenFooter: function renderAIScreenFooter() {
|
|
2068
|
-
var _slot6;
|
|
2069
|
-
var _this12 = this;
|
|
2070
|
-
var _this$$props$AIUIConf2 = this.$props.AIUIConfig,
|
|
2071
|
-
AIUIConfig = _this$$props$AIUIConf2 === void 0 ? {} : _this$$props$AIUIConf2;
|
|
2072
|
-
var _ref6 = AIUIConfig || {},
|
|
2073
|
-
_ref6$showSourceDocum = _ref6.showSourceDocuments,
|
|
2074
|
-
showSourceDocuments = _ref6$showSourceDocum === void 0 ? true : _ref6$showSourceDocum,
|
|
2075
|
-
_ref6$sourceDocumentL = _ref6.sourceDocumentLabel,
|
|
2076
|
-
sourceDocumentLabel = _ref6$sourceDocumentL === void 0 ? '_id' : _ref6$sourceDocumentL,
|
|
2077
|
-
_ref6$onSourceClick = _ref6.onSourceClick,
|
|
2078
|
-
onSourceClick = _ref6$onSourceClick === void 0 ? function () {} : _ref6$onSourceClick;
|
|
2079
|
-
return showSourceDocuments && this.showAIScreenFooter && this.AIResponse && this.AIResponse.response && this.AIResponse.response.answer && this.AIResponse.response.answer.documentIds ? createVNode(Footer, {
|
|
2080
|
-
"themePreset": this.$props.themePreset
|
|
2081
|
-
}, {
|
|
2082
|
-
"default": function _default() {
|
|
2083
|
-
return [createTextVNode("Summary generated using the following sources:"), ' ', createVNode(SourceTags, null, _isSlot(_slot6 = _this12.getAISourceObjects().map(function (el) {
|
|
2084
|
-
return createVNode(Button, {
|
|
2085
|
-
"class": "--ai-source-tag " + (getClassName$1(_this12.$props.innerClass, 'ai-source-tag') || ''),
|
|
2086
|
-
"title": el[sourceDocumentLabel],
|
|
2087
|
-
"info": true,
|
|
2088
|
-
"onClick": function onClick() {
|
|
2089
|
-
return onSourceClick && onSourceClick(el);
|
|
2090
|
-
}
|
|
2091
|
-
}, {
|
|
2092
|
-
"default": function _default() {
|
|
2093
|
-
return [el[sourceDocumentLabel]];
|
|
2094
|
-
}
|
|
2095
|
-
});
|
|
2096
|
-
})) ? _slot6 : {
|
|
2097
|
-
"default": function _default() {
|
|
2098
|
-
return [_slot6];
|
|
2099
|
-
}
|
|
2100
|
-
})];
|
|
2101
|
-
}
|
|
2102
|
-
}) : null;
|
|
2103
|
-
},
|
|
2104
|
-
renderAIScreen: function renderAIScreen() {
|
|
2105
|
-
var _this13 = this;
|
|
2106
|
-
var customAIRenderer = this.$props.renderAIAnswer || this.$slots.renderAIAnswer;
|
|
2107
|
-
if (customAIRenderer) {
|
|
2108
|
-
return customAIRenderer({
|
|
2109
|
-
question: this.AIResponse && this.AIResponse.response && this.AIResponse.response.question,
|
|
2110
|
-
answer: this.AIResponse && this.AIResponse.response && this.AIResponse.response.answer && this.AIResponse.response.answer.text,
|
|
2111
|
-
documentIds: this.AIResponse && this.AIResponse.response && this.AIResponse.response.answer && this.AIResponse.response.answer.documentIds || [],
|
|
2112
|
-
loading: this.isAIResponseLoading || this.isLoading,
|
|
2113
|
-
sources: this.getAISourceObjects(),
|
|
2114
|
-
error: this.AIResponseError
|
|
2115
|
-
});
|
|
2116
|
-
}
|
|
2117
|
-
if (this.isAIResponseLoading || this.isLoading) {
|
|
2118
|
-
return this.renderAIScreenLoader();
|
|
2119
|
-
}
|
|
2120
|
-
return createVNode("div", null, [createVNode(Answer, {
|
|
2121
|
-
"innerHTML": md.render(this.AIResponse && this.AIResponse.response && this.AIResponse.response.answer && this.AIResponse.response.answer.text)
|
|
2122
|
-
}, null), this.renderAIScreenFooter(), this.showFeedbackComponent && createVNode("div", {
|
|
2123
|
-
"class": "" + (getClassName$1(this.$props.innerClass, 'ai-feedback') || '')
|
|
2124
|
-
}, [createVNode(AIFeedback, {
|
|
2125
|
-
"overrideState": this.feedbackState,
|
|
2126
|
-
"hideUI": this.isAIResponseLoading || this.isLoading || !this.sessionIdFromStore,
|
|
2127
|
-
"key": this.sessionIdFromStore,
|
|
2128
|
-
"onFeedbackSubmit": function onFeedbackSubmit(useful, reason) {
|
|
2129
|
-
_this13.feedbackState = {
|
|
2130
|
-
isRecorded: true,
|
|
2131
|
-
feedbackType: useful ? 'positive' : 'negative'
|
|
2132
|
-
};
|
|
2133
|
-
_this13.recordAISessionUsefulness(_this13.sessionIdFromStore, {
|
|
2134
|
-
useful: useful,
|
|
2135
|
-
reason: reason
|
|
2136
|
-
});
|
|
2137
|
-
}
|
|
2138
|
-
}, null)])]);
|
|
2139
|
-
},
|
|
2140
|
-
handleTextAreaHeightChange: function handleTextAreaHeightChange() {
|
|
2141
|
-
var _this$$refs$this$$pro, _this$$refs$_inputGro;
|
|
2142
|
-
var textArea = (_this$$refs$this$$pro = this.$refs[this.$props.innerRef]) == null ? void 0 : _this$$refs$this$$pro.$el;
|
|
2143
|
-
var inputGroupEle = (_this$$refs$_inputGro = this.$refs[_inputGroupRef]) == null ? void 0 : _this$$refs$_inputGro.$el;
|
|
2144
|
-
if (textArea) {
|
|
2145
|
-
textArea.style.height = '42px';
|
|
2146
|
-
var lineHeight = parseInt(getComputedStyle(textArea).lineHeight, 10);
|
|
2147
|
-
var maxHeight = lineHeight * 4; // max height for 3 lines
|
|
2148
|
-
var height = Math.min(textArea.scrollHeight, maxHeight);
|
|
2149
|
-
textArea.style.height = height + "px";
|
|
2150
|
-
textArea.style.overflowY = height === maxHeight ? 'auto' : 'hidden';
|
|
2151
|
-
var dropdownEle = this.$refs[_dropdownULRef];
|
|
2152
|
-
if (dropdownEle) {
|
|
2153
|
-
dropdownEle.style.top = "" + textArea.style.height;
|
|
2154
|
-
}
|
|
2155
|
-
if (inputGroupEle) {
|
|
2156
|
-
inputGroupEle.style.height = "" + textArea.style.height;
|
|
2157
|
-
}
|
|
2158
|
-
}
|
|
2159
|
-
},
|
|
2160
|
-
askButtonOnClick: function askButtonOnClick() {
|
|
2161
|
-
this.showAIScreen = true;
|
|
2162
|
-
this.isOpen = true;
|
|
2163
|
-
this.triggerDefaultQuery(this.currentValue, {
|
|
2164
|
-
enableAI: true
|
|
2165
|
-
});
|
|
2166
|
-
},
|
|
2167
|
-
renderAskButtonElement: function renderAskButtonElement() {
|
|
2168
|
-
var _this14 = this;
|
|
2169
|
-
var _this$$props4 = this.$props,
|
|
2170
|
-
AIUIConfig = _this$$props4.AIUIConfig,
|
|
2171
|
-
innerClass = _this$$props4.innerClass;
|
|
2172
|
-
var _ref7 = AIUIConfig || {},
|
|
2173
|
-
askButton = _ref7.askButton;
|
|
2174
|
-
var renderAskButton = this.$slots.renderAskButton;
|
|
2175
|
-
if (askButton) {
|
|
2176
|
-
var getEnterButtonMarkup = function getEnterButtonMarkup() {
|
|
2177
|
-
if (renderAskButton) {
|
|
2178
|
-
return renderAskButton(_this14.askButtonOnClick);
|
|
2179
|
-
}
|
|
2180
|
-
return createVNode(Button, {
|
|
2181
|
-
"class": "enter-btn " + getClassName$1(innerClass, 'ask-button'),
|
|
2182
|
-
"info": true,
|
|
2183
|
-
"onClick": _this14.askButtonOnClick
|
|
2184
|
-
}, {
|
|
2185
|
-
"default": function _default() {
|
|
2186
|
-
return [createTextVNode("Ask")];
|
|
2187
|
-
}
|
|
2188
|
-
});
|
|
2189
|
-
};
|
|
2190
|
-
return createVNode("div", {
|
|
2191
|
-
"class": "enter-button-wrapper"
|
|
2192
|
-
}, [getEnterButtonMarkup()]);
|
|
2193
|
-
}
|
|
2194
|
-
return null;
|
|
2195
1636
|
}
|
|
2196
1637
|
},
|
|
2197
1638
|
render: function render() {
|
|
2198
|
-
var
|
|
1639
|
+
var _this11 = this;
|
|
2199
1640
|
var expandSuggestionsContainer = this.$props.expandSuggestionsContainer;
|
|
2200
1641
|
var _this$$slots = this.$slots,
|
|
2201
1642
|
recentSearchesIcon = _this$$slots.recentSearchesIcon,
|
|
@@ -2206,26 +1647,26 @@ var SearchBox = defineComponent({
|
|
|
2206
1647
|
"class": this.$props.className
|
|
2207
1648
|
}, {
|
|
2208
1649
|
"default": function _default() {
|
|
2209
|
-
return [
|
|
2210
|
-
"class": getClassName$1(
|
|
1650
|
+
return [_this11.$props.title && createVNode(Title, {
|
|
1651
|
+
"class": getClassName$1(_this11.$props.innerClass, 'title') || ''
|
|
2211
1652
|
}, {
|
|
2212
1653
|
"default": function _default() {
|
|
2213
|
-
return [
|
|
1654
|
+
return [_this11.$props.title];
|
|
2214
1655
|
}
|
|
2215
|
-
}),
|
|
2216
|
-
"id":
|
|
2217
|
-
"handleChange":
|
|
2218
|
-
"handleMouseup":
|
|
2219
|
-
"isOpen":
|
|
1656
|
+
}), _this11.$props.autosuggest ? createVNode(Downshift, {
|
|
1657
|
+
"id": _this11.$props.componentId + "-downshift",
|
|
1658
|
+
"handleChange": _this11.onSuggestionSelected,
|
|
1659
|
+
"handleMouseup": _this11.handleStateChange,
|
|
1660
|
+
"isOpen": _this11.$data.isOpen
|
|
2220
1661
|
}, {
|
|
2221
|
-
"default": function _default(
|
|
2222
|
-
var getInputEvents =
|
|
2223
|
-
getInputProps =
|
|
2224
|
-
getItemProps =
|
|
2225
|
-
getItemEvents =
|
|
2226
|
-
isOpen =
|
|
2227
|
-
highlightedIndex =
|
|
2228
|
-
setHighlightedIndex =
|
|
1662
|
+
"default": function _default(_ref5) {
|
|
1663
|
+
var getInputEvents = _ref5.getInputEvents,
|
|
1664
|
+
getInputProps = _ref5.getInputProps,
|
|
1665
|
+
getItemProps = _ref5.getItemProps,
|
|
1666
|
+
getItemEvents = _ref5.getItemEvents,
|
|
1667
|
+
isOpen = _ref5.isOpen,
|
|
1668
|
+
highlightedIndex = _ref5.highlightedIndex,
|
|
1669
|
+
setHighlightedIndex = _ref5.setHighlightedIndex;
|
|
2229
1670
|
var renderSuggestionsDropdown = function renderSuggestionsDropdown() {
|
|
2230
1671
|
var getIcon = function getIcon(iconType) {
|
|
2231
1672
|
switch (iconType) {
|
|
@@ -2237,21 +1678,14 @@ var SearchBox = defineComponent({
|
|
|
2237
1678
|
return null;
|
|
2238
1679
|
}
|
|
2239
1680
|
};
|
|
2240
|
-
return createVNode("div", null, [
|
|
1681
|
+
return createVNode("div", null, [_this11.hasCustomRenderer && _this11.getComponent({
|
|
2241
1682
|
isOpen: isOpen,
|
|
2242
1683
|
getItemProps: getItemProps,
|
|
2243
1684
|
getItemEvents: getItemEvents,
|
|
2244
1685
|
highlightedIndex: highlightedIndex
|
|
2245
|
-
}),
|
|
2246
|
-
"class": suggestions(
|
|
2247
|
-
|
|
2248
|
-
}, [_this15.showAIScreen && createVNode(SearchBoxAISection, {
|
|
2249
|
-
"themePreset": _this15.$props.themePreset
|
|
2250
|
-
}, {
|
|
2251
|
-
"default": function _default() {
|
|
2252
|
-
return [_this15.renderAIScreen(), ' ', _this15.renderErrorComponent(true)];
|
|
2253
|
-
}
|
|
2254
|
-
}), !_this15.showAIScreen && _this15.normalizedSuggestions.map(function (item, index) {
|
|
1686
|
+
}), _this11.renderErrorComponent(), !_this11.hasCustomRenderer && isOpen && hasSuggestions ? createVNode("ul", {
|
|
1687
|
+
"class": suggestions(_this11.themePreset, _this11.theme) + " " + getClassName$1(_this11.$props.innerClass, 'list')
|
|
1688
|
+
}, [_this11.normalizedSuggestions.map(function (item, index) {
|
|
2255
1689
|
return renderItem ? createVNode("li", mergeProps(getItemProps({
|
|
2256
1690
|
item: item
|
|
2257
1691
|
}), getItemEvents({
|
|
@@ -2259,7 +1693,7 @@ var SearchBox = defineComponent({
|
|
|
2259
1693
|
}), {
|
|
2260
1694
|
"key": index + 1 + "-" + item.value,
|
|
2261
1695
|
"style": {
|
|
2262
|
-
backgroundColor:
|
|
1696
|
+
backgroundColor: _this11.getBackgroundColor(highlightedIndex, index),
|
|
2263
1697
|
justifyContent: 'flex-start',
|
|
2264
1698
|
alignItems: 'center'
|
|
2265
1699
|
}
|
|
@@ -2270,7 +1704,7 @@ var SearchBox = defineComponent({
|
|
|
2270
1704
|
})), {
|
|
2271
1705
|
"key": index + 1 + "-" + item.value,
|
|
2272
1706
|
"style": {
|
|
2273
|
-
backgroundColor:
|
|
1707
|
+
backgroundColor: _this11.getBackgroundColor(highlightedIndex, index),
|
|
2274
1708
|
justifyContent: 'flex-start',
|
|
2275
1709
|
alignItems: 'center'
|
|
2276
1710
|
}
|
|
@@ -2280,103 +1714,97 @@ var SearchBox = defineComponent({
|
|
|
2280
1714
|
display: 'flex'
|
|
2281
1715
|
}
|
|
2282
1716
|
}, [createVNode(CustomSvg, {
|
|
2283
|
-
"className": getClassName$1(
|
|
1717
|
+
"className": getClassName$1(_this11.$props.innerClass, item._suggestion_type + "-search-icon") || null,
|
|
2284
1718
|
"icon": getIcon(item._suggestion_type),
|
|
2285
1719
|
"type": item._suggestion_type + "-search-icon"
|
|
2286
1720
|
}, null)]), createVNode(SuggestionItem, {
|
|
2287
|
-
"currentValue":
|
|
1721
|
+
"currentValue": _this11.currentValue,
|
|
2288
1722
|
"suggestion": item
|
|
2289
|
-
}, null),
|
|
2290
|
-
})]) :
|
|
1723
|
+
}, null), _this11.renderAutoFill(item)]);
|
|
1724
|
+
})]) : _this11.renderNoSuggestions(_this11.normalizedSuggestions)]);
|
|
2291
1725
|
};
|
|
2292
1726
|
return createVNode("div", {
|
|
2293
1727
|
"class": suggestionsContainer
|
|
2294
|
-
}, [createVNode(InputGroup, {
|
|
2295
|
-
"ref": _inputGroupRef
|
|
2296
|
-
}, {
|
|
1728
|
+
}, [createVNode(InputGroup, null, {
|
|
2297
1729
|
"default": function _default() {
|
|
2298
|
-
return [
|
|
1730
|
+
return [_this11.renderInputAddonBefore(), createVNode(InputWrapper, null, {
|
|
2299
1731
|
"default": function _default() {
|
|
2300
|
-
return [createVNode(
|
|
2301
|
-
onInput:
|
|
1732
|
+
return [createVNode(Input, mergeProps(_transformOn(getInputEvents({
|
|
1733
|
+
onInput: _this11.onInputChange,
|
|
2302
1734
|
onBlur: function onBlur(e) {
|
|
2303
|
-
|
|
1735
|
+
_this11.$emit('blur', e, _this11.triggerQuery);
|
|
2304
1736
|
},
|
|
2305
|
-
onFocus:
|
|
1737
|
+
onFocus: _this11.handleFocus,
|
|
2306
1738
|
onKeyPress: function onKeyPress(e) {
|
|
2307
|
-
|
|
2308
|
-
|
|
1739
|
+
_this11.$emit('keyPress', e, _this11.triggerQuery);
|
|
1740
|
+
_this11.$emit('key-press', e, _this11.triggerQuery);
|
|
2309
1741
|
},
|
|
2310
1742
|
onKeyDown: function onKeyDown(e) {
|
|
2311
|
-
return
|
|
1743
|
+
return _this11.handleKeyDown(e, highlightedIndex);
|
|
2312
1744
|
},
|
|
2313
1745
|
onKeyUp: function onKeyUp(e) {
|
|
2314
|
-
|
|
2315
|
-
|
|
1746
|
+
_this11.$emit('keyUp', e, _this11.triggerQuery);
|
|
1747
|
+
_this11.$emit('key-up', e, _this11.triggerQuery);
|
|
2316
1748
|
},
|
|
2317
1749
|
onClick: function onClick() {
|
|
2318
1750
|
setHighlightedIndex(null);
|
|
2319
1751
|
}
|
|
2320
1752
|
})), {
|
|
2321
|
-
"id":
|
|
2322
|
-
"showIcon":
|
|
2323
|
-
"showClear":
|
|
2324
|
-
"iconPosition":
|
|
2325
|
-
"ref":
|
|
2326
|
-
"class": getClassName$1(
|
|
2327
|
-
"placeholder":
|
|
2328
|
-
"autoFocus":
|
|
2329
|
-
"showFocusShortcutsIcon": _this15.$props.showFocusShortcutsIcon,
|
|
2330
|
-
"showVoiceSearch": _this15.$props.showVoiceSearch
|
|
1753
|
+
"id": _this11.$props.componentId + "-input",
|
|
1754
|
+
"showIcon": _this11.$props.showIcon,
|
|
1755
|
+
"showClear": _this11.$props.showClear,
|
|
1756
|
+
"iconPosition": _this11.$props.iconPosition,
|
|
1757
|
+
"ref": _this11.$props.innerRef,
|
|
1758
|
+
"class": getClassName$1(_this11.$props.innerClass, 'input'),
|
|
1759
|
+
"placeholder": _this11.$props.placeholder,
|
|
1760
|
+
"autoFocus": _this11.$props.autoFocus
|
|
2331
1761
|
}, getInputProps({
|
|
2332
|
-
value:
|
|
1762
|
+
value: _this11.$data.currentValue === null ? '' : _this11.$data.currentValue
|
|
2333
1763
|
}), {
|
|
2334
|
-
"themePreset":
|
|
1764
|
+
"themePreset": _this11.themePreset,
|
|
2335
1765
|
"autocomplete": "off"
|
|
2336
|
-
}), null),
|
|
1766
|
+
}), null), _this11.renderIcons(), !expandSuggestionsContainer && renderSuggestionsDropdown()];
|
|
2337
1767
|
}
|
|
2338
|
-
}),
|
|
1768
|
+
}), _this11.renderInputAddonAfter(), _this11.renderEnterButtonElement()];
|
|
2339
1769
|
}
|
|
2340
|
-
}), expandSuggestionsContainer && renderSuggestionsDropdown(),
|
|
1770
|
+
}), expandSuggestionsContainer && renderSuggestionsDropdown(), _this11.renderTags()]);
|
|
2341
1771
|
}
|
|
2342
1772
|
}) : createVNode("div", {
|
|
2343
1773
|
"class": suggestionsContainer
|
|
2344
|
-
}, [createVNode(InputGroup, {
|
|
2345
|
-
"ref": _inputGroupRef
|
|
2346
|
-
}, {
|
|
1774
|
+
}, [createVNode(InputGroup, null, {
|
|
2347
1775
|
"default": function _default() {
|
|
2348
|
-
return [
|
|
1776
|
+
return [_this11.renderInputAddonBefore(), createVNode(InputWrapper, null, {
|
|
2349
1777
|
"default": function _default() {
|
|
2350
|
-
return [createVNode(
|
|
1778
|
+
return [createVNode(Input, mergeProps(_transformOn({
|
|
2351
1779
|
blur: function blur(e) {
|
|
2352
|
-
|
|
1780
|
+
_this11.$emit('blur', e, _this11.triggerQuery);
|
|
2353
1781
|
},
|
|
2354
1782
|
keypress: function keypress(e) {
|
|
2355
|
-
|
|
2356
|
-
|
|
1783
|
+
_this11.$emit('keyPress', e, _this11.triggerQuery);
|
|
1784
|
+
_this11.$emit('key-press', e, _this11.triggerQuery);
|
|
2357
1785
|
},
|
|
2358
|
-
input:
|
|
1786
|
+
input: _this11.onInputChange,
|
|
2359
1787
|
focus: function focus(e) {
|
|
2360
|
-
|
|
1788
|
+
_this11.$emit('focus', e, _this11.triggerQuery);
|
|
2361
1789
|
},
|
|
2362
|
-
keydown:
|
|
1790
|
+
keydown: _this11.handleKeyDown,
|
|
2363
1791
|
keyup: function keyup(e) {
|
|
2364
|
-
|
|
2365
|
-
|
|
1792
|
+
_this11.$emit('keyUp', e, _this11.triggerQuery);
|
|
1793
|
+
_this11.$emit('key-up', e, _this11.triggerQuery);
|
|
2366
1794
|
}
|
|
2367
1795
|
}), {
|
|
2368
|
-
"class": getClassName$1(
|
|
2369
|
-
"placeholder":
|
|
2370
|
-
"autofocus":
|
|
2371
|
-
"value":
|
|
2372
|
-
"iconPosition":
|
|
2373
|
-
"showIcon":
|
|
2374
|
-
"showClear":
|
|
2375
|
-
"ref":
|
|
2376
|
-
"themePreset":
|
|
2377
|
-
}), null),
|
|
1796
|
+
"class": getClassName$1(_this11.$props.innerClass, 'input') || '',
|
|
1797
|
+
"placeholder": _this11.$props.placeholder,
|
|
1798
|
+
"autofocus": _this11.$props.autoFocus,
|
|
1799
|
+
"value": _this11.$data.currentValue ? _this11.$data.currentValue : '',
|
|
1800
|
+
"iconPosition": _this11.$props.iconPosition,
|
|
1801
|
+
"showIcon": _this11.$props.showIcon,
|
|
1802
|
+
"showClear": _this11.$props.showClear,
|
|
1803
|
+
"ref": _this11.$props.innerRef,
|
|
1804
|
+
"themePreset": _this11.themePreset
|
|
1805
|
+
}), null), _this11.renderIcons()];
|
|
2378
1806
|
}
|
|
2379
|
-
}),
|
|
1807
|
+
}), _this11.renderInputAddonAfter(), _this11.renderEnterButtonElement()];
|
|
2380
1808
|
}
|
|
2381
1809
|
})])];
|
|
2382
1810
|
}
|
|
@@ -2429,24 +1857,18 @@ var mapStateToProps = function mapStateToProps(state, props) {
|
|
|
2429
1857
|
rawData: state.rawData[props.componentId],
|
|
2430
1858
|
aggregationData: state.compositeAggregations[props.componentId] || [],
|
|
2431
1859
|
themePreset: state.config.themePreset,
|
|
2432
|
-
isLoading: !!state.isLoading[
|
|
1860
|
+
isLoading: !!state.isLoading[props.componentId + "_active"],
|
|
2433
1861
|
error: state.error[props.componentId],
|
|
2434
1862
|
time: state.hits[props.componentId] && state.hits[props.componentId].time || 0,
|
|
2435
1863
|
total: state.hits[props.componentId] && state.hits[props.componentId].total,
|
|
2436
|
-
hidden: state.hits[props.componentId] && state.hits[props.componentId].hidden
|
|
2437
|
-
AIResponse: state.AIResponses[props.componentId] && state.AIResponses[props.componentId].response || null,
|
|
2438
|
-
isAIResponseLoading: state.AIResponses[props.componentId] && state.AIResponses[props.componentId].isLoading,
|
|
2439
|
-
AIResponseError: state.AIResponses[props.componentId] && state.AIResponses[props.componentId].error,
|
|
2440
|
-
sessionIdFromStore: state.AIResponses[props.componentId] && state.AIResponses[props.componentId].response && state.AIResponses[props.componentId].response.sessionId || '',
|
|
2441
|
-
isAITyping: state.AIResponses[props.componentId] && state.AIResponses[props.componentId].response && state.AIResponses[props.componentId].response.isTyping || false
|
|
1864
|
+
hidden: state.hits[props.componentId] && state.hits[props.componentId].hidden
|
|
2442
1865
|
};
|
|
2443
1866
|
};
|
|
2444
1867
|
var mapDispatchToProps = {
|
|
2445
1868
|
updateQuery: updateQuery,
|
|
2446
1869
|
setCustomQuery: setCustomQuery,
|
|
2447
1870
|
setDefaultQuery: setDefaultQuery,
|
|
2448
|
-
recordSuggestionClick: recordSuggestionClick
|
|
2449
|
-
recordAISessionUsefulness: recordAISessionUsefulness
|
|
1871
|
+
recordSuggestionClick: recordSuggestionClick
|
|
2450
1872
|
};
|
|
2451
1873
|
var SBConnected = PreferencesConsumer(ComponentWrapper(connect(mapStateToProps, mapDispatchToProps)(SearchBox), {
|
|
2452
1874
|
componentType: componentTypes.searchBox,
|
|
@@ -2462,608 +1884,9 @@ SBConnected.install = function (Vue) {
|
|
|
2462
1884
|
// Add componentType for SSR
|
|
2463
1885
|
SBConnected.componentType = componentTypes.searchBox;
|
|
2464
1886
|
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
}
|
|
2468
|
-
var md$1 = new Remarkable();
|
|
2469
|
-
md$1.set({
|
|
2470
|
-
html: true,
|
|
2471
|
-
breaks: true,
|
|
2472
|
-
xhtmlOut: true
|
|
2473
|
-
});
|
|
2474
|
-
var _inputWrapperRef = 'inputWrapperRef';
|
|
2475
|
-
var _inputRef = 'inputRef';
|
|
2476
|
-
var _errorContainerRef = 'errorContainerRef';
|
|
2477
|
-
var AIAnswer = defineComponent({
|
|
2478
|
-
name: 'AIAnswer',
|
|
2479
|
-
data: function data() {
|
|
2480
|
-
var props = this.$props;
|
|
2481
|
-
this.__state = {
|
|
2482
|
-
messages: [],
|
|
2483
|
-
inputMessage: '',
|
|
2484
|
-
AISessionId: '',
|
|
2485
|
-
error: null
|
|
2486
|
-
};
|
|
2487
|
-
this.internalComponent = props.componentId + "__internal";
|
|
2488
|
-
return this.__state;
|
|
2489
|
-
},
|
|
2490
|
-
inject: {
|
|
2491
|
-
theme: {
|
|
2492
|
-
from: 'theme_reactivesearch'
|
|
2493
|
-
}
|
|
2494
|
-
},
|
|
2495
|
-
created: function created() {},
|
|
2496
|
-
computed: {
|
|
2497
|
-
hasCustomRenderer: function hasCustomRenderer$1() {
|
|
2498
|
-
return hasCustomRenderer(this);
|
|
2499
|
-
},
|
|
2500
|
-
isLoadingState: function isLoadingState() {
|
|
2501
|
-
return this.isAIResponseLoading || this.isLoading;
|
|
2502
|
-
},
|
|
2503
|
-
shouldShowComponent: function shouldShowComponent() {
|
|
2504
|
-
return this.showComponent;
|
|
2505
|
-
},
|
|
2506
|
-
errorMessageForMissingSessionId: function errorMessageForMissingSessionId() {
|
|
2507
|
-
return "AISessionId for " + this.$props.componentId + " is missing! AIAnswer component requires an AISessionId to function. Try reloading the App.";
|
|
2508
|
-
}
|
|
2509
|
-
},
|
|
2510
|
-
props: {
|
|
2511
|
-
componentId: types.string.isRequired,
|
|
2512
|
-
showVoiceInput: VueTypes.bool.def(false),
|
|
2513
|
-
showFeedback: VueTypes.bool.def(true),
|
|
2514
|
-
showIcon: VueTypes.bool.def(true),
|
|
2515
|
-
onData: types.func,
|
|
2516
|
-
innerRef: VueTypes.string.def('AISearchInputField'),
|
|
2517
|
-
react: types.react,
|
|
2518
|
-
enableAI: VueTypes.bool.def(true),
|
|
2519
|
-
AIConfig: types.AIConfig,
|
|
2520
|
-
iconPosition: types.iconPosition.def('left'),
|
|
2521
|
-
themePreset: types.themePreset,
|
|
2522
|
-
theme: types.style,
|
|
2523
|
-
icon: types.children,
|
|
2524
|
-
iconURL: VueTypes.string.def(''),
|
|
2525
|
-
renderMic: types.func,
|
|
2526
|
-
getMicInstance: types.func,
|
|
2527
|
-
innerClass: types.style,
|
|
2528
|
-
placeholder: VueTypes.string.def('Ask a question'),
|
|
2529
|
-
title: types.title,
|
|
2530
|
-
AIResponse: types.componentObject,
|
|
2531
|
-
isAIResponseLoading: VueTypes.bool.def(false),
|
|
2532
|
-
AIResponseError: types.componentObject,
|
|
2533
|
-
getAIResponse: types.func.isRequired,
|
|
2534
|
-
enterButton: types.bool,
|
|
2535
|
-
renderEnterButton: types.title,
|
|
2536
|
-
showInput: VueTypes.bool.def(true),
|
|
2537
|
-
clearSessionOnDestroy: VueTypes.bool.def(true),
|
|
2538
|
-
rawData: types.rawData,
|
|
2539
|
-
render: types.func,
|
|
2540
|
-
onError: types.func,
|
|
2541
|
-
renderError: types.title,
|
|
2542
|
-
isLoading: types.boolRequired,
|
|
2543
|
-
sessionIdFromStore: VueTypes.string,
|
|
2544
|
-
showComponent: types.boolRequired,
|
|
2545
|
-
componentError: types.componentObject,
|
|
2546
|
-
style: types.style
|
|
2547
|
-
},
|
|
2548
|
-
mounted: function mounted() {},
|
|
2549
|
-
watch: {
|
|
2550
|
-
AIResponse: function AIResponse(newVal) {
|
|
2551
|
-
if (newVal) {
|
|
2552
|
-
this.AISessionId = ((getObjectFromLocalStorage(AI_LOCAL_CACHE_KEY) || {})[this.$props.componentId] || {}).sessionId || null;
|
|
2553
|
-
var messagesHistory = newVal.messages,
|
|
2554
|
-
response = newVal.response;
|
|
2555
|
-
var finalMessages = [];
|
|
2556
|
-
if (response && response.error) {
|
|
2557
|
-
this.error = {
|
|
2558
|
-
message: response.error
|
|
2559
|
-
};
|
|
2560
|
-
}
|
|
2561
|
-
|
|
2562
|
-
// pushing message history so far
|
|
2563
|
-
if (messagesHistory && messagesHistory && Array.isArray(messagesHistory)) {
|
|
2564
|
-
finalMessages.push.apply(finalMessages, messagesHistory.filter(function (msg) {
|
|
2565
|
-
return msg.role !== AI_ROLES.SYSTEM;
|
|
2566
|
-
}));
|
|
2567
|
-
} else if (response && response.answer && response.answer.text) {
|
|
2568
|
-
finalMessages.push({
|
|
2569
|
-
role: AI_ROLES.ASSISTANT,
|
|
2570
|
-
content: response.answer.text
|
|
2571
|
-
});
|
|
2572
|
-
if (!this.AISessionId) this.error = {
|
|
2573
|
-
message: this.errorMessageForMissingSessionId
|
|
2574
|
-
};
|
|
2575
|
-
}
|
|
2576
|
-
this.messages = finalMessages;
|
|
2577
|
-
} else if (!newVal && !this.error) {
|
|
2578
|
-
this.messages = [];
|
|
2579
|
-
}
|
|
2580
|
-
},
|
|
2581
|
-
rawData: function rawData(newVal) {
|
|
2582
|
-
this.$emit('on-data', {
|
|
2583
|
-
data: this.messages,
|
|
2584
|
-
rawData: newVal,
|
|
2585
|
-
loading: this.$props.isAIResponseLoading || this.$props.isLoading,
|
|
2586
|
-
error: this.$props.AIResponseError
|
|
2587
|
-
});
|
|
2588
|
-
},
|
|
2589
|
-
isAIResponseLoading: function isAIResponseLoading(newVal) {
|
|
2590
|
-
this.$emit('on-data', {
|
|
2591
|
-
data: this.messages,
|
|
2592
|
-
rawData: this.$props.rawData,
|
|
2593
|
-
loading: newVal || this.isLoading,
|
|
2594
|
-
error: this.$props.AIResponseError
|
|
2595
|
-
});
|
|
2596
|
-
},
|
|
2597
|
-
isLoading: function isLoading(newVal) {
|
|
2598
|
-
this.$emit('on-data', {
|
|
2599
|
-
data: this.messages,
|
|
2600
|
-
rawData: this.$props.rawData,
|
|
2601
|
-
loading: newVal || this.isAIResponseLoading,
|
|
2602
|
-
error: this.$props.AIResponseError
|
|
2603
|
-
});
|
|
2604
|
-
},
|
|
2605
|
-
sessionIdFromStore: function sessionIdFromStore(newVal) {
|
|
2606
|
-
if (newVal) {
|
|
2607
|
-
this.sessionId = newVal;
|
|
2608
|
-
}
|
|
2609
|
-
},
|
|
2610
|
-
AIResponseError: function AIResponseError(newVal) {
|
|
2611
|
-
this.error = newVal;
|
|
2612
|
-
this.AISessionId = ((getObjectFromLocalStorage(AI_LOCAL_CACHE_KEY) || {})[this.$props.componentId] || {}).sessionId || null;
|
|
2613
|
-
if (this.error && !this.AISessionId) {
|
|
2614
|
-
var errorMessage = this.errorMessageForMissingSessionId;
|
|
2615
|
-
this.error = {
|
|
2616
|
-
message: errorMessage
|
|
2617
|
-
};
|
|
2618
|
-
console.error(errorMessage);
|
|
2619
|
-
}
|
|
2620
|
-
this.$emit('on-data', {
|
|
2621
|
-
data: this.messages,
|
|
2622
|
-
rawData: this.$props.rawData,
|
|
2623
|
-
loading: this.isAIResponseLoading || this.isLoading,
|
|
2624
|
-
error: newVal
|
|
2625
|
-
});
|
|
2626
|
-
},
|
|
2627
|
-
messages: function messages() {
|
|
2628
|
-
this.scrollToBottom();
|
|
2629
|
-
},
|
|
2630
|
-
componentError: function componentError(newVal) {
|
|
2631
|
-
var _this = this;
|
|
2632
|
-
if (newVal && newVal._bodyBlob) {
|
|
2633
|
-
this.AISessionId = ((getObjectFromLocalStorage(AI_LOCAL_CACHE_KEY) || {})[this.$props.componentId] || {}).sessionId || null;
|
|
2634
|
-
if (!this.AISessionId) {
|
|
2635
|
-
this.generateNewSessionId();
|
|
2636
|
-
}
|
|
2637
|
-
newVal._bodyBlob.text().then(function (textData) {
|
|
2638
|
-
try {
|
|
2639
|
-
var parsedErrorRes = JSON.parse(textData);
|
|
2640
|
-
if (parsedErrorRes.error) {
|
|
2641
|
-
_this.error = parsedErrorRes.error;
|
|
2642
|
-
_this.$emit('on-data', {
|
|
2643
|
-
data: _this.messages,
|
|
2644
|
-
rawData: _this.$props.rawData,
|
|
2645
|
-
loading: _this.$props.isAIResponseLoading || _this.$props.isLoading,
|
|
2646
|
-
error: parsedErrorRes.error
|
|
2647
|
-
});
|
|
2648
|
-
}
|
|
2649
|
-
} catch (error) {
|
|
2650
|
-
console.error('Error parsing component error JSON:', error);
|
|
2651
|
-
}
|
|
2652
|
-
})["catch"](function (error) {
|
|
2653
|
-
console.error('Error reading component error text data:', error);
|
|
2654
|
-
});
|
|
2655
|
-
}
|
|
2656
|
-
}
|
|
2657
|
-
},
|
|
2658
|
-
methods: {
|
|
2659
|
-
generateNewSessionId: function generateNewSessionId() {
|
|
2660
|
-
var _this2 = this;
|
|
2661
|
-
var newSessionPromise = this.createAISession();
|
|
2662
|
-
newSessionPromise.then(function (res) {
|
|
2663
|
-
_this2.AISessionId = res.AIsessionId;
|
|
2664
|
-
})["catch"](function (e) {
|
|
2665
|
-
console.error(e);
|
|
2666
|
-
});
|
|
2667
|
-
},
|
|
2668
|
-
scrollToBottom: function scrollToBottom() {
|
|
2669
|
-
var _this3 = this;
|
|
2670
|
-
this.$nextTick(function () {
|
|
2671
|
-
var _this3$$refs;
|
|
2672
|
-
var messageContainer = (_this3$$refs = _this3.$refs) == null ? void 0 : _this3$$refs[_this3.$props.innerRef];
|
|
2673
|
-
if (messageContainer && messageContainer.$el) {
|
|
2674
|
-
messageContainer.$el.scrollTo({
|
|
2675
|
-
top: messageContainer.$el.scrollHeight,
|
|
2676
|
-
behavior: 'smooth'
|
|
2677
|
-
});
|
|
2678
|
-
}
|
|
2679
|
-
});
|
|
2680
|
-
},
|
|
2681
|
-
handleMessageInputChange: function handleMessageInputChange(e) {
|
|
2682
|
-
this.inputMessage = e.target.value;
|
|
2683
|
-
this.handleTextAreaHeightChange();
|
|
2684
|
-
},
|
|
2685
|
-
handleSendMessage: function handleSendMessage(e, isRetry, text) {
|
|
2686
|
-
if (isRetry === void 0) {
|
|
2687
|
-
isRetry = false;
|
|
2688
|
-
}
|
|
2689
|
-
if (text === void 0) {
|
|
2690
|
-
text = this.inputMessage;
|
|
2691
|
-
}
|
|
2692
|
-
if (typeof e === 'object' && e !== null) e.preventDefault();
|
|
2693
|
-
if (text.trim()) {
|
|
2694
|
-
if (this.isLoadingState) {
|
|
2695
|
-
return;
|
|
2696
|
-
}
|
|
2697
|
-
if (this.AISessionId) {
|
|
2698
|
-
if (!isRetry) this.messages = [].concat(this.messages, [{
|
|
2699
|
-
content: text,
|
|
2700
|
-
role: AI_ROLES.USER
|
|
2701
|
-
}]);
|
|
2702
|
-
this.getAIResponse(this.AISessionId, this.componentId, text);
|
|
2703
|
-
} else {
|
|
2704
|
-
console.error(this.errorMessageForMissingSessionId);
|
|
2705
|
-
this.error = {
|
|
2706
|
-
message: "AISessionId for " + this.$props.componentId + " is missing! AIAnswer component requires an AISessionId to function. Trying reloading the App."
|
|
2707
|
-
};
|
|
2708
|
-
}
|
|
2709
|
-
this.inputMessage = '';
|
|
2710
|
-
}
|
|
2711
|
-
},
|
|
2712
|
-
handleRetryRequest: function handleRetryRequest() {
|
|
2713
|
-
if (this.messages && !this.isLoadingState) {
|
|
2714
|
-
var _this$messages;
|
|
2715
|
-
var lastUserRequestMessage = (_this$messages = this.messages[this.messages.length - 1]) == null ? void 0 : _this$messages.content;
|
|
2716
|
-
if (this.AISessionId) {
|
|
2717
|
-
this.getAIResponse(this.AISessionId, this.componentId, lastUserRequestMessage);
|
|
2718
|
-
this.inputMessage = '';
|
|
2719
|
-
} else {
|
|
2720
|
-
console.error("AISessionId for " + this.componentId + " is missing! AIAnswer component requires an AISessionId to function. Try reloading the App.");
|
|
2721
|
-
}
|
|
2722
|
-
}
|
|
2723
|
-
},
|
|
2724
|
-
renderErrorComponent: function renderErrorComponent() {
|
|
2725
|
-
var renderError = this.$slots.renderError || this.$props.renderError;
|
|
2726
|
-
if (this.error && !this.isLoadingState) {
|
|
2727
|
-
var _this$error, _this$error2;
|
|
2728
|
-
if (renderError) {
|
|
2729
|
-
return createVNode("div", {
|
|
2730
|
-
"ref": _errorContainerRef,
|
|
2731
|
-
"class": "--ai-answer-error-container " + (getClassName$2(this.$props.innerClass, 'ai-error') || '')
|
|
2732
|
-
}, [isFunction(renderError) ? renderError(this.error, this.handleRetryRequest) : renderError]);
|
|
2733
|
-
}
|
|
2734
|
-
return createVNode("div", {
|
|
2735
|
-
"ref": _errorContainerRef,
|
|
2736
|
-
"class": "--ai-answer-error-container " + (getClassName$2(this.$props.innerClass, 'ai-error') || '')
|
|
2737
|
-
}, [createVNode("div", {
|
|
2738
|
-
"class": "--default-error-element"
|
|
2739
|
-
}, [createVNode("span", null, [(_this$error = this.error) != null && _this$error.message ? this.error.message : 'There was an error in generating the response.', ' ', (_this$error2 = this.error) != null && _this$error2.code ? ", Code:\n\t\t\t\t\t\t\t" + this.error.code : '']), this.AISessionId && createVNode(Button, {
|
|
2740
|
-
"primary": true,
|
|
2741
|
-
"onClick": this.handleRetryRequest
|
|
2742
|
-
}, {
|
|
2743
|
-
"default": function _default() {
|
|
2744
|
-
return [createTextVNode("Try again")];
|
|
2745
|
-
}
|
|
2746
|
-
})])]);
|
|
2747
|
-
}
|
|
2748
|
-
return null;
|
|
2749
|
-
},
|
|
2750
|
-
handleKeyPress: function handleKeyPress(e) {
|
|
2751
|
-
window.console.log('e', e);
|
|
2752
|
-
if (e.key === 'Enter') {
|
|
2753
|
-
this.handleSendMessage(e);
|
|
2754
|
-
this.inputMessage = '';
|
|
2755
|
-
}
|
|
2756
|
-
},
|
|
2757
|
-
renderIcon: function renderIcon() {
|
|
2758
|
-
if (this.$props.showIcon) {
|
|
2759
|
-
if (this.$props.icon) {
|
|
2760
|
-
return this.$props.icon;
|
|
2761
|
-
}
|
|
2762
|
-
if (this.$slots.icon) {
|
|
2763
|
-
return this.$slots.icon();
|
|
2764
|
-
}
|
|
2765
|
-
if (this.$props.iconURL) {
|
|
2766
|
-
return createVNode("img", {
|
|
2767
|
-
"style": {
|
|
2768
|
-
maxHeight: '25px'
|
|
2769
|
-
},
|
|
2770
|
-
"src": this.$props.iconURL,
|
|
2771
|
-
"alt": "search-icon"
|
|
2772
|
-
}, null);
|
|
2773
|
-
}
|
|
2774
|
-
return createVNode(SearchSvg, null, null);
|
|
2775
|
-
}
|
|
2776
|
-
return null;
|
|
2777
|
-
},
|
|
2778
|
-
shouldMicRender: function shouldMicRender(showVoiceSearch) {
|
|
2779
|
-
// checks for SSR
|
|
2780
|
-
if (typeof window === 'undefined') return false;
|
|
2781
|
-
return showVoiceSearch && (window.webkitSpeechRecognition || window.SpeechRecognition);
|
|
2782
|
-
},
|
|
2783
|
-
handleVoiceResults: function handleVoiceResults(_ref) {
|
|
2784
|
-
var results = _ref.results;
|
|
2785
|
-
if (results && results[0] && results[0].isFinal && results[0][0] && results[0][0].transcript && results[0][0].transcript.trim()) {
|
|
2786
|
-
this.handleSendMessage(null, false, results[0][0].transcript.trim());
|
|
2787
|
-
}
|
|
2788
|
-
},
|
|
2789
|
-
renderIcons: function renderIcons() {
|
|
2790
|
-
var _this4 = this;
|
|
2791
|
-
var _slot, _slot2;
|
|
2792
|
-
var _this$$props = this.$props,
|
|
2793
|
-
getMicInstance = _this$$props.getMicInstance,
|
|
2794
|
-
showVoiceInput = _this$$props.showVoiceInput,
|
|
2795
|
-
iconPosition = _this$$props.iconPosition,
|
|
2796
|
-
innerClass = _this$$props.innerClass;
|
|
2797
|
-
var renderMic = this.$slots.renderMic || this.$props.renderMic;
|
|
2798
|
-
return createVNode("div", null, [createVNode(IconGroup, {
|
|
2799
|
-
"enableAI": true,
|
|
2800
|
-
"groupPosition": "right",
|
|
2801
|
-
"positionType": "absolute"
|
|
2802
|
-
}, {
|
|
2803
|
-
"default": function _default() {
|
|
2804
|
-
return [!_this4.isLoadingState && _this4.AISessionId && _this4.shouldMicRender(showVoiceInput) && createVNode(Mic, {
|
|
2805
|
-
"getInstance": getMicInstance,
|
|
2806
|
-
"render": renderMic,
|
|
2807
|
-
"handleResult": _this4.handleVoiceResults,
|
|
2808
|
-
"class": getClassName$2(innerClass, 'ai-search-mic') || null
|
|
2809
|
-
}, null), iconPosition === 'right' && createVNode(IconWrapper, null, _isSlot$1(_slot = _this4.renderIcon()) ? _slot : {
|
|
2810
|
-
"default": function _default() {
|
|
2811
|
-
return [_slot];
|
|
2812
|
-
}
|
|
2813
|
-
})];
|
|
2814
|
-
}
|
|
2815
|
-
}), createVNode(IconGroup, {
|
|
2816
|
-
"enableAI": true,
|
|
2817
|
-
"groupPosition": "left",
|
|
2818
|
-
"positionType": "absolute"
|
|
2819
|
-
}, {
|
|
2820
|
-
"default": function _default() {
|
|
2821
|
-
return [iconPosition === 'left' && createVNode(IconWrapper, null, _isSlot$1(_slot2 = _this4.renderIcon()) ? _slot2 : {
|
|
2822
|
-
"default": function _default() {
|
|
2823
|
-
return [_slot2];
|
|
2824
|
-
}
|
|
2825
|
-
})];
|
|
2826
|
-
}
|
|
2827
|
-
})]);
|
|
2828
|
-
},
|
|
2829
|
-
enterButtonOnClick: function enterButtonOnClick(e) {
|
|
2830
|
-
this.handleSendMessage(e);
|
|
2831
|
-
},
|
|
2832
|
-
renderEnterButtonElement: function renderEnterButtonElement() {
|
|
2833
|
-
var _this5 = this;
|
|
2834
|
-
var _this$$props2 = this.$props,
|
|
2835
|
-
enterButton = _this$$props2.enterButton,
|
|
2836
|
-
innerClass = _this$$props2.innerClass;
|
|
2837
|
-
var renderEnterButton = this.$slots.renderEnterButton;
|
|
2838
|
-
if (enterButton) {
|
|
2839
|
-
var getEnterButtonMarkup = function getEnterButtonMarkup() {
|
|
2840
|
-
if (renderEnterButton) {
|
|
2841
|
-
return renderEnterButton(_this5.enterButtonOnClick);
|
|
2842
|
-
}
|
|
2843
|
-
return createVNode(SendButton, {
|
|
2844
|
-
"primary": true,
|
|
2845
|
-
"type": "submit",
|
|
2846
|
-
"tabIndex": 0,
|
|
2847
|
-
"onClick": _this5.handleSendMessage,
|
|
2848
|
-
"onKeyPress": _this5.handleKeyPress,
|
|
2849
|
-
"class": "ask-btn " + getClassName$2(innerClass, 'ai-enter-button'),
|
|
2850
|
-
"disabled": _this5.isLoadingState || !_this5.AISessionId
|
|
2851
|
-
}, {
|
|
2852
|
-
"default": function _default() {
|
|
2853
|
-
return [createTextVNode("Send")];
|
|
2854
|
-
}
|
|
2855
|
-
});
|
|
2856
|
-
};
|
|
2857
|
-
return createVNode("div", {
|
|
2858
|
-
"class": "ai-enter-button-wrapper"
|
|
2859
|
-
}, [getEnterButtonMarkup()]);
|
|
2860
|
-
}
|
|
2861
|
-
return null;
|
|
2862
|
-
},
|
|
2863
|
-
getComponent: function getComponent$1() {
|
|
2864
|
-
var data = {
|
|
2865
|
-
error: this.AIResponseError,
|
|
2866
|
-
loading: this.isAIResponseLoading,
|
|
2867
|
-
data: this.messages,
|
|
2868
|
-
rawData: this.rawData
|
|
2869
|
-
};
|
|
2870
|
-
return getComponent(data, this);
|
|
2871
|
-
},
|
|
2872
|
-
handleTextAreaHeightChange: function handleTextAreaHeightChange() {
|
|
2873
|
-
var _this$$refs, _this$$refs$_inputRef, _this$$refs2, _this$$refs2$_inputWr, _this$$refs3;
|
|
2874
|
-
var textArea = (_this$$refs = this.$refs) == null ? void 0 : (_this$$refs$_inputRef = _this$$refs[_inputRef]) == null ? void 0 : _this$$refs$_inputRef.$el;
|
|
2875
|
-
var inputWrapper = (_this$$refs2 = this.$refs) == null ? void 0 : (_this$$refs2$_inputWr = _this$$refs2[_inputWrapperRef]) == null ? void 0 : _this$$refs2$_inputWr.$el;
|
|
2876
|
-
var errorContainer = (_this$$refs3 = this.$refs) == null ? void 0 : _this$$refs3[_errorContainerRef];
|
|
2877
|
-
if (textArea) {
|
|
2878
|
-
textArea.style.height = '42px';
|
|
2879
|
-
var lineHeight = parseInt(getComputedStyle(textArea).lineHeight, 10);
|
|
2880
|
-
var maxHeight = lineHeight * 11; // max height for 10 lines
|
|
2881
|
-
var height = Math.min(textArea.scrollHeight, maxHeight);
|
|
2882
|
-
textArea.style.height = height + "px";
|
|
2883
|
-
textArea.style.overflowY = height === maxHeight ? 'auto' : 'hidden';
|
|
2884
|
-
// wrapper around input/ textarea
|
|
2885
|
-
inputWrapper.style.height = height + "px";
|
|
2886
|
-
// adjust error-container
|
|
2887
|
-
|
|
2888
|
-
if (errorContainer) {
|
|
2889
|
-
errorContainer.style.bottom = height + "px";
|
|
2890
|
-
}
|
|
2891
|
-
this.$forceUpdate();
|
|
2892
|
-
}
|
|
2893
|
-
}
|
|
2894
|
-
},
|
|
2895
|
-
beforeUnmount: function beforeUnmount() {
|
|
2896
|
-
if (this.$props.clearSessionOnDestroy) {
|
|
2897
|
-
// cleanup logic
|
|
2898
|
-
// final Object to store in local storage cache
|
|
2899
|
-
var finalCacheObj = getObjectFromLocalStorage(AI_LOCAL_CACHE_KEY) || {};
|
|
2900
|
-
// delete current component's cache
|
|
2901
|
-
delete finalCacheObj[this.$props.componentId];
|
|
2902
|
-
// update local cache
|
|
2903
|
-
setObjectInLocalStorage(AI_LOCAL_CACHE_KEY, finalCacheObj);
|
|
2904
|
-
}
|
|
2905
|
-
},
|
|
2906
|
-
render: function render() {
|
|
2907
|
-
var _slot3;
|
|
2908
|
-
var _this6 = this;
|
|
2909
|
-
var props = this.$props;
|
|
2910
|
-
if (!this.shouldShowComponent) {
|
|
2911
|
-
return null;
|
|
2912
|
-
}
|
|
2913
|
-
return createVNode(Chatbox, {
|
|
2914
|
-
"style": props.style || {}
|
|
2915
|
-
}, {
|
|
2916
|
-
"default": function _default() {
|
|
2917
|
-
return [_this6.$props.title && createVNode(Title, {
|
|
2918
|
-
"class": getClassName$2(_this6.$props.innerClass, 'title') || ''
|
|
2919
|
-
}, {
|
|
2920
|
-
"default": function _default() {
|
|
2921
|
-
return [_this6.$props.title];
|
|
2922
|
-
}
|
|
2923
|
-
}), createVNode(ChatContainer, {
|
|
2924
|
-
"class": "--ai-chat-container",
|
|
2925
|
-
"theme": props.theme,
|
|
2926
|
-
"showInput": props.showInput
|
|
2927
|
-
}, {
|
|
2928
|
-
"default": function _default() {
|
|
2929
|
-
return [_this6.hasCustomRenderer && createVNode(MessagesContainer, {
|
|
2930
|
-
"themePreset": _this6.themePreset,
|
|
2931
|
-
"theme": props.theme,
|
|
2932
|
-
"ref": _this6.$props.innerRef,
|
|
2933
|
-
"class": "--ai-message-container " + (getClassName$2(props.innerClass, 'ai-message-container') || '')
|
|
2934
|
-
}, _isSlot$1(_slot3 = _this6.getComponent()) ? _slot3 : {
|
|
2935
|
-
"default": function _default() {
|
|
2936
|
-
return [_slot3];
|
|
2937
|
-
}
|
|
2938
|
-
}), !_this6.hasCustomRenderer && createVNode(MessagesContainer, {
|
|
2939
|
-
"themePreset": _this6.themePreset,
|
|
2940
|
-
"theme": props.theme,
|
|
2941
|
-
"ref": _this6.$props.innerRef,
|
|
2942
|
-
"class": "--ai-message-container " + (getClassName$2(props.innerClass, 'ai-message-container') || '')
|
|
2943
|
-
}, {
|
|
2944
|
-
"default": function _default() {
|
|
2945
|
-
return [_this6.messages.map(function (message, index) {
|
|
2946
|
-
return createVNode(Message, {
|
|
2947
|
-
"key": index,
|
|
2948
|
-
"isSender": message.role === AI_ROLES.USER,
|
|
2949
|
-
"innerHTML": md$1.render(message.content),
|
|
2950
|
-
"themePreset": _this6.themePreset,
|
|
2951
|
-
"theme": props.theme,
|
|
2952
|
-
"class": "--ai-answer-message " + (getClassName$2(props.innerClass, 'ai-message') || '')
|
|
2953
|
-
}, null);
|
|
2954
|
-
}), _this6.isLoadingState && createVNode(Message, {
|
|
2955
|
-
"themePreset": _this6.themePreset,
|
|
2956
|
-
"theme": props.theme,
|
|
2957
|
-
"isSender": false,
|
|
2958
|
-
"class": "--ai-answer-message " + (getClassName$2(props.innerClass, 'ai-message') || null)
|
|
2959
|
-
}, {
|
|
2960
|
-
"default": function _default() {
|
|
2961
|
-
return [createVNode(TypingIndicator, null, {
|
|
2962
|
-
"default": function _default() {
|
|
2963
|
-
return [createVNode(TypingDot, {
|
|
2964
|
-
"themePreset": _this6.themePreset
|
|
2965
|
-
}, null), createVNode(TypingDot, {
|
|
2966
|
-
"themePreset": _this6.themePreset
|
|
2967
|
-
}, null), createVNode(TypingDot, {
|
|
2968
|
-
"themePreset": _this6.themePreset
|
|
2969
|
-
}, null)];
|
|
2970
|
-
}
|
|
2971
|
-
})];
|
|
2972
|
-
}
|
|
2973
|
-
})];
|
|
2974
|
-
}
|
|
2975
|
-
}), _this6.renderErrorComponent(), ' ', props.showFeedback && createVNode("div", {
|
|
2976
|
-
"class": "--ai-answer-feedback-container " + (getClassName$2(props.innerClass, 'ai-feedback') || '')
|
|
2977
|
-
}, [createVNode(AIFeedback, {
|
|
2978
|
-
"hideUI": _this6.isLoadingState || !_this6.sessionId,
|
|
2979
|
-
"key": _this6.sessionId,
|
|
2980
|
-
"onFeedbackSubmit": function onFeedbackSubmit(useful, reason) {
|
|
2981
|
-
_this6.trackUsefullness(_this6.sessionId, {
|
|
2982
|
-
useful: useful,
|
|
2983
|
-
reason: reason
|
|
2984
|
-
});
|
|
2985
|
-
}
|
|
2986
|
-
}, null)]), props.showInput && createVNode(MessageInputContainer, {
|
|
2987
|
-
"class": "--ai-input-container",
|
|
2988
|
-
"onSubmit": _this6.handleSendMessage
|
|
2989
|
-
}, {
|
|
2990
|
-
"default": function _default() {
|
|
2991
|
-
return [createVNode(InputGroup, {
|
|
2992
|
-
"enableAI": true,
|
|
2993
|
-
"isOpen": false
|
|
2994
|
-
}, {
|
|
2995
|
-
"default": function _default() {
|
|
2996
|
-
return [createVNode(InputWrapper, {
|
|
2997
|
-
"ref": _inputWrapperRef
|
|
2998
|
-
}, {
|
|
2999
|
-
"default": function _default() {
|
|
3000
|
-
return [createVNode(MessageInput, {
|
|
3001
|
-
"ref": _inputRef,
|
|
3002
|
-
"placeholder": props.placeholder,
|
|
3003
|
-
"enterButton": props.enterButton,
|
|
3004
|
-
"value": _this6.inputMessage,
|
|
3005
|
-
"onInput": _this6.handleMessageInputChange,
|
|
3006
|
-
"id": props.componentId + "-ai-input",
|
|
3007
|
-
"showIcon": props.showIcon,
|
|
3008
|
-
"iconPosition": props.iconPosition,
|
|
3009
|
-
"themePreset": _this6.themePreset,
|
|
3010
|
-
"disabled": _this6.isLoadingState || !_this6.AISessionId,
|
|
3011
|
-
"class": getClassName$2(props.innerClass, 'ai-input') || null
|
|
3012
|
-
}, null), ' ', _this6.renderIcons()];
|
|
3013
|
-
}
|
|
3014
|
-
})];
|
|
3015
|
-
}
|
|
3016
|
-
}), _this6.renderEnterButtonElement()];
|
|
3017
|
-
}
|
|
3018
|
-
}), ' '];
|
|
3019
|
-
}
|
|
3020
|
-
})];
|
|
3021
|
-
}
|
|
3022
|
-
});
|
|
3023
|
-
}
|
|
3024
|
-
});
|
|
3025
|
-
AIAnswer.hasInternalComponent = function () {
|
|
3026
|
-
return true;
|
|
3027
|
-
};
|
|
3028
|
-
var mapStateToProps$1 = function mapStateToProps(state, props) {
|
|
3029
|
-
var dependencyComponent = Object.values(props.react)[0];
|
|
3030
|
-
if (Array.isArray(dependencyComponent)) {
|
|
3031
|
-
// eslint-disable-next-line prefer-destructuring
|
|
3032
|
-
dependencyComponent = dependencyComponent[0];
|
|
3033
|
-
}
|
|
3034
|
-
var showComponent = state.selectedValues[dependencyComponent] && state.selectedValues[dependencyComponent].value;
|
|
3035
|
-
return {
|
|
3036
|
-
showComponent: showComponent,
|
|
3037
|
-
AIResponse: state.AIResponses[props.componentId] && state.AIResponses[props.componentId].response,
|
|
3038
|
-
isAIResponseLoading: state.AIResponses[props.componentId] && state.AIResponses[props.componentId].isLoading,
|
|
3039
|
-
AIResponseError: state.AIResponses[props.componentId] && state.AIResponses[props.componentId].error,
|
|
3040
|
-
rawData: state.rawData[props.componentId],
|
|
3041
|
-
themePreset: state.config.themePreset,
|
|
3042
|
-
isLoading: state.isLoading[props.componentId] || false,
|
|
3043
|
-
sessionIdFromStore: state.AIResponses[props.componentId] && state.AIResponses[props.componentId].response && state.AIResponses[props.componentId].response.sessionId || '',
|
|
3044
|
-
componentError: state.error[props.componentId]
|
|
3045
|
-
};
|
|
3046
|
-
};
|
|
3047
|
-
var mapDispatchToProps$1 = {
|
|
3048
|
-
getAIResponse: fetchAIResponse,
|
|
3049
|
-
trackUsefullness: recordAISessionUsefulness,
|
|
3050
|
-
createAISession: createAISession
|
|
3051
|
-
};
|
|
3052
|
-
var AIConnected = PreferencesConsumer(ComponentWrapper(connect(mapStateToProps$1, mapDispatchToProps$1)(AIAnswer), {
|
|
3053
|
-
componentType: componentTypes.AIAnswer,
|
|
3054
|
-
internalComponent: true
|
|
3055
|
-
}));
|
|
3056
|
-
AIConnected.name = AIAnswer.name;
|
|
3057
|
-
AIConnected.hasInternalComponent = AIAnswer.hasInternalComponent;
|
|
3058
|
-
AIConnected.install = function (Vue) {
|
|
3059
|
-
Vue.component(AIConnected.name, AIConnected);
|
|
3060
|
-
};
|
|
3061
|
-
// Add componentType for SSR
|
|
3062
|
-
AIConnected.componentType = componentTypes.AIAnswer;
|
|
3063
|
-
|
|
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"])));
|
|
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) {
|
|
1887
|
+
var _templateObject$5, _templateObject2$1;
|
|
1888
|
+
var HierarchicalMenuList = styled('ul')(_templateObject$5 || (_templateObject$5 = _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"])));
|
|
1889
|
+
var HierarchicalMenuListItem = styled('li')(_templateObject2$1 || (_templateObject2$1 = _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) {
|
|
3067
1890
|
return !props.showLine && "\n\t\t\t\t\tdisplay: none;\n\t\t\t\t";
|
|
3068
1891
|
});
|
|
3069
1892
|
|
|
@@ -3276,7 +2099,7 @@ var HierarchicalMenuListItemComponent = {
|
|
|
3276
2099
|
}
|
|
3277
2100
|
};
|
|
3278
2101
|
|
|
3279
|
-
function _isSlot$
|
|
2102
|
+
function _isSlot$1(s) {
|
|
3280
2103
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
|
|
3281
2104
|
}
|
|
3282
2105
|
var HierarchicalMenuComponent = {
|
|
@@ -3301,7 +2124,7 @@ var HierarchicalMenuComponent = {
|
|
|
3301
2124
|
return createVNode(HierarchicalMenuList, {
|
|
3302
2125
|
"class": "" + (isExpanded ? '--open' : ''),
|
|
3303
2126
|
"isSelected": isExpanded
|
|
3304
|
-
}, _isSlot$
|
|
2127
|
+
}, _isSlot$1(_slot = listArray.map(function (listItem) {
|
|
3305
2128
|
return createVNode(HierarchicalMenuListItemComponent, mergeProps({
|
|
3306
2129
|
"key": parentPath + "__" + JSON.stringify(listItem),
|
|
3307
2130
|
"parentPath": parentPath,
|
|
@@ -3315,7 +2138,7 @@ var HierarchicalMenuComponent = {
|
|
|
3315
2138
|
}
|
|
3316
2139
|
};
|
|
3317
2140
|
|
|
3318
|
-
function _isSlot$
|
|
2141
|
+
function _isSlot$2(s) {
|
|
3319
2142
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
|
|
3320
2143
|
}
|
|
3321
2144
|
var updateQueryAction = Actions.updateQuery,
|
|
@@ -3765,7 +2588,7 @@ var TreeList = {
|
|
|
3765
2588
|
"default": function _default() {
|
|
3766
2589
|
return [props.title && createVNode(Title, {
|
|
3767
2590
|
"class": getClassName$2(innerClass, 'title') || null
|
|
3768
|
-
}, _isSlot$
|
|
2591
|
+
}, _isSlot$2(title) ? title : {
|
|
3769
2592
|
"default": function _default() {
|
|
3770
2593
|
return [title];
|
|
3771
2594
|
}
|
|
@@ -3794,7 +2617,7 @@ var TreeList = {
|
|
|
3794
2617
|
});
|
|
3795
2618
|
}
|
|
3796
2619
|
};
|
|
3797
|
-
var mapStateToProps$
|
|
2620
|
+
var mapStateToProps$1 = function mapStateToProps(state, props) {
|
|
3798
2621
|
return {
|
|
3799
2622
|
selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || null,
|
|
3800
2623
|
rawData: state.rawData[props.componentId] || {},
|
|
@@ -3812,7 +2635,7 @@ var mapDispatchtoProps = {
|
|
|
3812
2635
|
TreeList.hasInternalComponent = function () {
|
|
3813
2636
|
return true;
|
|
3814
2637
|
};
|
|
3815
|
-
var TreeListConnected = PreferencesConsumer(ComponentWrapper(connect(mapStateToProps$
|
|
2638
|
+
var TreeListConnected = PreferencesConsumer(ComponentWrapper(connect(mapStateToProps$1, mapDispatchtoProps)(TreeList), {
|
|
3816
2639
|
componentType: componentTypes.treeList,
|
|
3817
2640
|
internalComponent: TreeList.hasInternalComponent()
|
|
3818
2641
|
}));
|
|
@@ -3880,7 +2703,7 @@ RcConnected.install = function (Vue) {
|
|
|
3880
2703
|
Vue.component(RcConnected.name, RcConnected);
|
|
3881
2704
|
};
|
|
3882
2705
|
|
|
3883
|
-
var components = [ReactiveList, ResultCard, ResultList, ReactiveBase, SBConnected, SingleList, MultiList, SingleRange, MultiRange, RangeSlider, DynamicRangeSlider, ReactiveComponent, RcConnected, SelectedFilters, ToggleButton, SingleDropdownList, MultiDropdownList, StateProvider, RangeInput, TreeListConnected
|
|
2706
|
+
var components = [ReactiveList, ResultCard, ResultList, ReactiveBase, SBConnected, SingleList, MultiList, SingleRange, MultiRange, RangeSlider, DynamicRangeSlider, ReactiveComponent, RcConnected, SelectedFilters, ToggleButton, SingleDropdownList, MultiDropdownList, StateProvider, RangeInput, TreeListConnected];
|
|
3884
2707
|
function install (Vue) {
|
|
3885
2708
|
components.map(function (component) {
|
|
3886
2709
|
Vue.use(component);
|
|
@@ -3888,4 +2711,4 @@ function install (Vue) {
|
|
|
3888
2711
|
});
|
|
3889
2712
|
}
|
|
3890
2713
|
|
|
3891
|
-
export {
|
|
2714
|
+
export { RcConnected as R, SBConnected as S, TreeListConnected as T, install as i };
|