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