@appbaseio/reactivesearch-vue 3.0.0-rc.9 → 3.0.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 +4885 -705
- package/dist/@appbaseio/reactivesearch-vue.umd.js.map +1 -1
- package/dist/@appbaseio/reactivesearch-vue.umd.min.js +5 -5
- package/dist/@appbaseio/reactivesearch-vue.umd.min.js.map +1 -1
- package/dist/cjs/{ComponentWrapper-0b9ffb1a.js → ComponentWrapper-0334c14b.js} +1 -1
- package/dist/cjs/{DropDown-aef75c14.js → DropDown-26666911.js} +14 -6
- package/dist/cjs/DynamicRangeSlider.js +7 -4
- package/dist/cjs/{Input-56eba499.js → Input-3ecdb905.js} +27 -74
- package/dist/cjs/MultiDropdownList.js +7 -6
- package/dist/cjs/MultiList.js +6 -5
- package/dist/cjs/MultiRange.js +5 -4
- package/dist/cjs/{Pagination-bcf8af5f.js → Pagination-c53a18ab.js} +1 -1
- package/dist/cjs/{PreferencesConsumer-85dee673.js → PreferencesConsumer-7bee3c57.js} +1 -1
- package/dist/cjs/RangeInput.js +8 -5
- package/dist/cjs/RangeSlider.js +8 -5
- package/dist/cjs/ReactiveBase.js +20 -18
- package/dist/cjs/ReactiveComponent.js +5 -4
- package/dist/cjs/ReactiveGoogleMap.js +8 -5
- package/dist/cjs/ReactiveList.js +6 -5
- package/dist/cjs/ResultCard.js +1 -1
- package/dist/cjs/ResultList.js +1 -1
- package/dist/cjs/SelectedFilters.js +2 -2
- package/dist/cjs/SingleDropdownList.js +7 -6
- package/dist/cjs/SingleList.js +6 -5
- package/dist/cjs/SingleRange.js +5 -4
- package/dist/cjs/StateProvider.js +1 -1
- package/dist/cjs/ToggleButton.js +5 -4
- package/dist/cjs/{index-779ed366.js → index-1f41363f.js} +7 -3
- package/dist/cjs/index.js +11 -8
- package/dist/cjs/{install-e8141489.js → install-5d1a97a5.js} +833 -287
- package/dist/cjs/install.js +11 -8
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/{vueTypes-a5f1745e.js → vueTypes-289a891a.js} +2 -1
- package/dist/components/ReactiveBase/ReactiveBase.d.ts +33 -0
- package/dist/components/basic/ReactiveComponent.d.ts +30 -0
- package/dist/components/basic/ReactiveComponentPrivate.d.ts +10 -0
- package/dist/components/basic/SelectedFilters.d.ts +24 -0
- package/dist/components/basic/StateProvider.d.ts +12 -0
- package/dist/components/list/MultiDropdownList.d.ts +49 -0
- package/dist/components/list/MultiList.d.ts +47 -0
- package/dist/components/list/SingleDropdownList.d.ts +47 -0
- package/dist/components/list/SingleList.d.ts +47 -0
- package/dist/components/list/ToggleButton.d.ts +33 -0
- package/dist/components/list/TreeList.d.ts +48 -0
- package/dist/components/range/DynamicRangeSlider.d.ts +38 -0
- package/dist/components/range/MultiRange.d.ts +30 -0
- package/dist/components/range/RangeInput.d.ts +30 -0
- package/dist/components/range/RangeSlider.d.ts +40 -0
- package/dist/components/range/SingleRange.d.ts +28 -0
- package/dist/components/result/ReactiveList.d.ts +55 -0
- package/dist/components/result/ResultCard.d.ts +10 -0
- package/dist/components/result/ResultList.d.ts +11 -0
- package/dist/components/search/AIAnswer.d.ts +44 -0
- package/dist/components/search/SearchBox.d.ts +107 -0
- package/dist/es/{ComponentWrapper-a2635cfc.js → ComponentWrapper-46d04344.js} +1 -1
- package/dist/es/{DropDown-39fedff8.js → DropDown-48045fde.js} +14 -7
- package/dist/es/DynamicRangeSlider.js +8 -5
- package/dist/es/{Input-11d211d2.js → Input-83dee8c5.js} +26 -75
- package/dist/es/MultiDropdownList.js +7 -6
- package/dist/es/MultiList.js +6 -5
- package/dist/es/MultiRange.js +5 -4
- package/dist/es/{Pagination-50fc3ef5.js → Pagination-591fdb79.js} +1 -1
- package/dist/es/{PreferencesConsumer-b058d14e.js → PreferencesConsumer-0856ed43.js} +1 -1
- package/dist/es/RangeInput.js +8 -5
- package/dist/es/RangeSlider.js +9 -6
- package/dist/es/ReactiveBase.js +20 -18
- package/dist/es/ReactiveComponent.js +5 -4
- package/dist/es/ReactiveGoogleMap.js +8 -5
- package/dist/es/ReactiveList.js +6 -5
- package/dist/es/ResultCard.js +1 -1
- package/dist/es/ResultList.js +1 -1
- package/dist/es/SelectedFilters.js +2 -2
- package/dist/es/SingleDropdownList.js +7 -6
- package/dist/es/SingleList.js +6 -5
- package/dist/es/SingleRange.js +5 -4
- package/dist/es/StateProvider.js +1 -1
- package/dist/es/ToggleButton.js +5 -4
- package/dist/es/{index-882489e1.js → index-104f1dfb.js} +7 -3
- package/dist/es/index.js +12 -9
- package/dist/es/{install-b785dd55.js → install-01aaa4e0.js} +835 -289
- package/dist/es/install.js +11 -8
- package/dist/es/version.js +1 -1
- package/dist/es/{vueTypes-09cab4d3.js → vueTypes-f503e267.js} +2 -1
- package/dist/index.d.ts +40 -0
- package/dist/types.ts +226 -0
- package/package.json +7 -4
|
@@ -13,21 +13,22 @@ var vueEmotion = require('@appbaseio/vue-emotion');
|
|
|
13
13
|
var css = require('@emotion/css');
|
|
14
14
|
var polished = require('polished');
|
|
15
15
|
var Button = require('./Button-f96a0570.js');
|
|
16
|
-
var vueTypes = require('./vueTypes-
|
|
16
|
+
var vueTypes = require('./vueTypes-289a891a.js');
|
|
17
17
|
var ReactiveList = require('./ReactiveList.js');
|
|
18
18
|
var transform = require('@appbaseio/reactivecore/lib/utils/transform');
|
|
19
|
-
var index = require('./index-
|
|
20
|
-
var ComponentWrapper = require('./ComponentWrapper-
|
|
21
|
-
var PreferencesConsumer = require('./PreferencesConsumer-
|
|
19
|
+
var index = require('./index-1f41363f.js');
|
|
20
|
+
var ComponentWrapper = require('./ComponentWrapper-0334c14b.js');
|
|
21
|
+
var PreferencesConsumer = require('./PreferencesConsumer-7bee3c57.js');
|
|
22
22
|
var Title = require('./Title-8802a218.js');
|
|
23
23
|
var ListItem = require('./ListItem-7a682970.js');
|
|
24
24
|
var Flex = require('./Flex-ddde6d26.js');
|
|
25
25
|
var analytics = require('@appbaseio/reactivecore/lib/actions/analytics');
|
|
26
26
|
var ReactiveBase = require('./ReactiveBase.js');
|
|
27
27
|
var hotkeys = _interopDefault(require('hotkeys-js'));
|
|
28
|
+
var xss = _interopDefault(require('xss'));
|
|
28
29
|
var remarkable = require('remarkable');
|
|
29
|
-
var DropDown = require('./DropDown-
|
|
30
|
-
var Input = require('./Input-
|
|
30
|
+
var DropDown = require('./DropDown-26666911.js');
|
|
31
|
+
var Input = require('./Input-3ecdb905.js');
|
|
31
32
|
var Container = require('./Container-29f049b2.js');
|
|
32
33
|
var Highlight = _interopDefault(require('vue-highlight-words'));
|
|
33
34
|
var query = require('@appbaseio/reactivecore/lib/actions/query');
|
|
@@ -52,7 +53,13 @@ var ResultList = require('./ResultList.js');
|
|
|
52
53
|
var StateProvider = require('./StateProvider.js');
|
|
53
54
|
|
|
54
55
|
var _templateObject;
|
|
55
|
-
var InputGroup = vueEmotion.styled('div')(_templateObject || (_templateObject = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tdisplay: flex;\n\talign-items: stretch;\n\twidth: 100%;\n"])))
|
|
56
|
+
var InputGroup = vueEmotion.styled('div')(_templateObject || (_templateObject = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n \tdisplay: flex;\n\talign-items: stretch;\n\twidth: 100%;\n\tbox-shadow: rgb(0 0 0 / 20%) 0px 0px 6px;\n\tborder-radius: 6px;\n\n\t", "\n\t", "\n\t};\n"])), function (_ref) {
|
|
57
|
+
var theme = _ref.theme,
|
|
58
|
+
searchBox = _ref.searchBox;
|
|
59
|
+
return searchBox && "background-color: " + (theme.colors.backgroundColor || '#fafafa') + ";\n\t\tcolor: " + (theme.colors.textColor || '#fff') + ";\n\n\t\t&:focus-within {\n\t\t\tbackground-color: " + (theme.colors.backgroundColor || '#fff') + ";\n\t\t}";
|
|
60
|
+
}, function (props) {
|
|
61
|
+
return props.isOpen && "box-shadow: rgb(0 0 0 / 20%) 0px 0px 15px;\n\t\tborder-bottom-left-radius: 0;\n\t\t\tborder-bottom-right-radius: 0;";
|
|
62
|
+
});
|
|
56
63
|
InputGroup.defaultProps = {
|
|
57
64
|
className: 'input-group'
|
|
58
65
|
};
|
|
@@ -782,8 +789,11 @@ var _templateObject$4, _templateObject2;
|
|
|
782
789
|
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
790
|
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
791
|
|
|
785
|
-
var _templateObject$5
|
|
786
|
-
var
|
|
792
|
+
var _templateObject$5;
|
|
793
|
+
var AutosuggestFooterContainer = vueEmotion.styled('div')(_templateObject$5 || (_templateObject$5 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tdisplay: flex;\n\tjustify-content: space-between;\n\talign-items: center;\n\tcolor: #8792a2;\n\tbackground: #f7fafc;\n\tpadding: 10px;\n\theight: 40px;\n"])));
|
|
794
|
+
|
|
795
|
+
var _templateObject$6, _templateObject2$1, _templateObject3;
|
|
796
|
+
var skeletonAnimation = css.keyframes(_templateObject$6 || (_templateObject$6 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n 0% {\n background-position: 100% 0;\n }\n 100% {\n background-position: -200% 0;\n }\n"])));
|
|
787
797
|
var SkeletonLoader = vueEmotion.styled('div')(_templateObject2$1 || (_templateObject2$1 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 10px;\n"])));
|
|
788
798
|
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
799
|
var HorizontalSkeletonLoader = vue.defineComponent({
|
|
@@ -797,9 +807,9 @@ var HorizontalSkeletonLoader = vue.defineComponent({
|
|
|
797
807
|
}
|
|
798
808
|
});
|
|
799
809
|
|
|
800
|
-
var _templateObject$
|
|
801
|
-
var Chatbox = vueEmotion.styled('div')(_templateObject$
|
|
802
|
-
return props.theme && props.theme.colors ? props.theme.colors.backgroundColor : '#fff';
|
|
810
|
+
var _templateObject$7, _templateObject2$2, _templateObject3$1, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11;
|
|
811
|
+
var Chatbox = vueEmotion.styled('div')(_templateObject$7 || (_templateObject$7 = _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\n\t.--trigger-message-wrapper {\n\t\tcursor: pointer;\n\t}\n"])), function (props) {
|
|
812
|
+
return props.theme && props.theme.colors ? polished.lighten(0.1, props.theme.colors.backgroundColor) : '#fff';
|
|
803
813
|
});
|
|
804
814
|
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
815
|
return props.showInput ? 'bottom: 48px;' : '';
|
|
@@ -823,11 +833,15 @@ var TypingDot = vueEmotion.styled('div')(_templateObject6 || (_templateObject6 =
|
|
|
823
833
|
return finalColor;
|
|
824
834
|
}, typingDots);
|
|
825
835
|
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: " + (
|
|
836
|
+
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\twhite-space: pre-wrap;\n\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: " + (
|
|
837
|
+
// eslint-disable-next-line no-nested-ternary
|
|
838
|
+
props.isSender ? props.themePreset !== 'dark' ? props.theme.colors.primaryColor : props.theme.colors.borderColor : props.theme.colors.borderColor) + ";\n\n\t}\n\n\tpre{\n\t\tcolor: " + (
|
|
839
|
+
// eslint-disable-next-line no-nested-ternary
|
|
840
|
+
props.isSender ? props.themePreset !== 'dark' ? props.theme.colors.primaryTextColor : props.theme.colors.textColor : props.theme.colors.primaryTextColor) + ";}\n\n\tcode {\n\t\tline-height: normal;\n\n\t\tcolor: " + (
|
|
827
841
|
// eslint-disable-next-line no-nested-ternary
|
|
828
|
-
props.isSender ? props.themePreset !== 'dark' ? props.theme.colors.
|
|
842
|
+
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\ncode[class*='language-'],\n\tpre[class*='language-'] {\n\t\tcolor: " + (
|
|
829
843
|
// 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\
|
|
844
|
+
props.isSender ? props.themePreset !== 'dark' ? props.theme.colors.primaryTextColor : props.theme.colors.textColor : props.theme.colors.primaryTextColor) + ";\n\t\ttext-shadow: none;\n\t}\n\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\n\t" + (props.themePreset === 'dark' && "a{\n\t\tcolor: cornflowerblue\n\t\t}") + ";\n";
|
|
831
845
|
};
|
|
832
846
|
var messageBGColor = function messageBGColor(props) {
|
|
833
847
|
var finalBGColor;
|
|
@@ -856,7 +870,7 @@ var Message = vueEmotion.styled('div')(_templateObject7 || (_templateObject7 = _
|
|
|
856
870
|
return resetCSS(props);
|
|
857
871
|
});
|
|
858
872
|
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) {
|
|
873
|
+
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\tpadding-left: 35px;\n"])), function (props) {
|
|
860
874
|
return props.themePreset === 'dark' ? props.theme.colors.borderColor : '#fff';
|
|
861
875
|
}, function (props) {
|
|
862
876
|
return props.themePreset === 'dark' ? props.theme.colors.titleColor : props.theme.colors.textColor;
|
|
@@ -873,8 +887,8 @@ var MessageInput = vueEmotion.styled(Input.TextArea)(_templateObject9 || (_templ
|
|
|
873
887
|
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
888
|
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
889
|
|
|
876
|
-
var _templateObject$
|
|
877
|
-
var fadeInFromBottom = css.keyframes(_templateObject$
|
|
890
|
+
var _templateObject$8, _templateObject2$3, _templateObject3$2, _templateObject4$1, _templateObject5$1, _templateObject6$1, _templateObject7$1;
|
|
891
|
+
var fadeInFromBottom = css.keyframes(_templateObject$8 || (_templateObject$8 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n 0% {\n opacity: 0;\n transform: translateY(20px);\n }\n 100% {\n opacity: 1;\n transform: translateY(0);\n }\n"])));
|
|
878
892
|
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
893
|
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
894
|
var themePreset = _ref.themePreset,
|
|
@@ -1078,7 +1092,9 @@ var md = new remarkable.Remarkable();
|
|
|
1078
1092
|
md.set({
|
|
1079
1093
|
html: true,
|
|
1080
1094
|
breaks: true,
|
|
1081
|
-
xhtmlOut: true
|
|
1095
|
+
xhtmlOut: true,
|
|
1096
|
+
linkify: true,
|
|
1097
|
+
linkTarget: '_blank'
|
|
1082
1098
|
});
|
|
1083
1099
|
var _dropdownULRef = 'dropdownULRef';
|
|
1084
1100
|
var _inputGroupRef = 'inputGroupRef';
|
|
@@ -1106,7 +1122,10 @@ var SearchBox = vue.defineComponent({
|
|
|
1106
1122
|
showAIScreen: false,
|
|
1107
1123
|
showAIScreenFooter: false,
|
|
1108
1124
|
showFeedbackComponent: false,
|
|
1109
|
-
feedbackState: null
|
|
1125
|
+
feedbackState: null,
|
|
1126
|
+
faqAnswer: '',
|
|
1127
|
+
faqQuestion: '',
|
|
1128
|
+
initialHits: null
|
|
1110
1129
|
};
|
|
1111
1130
|
this.internalComponent = props.componentId + "__internal";
|
|
1112
1131
|
return this.__state;
|
|
@@ -1142,11 +1161,55 @@ var SearchBox = vue.defineComponent({
|
|
|
1142
1161
|
}
|
|
1143
1162
|
},
|
|
1144
1163
|
computed: {
|
|
1164
|
+
currentTriggerMode: function currentTriggerMode() {
|
|
1165
|
+
return this.$props.AIUIConfig && this.$props.AIUIConfig.triggerOn || constants.AI_TRIGGER_MODES.MANUAL;
|
|
1166
|
+
},
|
|
1145
1167
|
hasCustomRenderer: function hasCustomRenderer() {
|
|
1146
1168
|
return index.hasCustomRenderer(this);
|
|
1147
1169
|
},
|
|
1148
1170
|
stats: function stats() {
|
|
1149
1171
|
return getResultStats(this);
|
|
1172
|
+
},
|
|
1173
|
+
mergedAIQuestion: function mergedAIQuestion() {
|
|
1174
|
+
return this.faqQuestion || this.AIResponse && this.AIResponse.response && this.AIResponse.response.question;
|
|
1175
|
+
},
|
|
1176
|
+
mergedAIAnswer: function mergedAIAnswer() {
|
|
1177
|
+
return this.faqAnswer || this.AIResponse && this.AIResponse.response && this.AIResponse.response.answer && this.AIResponse.response.answer.text;
|
|
1178
|
+
},
|
|
1179
|
+
parsedSuggestions: function parsedSuggestions() {
|
|
1180
|
+
var suggestionsArray = [];
|
|
1181
|
+
if (Array.isArray(this.suggestions) && this.suggestions.length) {
|
|
1182
|
+
suggestionsArray = [].concat(withClickIds(this.suggestions));
|
|
1183
|
+
}
|
|
1184
|
+
if (this.renderTriggerMessage() && this.currentValue) {
|
|
1185
|
+
suggestionsArray.unshift({
|
|
1186
|
+
label: this.renderTriggerMessage(),
|
|
1187
|
+
value: 'AI_TRIGGER_MESSAGE',
|
|
1188
|
+
_suggestion_type: '_internal_a_i_trigger'
|
|
1189
|
+
});
|
|
1190
|
+
}
|
|
1191
|
+
suggestionsArray = suggestionsArray.map(function (s) {
|
|
1192
|
+
if (s.sectionId) {
|
|
1193
|
+
return s;
|
|
1194
|
+
}
|
|
1195
|
+
return _rollupPluginBabelHelpers._extends({}, s, {
|
|
1196
|
+
sectionId: s._suggestion_type
|
|
1197
|
+
});
|
|
1198
|
+
});
|
|
1199
|
+
var sectionsAccumulated = [];
|
|
1200
|
+
var sectionisedSuggestions = suggestionsArray.reduce(function (acc, d, currentIndex) {
|
|
1201
|
+
if (sectionsAccumulated.includes(d.sectionId)) return acc;
|
|
1202
|
+
if (d.sectionId) {
|
|
1203
|
+
acc[currentIndex] = suggestionsArray.filter(function (g) {
|
|
1204
|
+
return g.sectionId === d.sectionId;
|
|
1205
|
+
});
|
|
1206
|
+
sectionsAccumulated.push(d.sectionId);
|
|
1207
|
+
} else {
|
|
1208
|
+
acc[currentIndex] = d;
|
|
1209
|
+
}
|
|
1210
|
+
return acc;
|
|
1211
|
+
}, {});
|
|
1212
|
+
return Object.values(sectionisedSuggestions);
|
|
1150
1213
|
}
|
|
1151
1214
|
},
|
|
1152
1215
|
props: {
|
|
@@ -1156,6 +1219,7 @@ var SearchBox = vue.defineComponent({
|
|
|
1156
1219
|
className: VueTypes.string.def(''),
|
|
1157
1220
|
clearIcon: vueTypes.types.children,
|
|
1158
1221
|
componentId: vueTypes.types.stringRequired,
|
|
1222
|
+
compoundClause: vueTypes.types.compoundClause,
|
|
1159
1223
|
customHighlight: vueTypes.types.func,
|
|
1160
1224
|
customQuery: vueTypes.types.func,
|
|
1161
1225
|
defaultQuery: vueTypes.types.func,
|
|
@@ -1178,6 +1242,11 @@ var SearchBox = vue.defineComponent({
|
|
|
1178
1242
|
enableQuerySuggestions: VueTypes.bool.def(false),
|
|
1179
1243
|
enablePopularSuggestions: VueTypes.bool.def(false),
|
|
1180
1244
|
enableRecentSuggestions: VueTypes.bool.def(false),
|
|
1245
|
+
enableFAQSuggestions: VueTypes.bool.def(false),
|
|
1246
|
+
FAQSuggestionsConfig: VueTypes.shape({
|
|
1247
|
+
sectionLabel: VueTypes.string,
|
|
1248
|
+
size: VueTypes.number
|
|
1249
|
+
}),
|
|
1181
1250
|
fieldWeights: vueTypes.types.fieldWeights,
|
|
1182
1251
|
filterLabel: vueTypes.types.string,
|
|
1183
1252
|
fuzziness: vueTypes.types.fuzziness,
|
|
@@ -1213,12 +1282,20 @@ var SearchBox = vue.defineComponent({
|
|
|
1213
1282
|
distinctFieldConfig: vueTypes.types.props,
|
|
1214
1283
|
//
|
|
1215
1284
|
focusShortcuts: VueTypes.arrayOf(VueTypes.oneOfType([VueTypes.string, VueTypes.number])).def(['/']),
|
|
1285
|
+
showFocusShortcutsIcon: VueTypes.bool.def(true),
|
|
1216
1286
|
addonBefore: VueTypes.any,
|
|
1217
1287
|
addonAfter: VueTypes.any,
|
|
1288
|
+
showSuggestionsFooter: VueTypes.bool.def(true),
|
|
1218
1289
|
expandSuggestionsContainer: VueTypes.bool.def(true),
|
|
1290
|
+
renderSuggestionsFooter: VueTypes.func,
|
|
1219
1291
|
index: VueTypes.string,
|
|
1220
1292
|
popularSuggestionsConfig: VueTypes.object,
|
|
1221
1293
|
recentSuggestionsConfig: VueTypes.object,
|
|
1294
|
+
featuredSuggestionsConfig: VueTypes.shape({
|
|
1295
|
+
maxSuggestionsPerSection: VueTypes.number,
|
|
1296
|
+
sectionsOrder: VueTypes.arrayOf(VueTypes.string)
|
|
1297
|
+
}),
|
|
1298
|
+
customEvents: VueTypes.object,
|
|
1222
1299
|
applyStopwords: VueTypes.bool,
|
|
1223
1300
|
customStopwords: vueTypes.types.stringArray,
|
|
1224
1301
|
onData: vueTypes.types.func,
|
|
@@ -1237,6 +1314,17 @@ var SearchBox = vue.defineComponent({
|
|
|
1237
1314
|
this.listenForFocusShortcuts();
|
|
1238
1315
|
},
|
|
1239
1316
|
watch: {
|
|
1317
|
+
AIResponse: function AIResponse(newVal) {
|
|
1318
|
+
if (newVal) {
|
|
1319
|
+
if (this.$props.AIUIConfig && this.$props.AIUIConfig.showSourceDocuments && newVal.response && newVal.response.answer && Array.isArray(newVal.response.answer.documentIds)) {
|
|
1320
|
+
this.sourceDocIds = newVal.response.answer.documentIds;
|
|
1321
|
+
var localCache = helper.getObjectFromLocalStorage(constants.AI_LOCAL_CACHE_KEY) && helper.getObjectFromLocalStorage(constants.AI_LOCAL_CACHE_KEY)[this.$props.componentId];
|
|
1322
|
+
if (localCache && localCache.meta && localCache.meta.hits) {
|
|
1323
|
+
this.initialHits = localCache.meta.hits;
|
|
1324
|
+
}
|
|
1325
|
+
}
|
|
1326
|
+
}
|
|
1327
|
+
},
|
|
1240
1328
|
dataField: function dataField(newVal, oldVal) {
|
|
1241
1329
|
if (!isEqual(newVal, oldVal)) {
|
|
1242
1330
|
this.triggerCustomQuery(this.$data.currentValue);
|
|
@@ -1293,7 +1381,11 @@ var SearchBox = vue.defineComponent({
|
|
|
1293
1381
|
if (this.$options.isTagsMode) {
|
|
1294
1382
|
cause = reactivecore.causes.SUGGESTION_SELECT;
|
|
1295
1383
|
}
|
|
1296
|
-
|
|
1384
|
+
if (this.$props.value === undefined) {
|
|
1385
|
+
this.setValue(newVal, newVal === '', this.$props, cause, false);
|
|
1386
|
+
} else {
|
|
1387
|
+
this.setValue(newVal || '', true, this.$props, cause);
|
|
1388
|
+
}
|
|
1297
1389
|
}
|
|
1298
1390
|
},
|
|
1299
1391
|
focusShortcuts: function focusShortcuts() {
|
|
@@ -1307,6 +1399,9 @@ var SearchBox = vue.defineComponent({
|
|
|
1307
1399
|
loading: this.isLoading,
|
|
1308
1400
|
error: this.isError
|
|
1309
1401
|
});
|
|
1402
|
+
if (newVal && newVal.hits && newVal.hits.hits) {
|
|
1403
|
+
this.initialHits = newVal.hits.hits;
|
|
1404
|
+
}
|
|
1310
1405
|
},
|
|
1311
1406
|
aggregationData: function aggregationData(newVal) {
|
|
1312
1407
|
this.$emit('on-data', {
|
|
@@ -1381,6 +1476,20 @@ var SearchBox = vue.defineComponent({
|
|
|
1381
1476
|
}
|
|
1382
1477
|
},
|
|
1383
1478
|
methods: {
|
|
1479
|
+
renderTriggerMessage: function renderTriggerMessage() {
|
|
1480
|
+
if (this.$props.enableAI) {
|
|
1481
|
+
if (this.$props.AIUIConfig && this.$props.AIUIConfig.renderTriggerMessage) {
|
|
1482
|
+
return this.$props.AIUIConfig.renderTriggerMessage;
|
|
1483
|
+
}
|
|
1484
|
+
if (this.$slots.renderTriggerMessage) {
|
|
1485
|
+
return this.$slots.renderTriggerMessage();
|
|
1486
|
+
}
|
|
1487
|
+
if (this.currentTriggerMode === constants.AI_TRIGGER_MODES.MANUAL && (this.$props.AIUIConfig ? !this.$props.AIUIConfig.askButton : true)) {
|
|
1488
|
+
return 'Click to trigger AIAnswer';
|
|
1489
|
+
}
|
|
1490
|
+
}
|
|
1491
|
+
return null;
|
|
1492
|
+
},
|
|
1384
1493
|
handleText: function handleText(value, cause) {
|
|
1385
1494
|
if (cause === reactivecore.causes.CLEAR_VALUE) {
|
|
1386
1495
|
this.triggerCustomQuery(value);
|
|
@@ -1405,8 +1514,8 @@ var SearchBox = vue.defineComponent({
|
|
|
1405
1514
|
value: currentValue,
|
|
1406
1515
|
resultStats: this.stats,
|
|
1407
1516
|
AIData: {
|
|
1408
|
-
question: this.
|
|
1409
|
-
answer: this.
|
|
1517
|
+
question: this.mergedAIQuestion,
|
|
1518
|
+
answer: this.mergedAIAnswer,
|
|
1410
1519
|
documentIds: this.AIResponse && this.AIResponse.response && this.AIResponse.response.answer && this.AIResponse.response.answer.documentIds || [],
|
|
1411
1520
|
showAIScreen: this.showAIScreen,
|
|
1412
1521
|
sources: this.getAISourceObjects(),
|
|
@@ -1437,7 +1546,7 @@ var SearchBox = vue.defineComponent({
|
|
|
1437
1546
|
this.onValueSelectedHandler(currentValue, reactivecore.causes.SEARCH_ICON_CLICK);
|
|
1438
1547
|
}
|
|
1439
1548
|
},
|
|
1440
|
-
setValue: function setValue(value, isDefaultValue, props, cause, toggleIsOpen, categoryValue) {
|
|
1549
|
+
setValue: function setValue(value, isDefaultValue, props, cause, toggleIsOpen, categoryValue, shouldExecuteQuery) {
|
|
1441
1550
|
var _this2 = this;
|
|
1442
1551
|
if (isDefaultValue === void 0) {
|
|
1443
1552
|
isDefaultValue = false;
|
|
@@ -1451,6 +1560,9 @@ var SearchBox = vue.defineComponent({
|
|
|
1451
1560
|
if (categoryValue === void 0) {
|
|
1452
1561
|
categoryValue = undefined;
|
|
1453
1562
|
}
|
|
1563
|
+
if (shouldExecuteQuery === void 0) {
|
|
1564
|
+
shouldExecuteQuery = true;
|
|
1565
|
+
}
|
|
1454
1566
|
var performUpdate = function performUpdate() {
|
|
1455
1567
|
if (_this2.$options.isTagsMode && isEqual(value, _this2.selectedTags)) {
|
|
1456
1568
|
return;
|
|
@@ -1479,24 +1591,31 @@ var SearchBox = vue.defineComponent({
|
|
|
1479
1591
|
if (_this2.$options.isTagsMode && cause === reactivecore.causes.SUGGESTION_SELECT) {
|
|
1480
1592
|
queryHandlerValue = Array.isArray(_this2.selectedTags) && _this2.selectedTags.length ? _this2.selectedTags : undefined;
|
|
1481
1593
|
}
|
|
1594
|
+
if ((_this2.faqAnswer || _this2.faqQuestion) && value === '') {
|
|
1595
|
+
// Empty the previous state
|
|
1596
|
+
_this2.faqAnswer = '';
|
|
1597
|
+
_this2.faqQuestion = '';
|
|
1598
|
+
_this2.showAIScreen = false;
|
|
1599
|
+
}
|
|
1482
1600
|
if (isDefaultValue) {
|
|
1483
1601
|
if (_this2.$props.autosuggest) {
|
|
1484
1602
|
if (toggleIsOpen) {
|
|
1485
1603
|
_this2.isOpen = false;
|
|
1486
1604
|
}
|
|
1487
|
-
if (typeof _this2.currentValue === 'string') _this2.triggerDefaultQuery(_this2.currentValue, props.enableAI ? {
|
|
1605
|
+
if (typeof _this2.currentValue === 'string') _this2.triggerDefaultQuery(_this2.currentValue, props.enableAI && _this2.currentTriggerMode === constants.AI_TRIGGER_MODES.QUESTION && _this2.currentValue.endsWith('?') ? {
|
|
1488
1606
|
enableAI: true
|
|
1489
|
-
} : {});
|
|
1607
|
+
} : {}, shouldExecuteQuery);
|
|
1490
1608
|
} // in case of strict selection only SUGGESTION_SELECT should be able
|
|
1491
1609
|
// to set the query otherwise the value should reset
|
|
1492
1610
|
if (props.strictSelection) {
|
|
1493
1611
|
if (cause === reactivecore.causes.SUGGESTION_SELECT || (_this2.$options.isTagsMode ? _this2.selectedTags.length === 0 : value === '')) {
|
|
1494
|
-
_this2.triggerCustomQuery(queryHandlerValue, _this2.$options.isTagsMode ? undefined : categoryValue);
|
|
1612
|
+
_this2.triggerCustomQuery(queryHandlerValue, _this2.$options.isTagsMode ? undefined : categoryValue, shouldExecuteQuery);
|
|
1495
1613
|
} else {
|
|
1496
1614
|
_this2.setValue('', true);
|
|
1497
1615
|
}
|
|
1498
1616
|
} else if (props.value === undefined || cause === reactivecore.causes.SUGGESTION_SELECT || cause === reactivecore.causes.CLEAR_VALUE) {
|
|
1499
|
-
_this2.
|
|
1617
|
+
_this2.showAIScreen = false;
|
|
1618
|
+
_this2.triggerCustomQuery(queryHandlerValue, _this2.$options.isTagsMode ? undefined : categoryValue, shouldExecuteQuery);
|
|
1500
1619
|
}
|
|
1501
1620
|
} else {
|
|
1502
1621
|
// debounce for handling text while typing
|
|
@@ -1507,10 +1626,13 @@ var SearchBox = vue.defineComponent({
|
|
|
1507
1626
|
};
|
|
1508
1627
|
checkValueChange(props.componentId, value, props.beforeValueChange, performUpdate);
|
|
1509
1628
|
},
|
|
1510
|
-
triggerDefaultQuery: function triggerDefaultQuery(paramValue, meta) {
|
|
1629
|
+
triggerDefaultQuery: function triggerDefaultQuery(paramValue, meta, shouldExecuteQuery) {
|
|
1511
1630
|
if (meta === void 0) {
|
|
1512
1631
|
meta = {};
|
|
1513
1632
|
}
|
|
1633
|
+
if (shouldExecuteQuery === void 0) {
|
|
1634
|
+
shouldExecuteQuery = true;
|
|
1635
|
+
}
|
|
1514
1636
|
if (!this.$props.autosuggest) {
|
|
1515
1637
|
return;
|
|
1516
1638
|
}
|
|
@@ -1531,12 +1653,15 @@ var SearchBox = vue.defineComponent({
|
|
|
1531
1653
|
value: value,
|
|
1532
1654
|
componentType: constants.componentTypes.searchBox,
|
|
1533
1655
|
meta: meta
|
|
1534
|
-
});
|
|
1656
|
+
}, shouldExecuteQuery);
|
|
1535
1657
|
},
|
|
1536
|
-
triggerCustomQuery: function triggerCustomQuery(paramValue, categoryValue) {
|
|
1658
|
+
triggerCustomQuery: function triggerCustomQuery(paramValue, categoryValue, shouldExecuteQuery) {
|
|
1537
1659
|
if (categoryValue === void 0) {
|
|
1538
1660
|
categoryValue = undefined;
|
|
1539
1661
|
}
|
|
1662
|
+
if (shouldExecuteQuery === void 0) {
|
|
1663
|
+
shouldExecuteQuery = true;
|
|
1664
|
+
}
|
|
1540
1665
|
var _this$$props = this.$props,
|
|
1541
1666
|
customQuery = _this$$props.customQuery,
|
|
1542
1667
|
filterLabel = _this$$props.filterLabel,
|
|
@@ -1565,7 +1690,7 @@ var SearchBox = vue.defineComponent({
|
|
|
1565
1690
|
URLParams: URLParams,
|
|
1566
1691
|
componentType: constants.componentTypes.searchBox,
|
|
1567
1692
|
category: categoryValue
|
|
1568
|
-
});
|
|
1693
|
+
}, shouldExecuteQuery);
|
|
1569
1694
|
},
|
|
1570
1695
|
handleFocus: function handleFocus(event) {
|
|
1571
1696
|
if (this.$props.autosuggest) {
|
|
@@ -1576,7 +1701,9 @@ var SearchBox = vue.defineComponent({
|
|
|
1576
1701
|
handleVoiceResults: function handleVoiceResults(_ref) {
|
|
1577
1702
|
var results = _ref.results;
|
|
1578
1703
|
if (results && results[0] && results[0].isFinal && results[0][0] && results[0][0].transcript && results[0][0].transcript.trim()) {
|
|
1704
|
+
var _this$$refs2;
|
|
1579
1705
|
this.setValue(results[0][0].transcript.trim(), true);
|
|
1706
|
+
(_this$$refs2 = this.$refs) == null || (_this$$refs2 = _this$$refs2[this.$props.innerRef]) == null || (_this$$refs2 = _this$$refs2.$el) == null ? void 0 : _this$$refs2.focus(); // eslint-disable-line
|
|
1580
1707
|
}
|
|
1581
1708
|
},
|
|
1582
1709
|
triggerQuery: function triggerQuery(_ref2) {
|
|
@@ -1616,6 +1743,8 @@ var SearchBox = vue.defineComponent({
|
|
|
1616
1743
|
clearValue: function clearValue() {
|
|
1617
1744
|
this.setValue('', false, this.$props, !this.$options.isTagsMode ? reactivecore.causes.CLEAR_VALUE : undefined, false);
|
|
1618
1745
|
this.onValueSelectedHandler('', !this.$options.isTagsMode ? reactivecore.causes.CLEAR_VALUE : undefined);
|
|
1746
|
+
this.showAIScreen = false;
|
|
1747
|
+
this.isOpen = false;
|
|
1619
1748
|
},
|
|
1620
1749
|
handleKeyDown: function handleKeyDown(event, highlightedIndex) {
|
|
1621
1750
|
if (highlightedIndex === void 0) {
|
|
@@ -1628,9 +1757,10 @@ var SearchBox = vue.defineComponent({
|
|
|
1628
1757
|
} else if (highlightedIndex === null) {
|
|
1629
1758
|
this.setValue(event.target.value, true, this.$props, this.$options.isTagsMode ? reactivecore.causes.SUGGESTION_SELECT : undefined,
|
|
1630
1759
|
// to handle tags
|
|
1631
|
-
!this.$props.enableAI);
|
|
1632
|
-
if (this.$props.enableAI && !this.showAIScreen) {
|
|
1760
|
+
!(this.$props.enableAI && this.currentTriggerMode === constants.AI_TRIGGER_MODES.QUESTION && event.target.value.endsWith('?')));
|
|
1761
|
+
if (this.$props.enableAI && !this.showAIScreen && this.currentTriggerMode === constants.AI_TRIGGER_MODES.QUESTION && event.target.value.endsWith('?')) {
|
|
1633
1762
|
this.showAIScreen = true;
|
|
1763
|
+
this.isOpen = true;
|
|
1634
1764
|
}
|
|
1635
1765
|
this.onValueSelectedHandler(event.target.value, reactivecore.causes.ENTER_PRESS);
|
|
1636
1766
|
}
|
|
@@ -1651,7 +1781,7 @@ var SearchBox = vue.defineComponent({
|
|
|
1651
1781
|
}
|
|
1652
1782
|
var value = this.$props.value;
|
|
1653
1783
|
if (value === undefined) {
|
|
1654
|
-
this.setValue(inputValue,
|
|
1784
|
+
this.setValue(inputValue, inputValue === '', this.$props, undefined, false);
|
|
1655
1785
|
} else {
|
|
1656
1786
|
this.$emit('change', inputValue, function (_ref3) {
|
|
1657
1787
|
var isOpen = _ref3.isOpen;
|
|
@@ -1664,12 +1794,72 @@ var SearchBox = vue.defineComponent({
|
|
|
1664
1794
|
}, e);
|
|
1665
1795
|
}
|
|
1666
1796
|
},
|
|
1797
|
+
handleFeaturedSuggestionClicked: function handleFeaturedSuggestionClicked(suggestion) {
|
|
1798
|
+
try {
|
|
1799
|
+
var _this$$refs3;
|
|
1800
|
+
if (suggestion.action === helper.featuredSuggestionsActionTypes.NAVIGATE) {
|
|
1801
|
+
var _JSON$parse = JSON.parse(suggestion.subAction),
|
|
1802
|
+
_JSON$parse$target = _JSON$parse.target,
|
|
1803
|
+
target = _JSON$parse$target === void 0 ? '_self' : _JSON$parse$target,
|
|
1804
|
+
_JSON$parse$link = _JSON$parse.link,
|
|
1805
|
+
link = _JSON$parse$link === void 0 ? '/' : _JSON$parse$link;
|
|
1806
|
+
if (typeof window !== 'undefined') {
|
|
1807
|
+
window.open(link, target);
|
|
1808
|
+
}
|
|
1809
|
+
}
|
|
1810
|
+
if (suggestion.action === helper.featuredSuggestionsActionTypes.FUNCTION) {
|
|
1811
|
+
var matchedValues = suggestion.subAction.match(/function\s*\(.*\)(.|\n)*/);
|
|
1812
|
+
var functionStr = matchedValues && matchedValues[0];
|
|
1813
|
+
// eslint-disable-next-line no-new-func
|
|
1814
|
+
var func = new Function("return " + functionStr)();
|
|
1815
|
+
func(suggestion, this.$data.currentValue, this.$props.customEvents);
|
|
1816
|
+
}
|
|
1817
|
+
if (suggestion.action === helper.featuredSuggestionsActionTypes.SELECT) {
|
|
1818
|
+
this.setValue(suggestion.value, true, this.$props, this.$options.isTagsMode.current ? reactivecore.causes.SUGGESTION_SELECT : reactivecore.causes.ENTER_PRESS, false);
|
|
1819
|
+
this.onValueSelectedHandler(suggestion.value, reactivecore.causes.SUGGESTION_SELECT);
|
|
1820
|
+
}
|
|
1821
|
+
// blur is important to close the dropdown
|
|
1822
|
+
// on selecting one of featured suggestions
|
|
1823
|
+
// else Downshift probably is focusing the dropdown
|
|
1824
|
+
// and not letting it close
|
|
1825
|
+
// eslint-disable-next-line no-unused-expressions
|
|
1826
|
+
(_this$$refs3 = this.$refs) == null || (_this$$refs3 = _this$$refs3[this.$props.innerRef]) == null || (_this$$refs3 = _this$$refs3.el) == null ? void 0 : _this$$refs3.blur();
|
|
1827
|
+
} catch (e) {
|
|
1828
|
+
console.error("Error: There was an error parsing the subAction for the featured suggestion with label, \"" + suggestion.label + "\"", e);
|
|
1829
|
+
}
|
|
1830
|
+
},
|
|
1667
1831
|
onSuggestionSelected: function onSuggestionSelected(suggestion) {
|
|
1668
1832
|
var _this4 = this;
|
|
1669
|
-
|
|
1833
|
+
var value = this.$props.value;
|
|
1834
|
+
// The state of the suggestion is open by the time it reaches here. i.e. isOpen = true
|
|
1835
|
+
// handle when FAQ suggestion is clicked
|
|
1836
|
+
if (suggestion && suggestion._suggestion_type === helper.suggestionTypes.FAQ) {
|
|
1837
|
+
this.currentValue = suggestion.value;
|
|
1838
|
+
// Handle AI
|
|
1839
|
+
// Independent of enableAI.
|
|
1840
|
+
this.faqAnswer = suggestion._answer;
|
|
1841
|
+
this.faqQuestion = suggestion.value;
|
|
1842
|
+
this.isOpen = true;
|
|
1670
1843
|
this.showAIScreen = true;
|
|
1844
|
+
if (value !== undefined) this.$emit('change', suggestion.value, function () {});
|
|
1845
|
+
this.onValueSelectedHandler(suggestion.value);
|
|
1846
|
+
return;
|
|
1847
|
+
}
|
|
1848
|
+
if (suggestion && suggestion._suggestion_type === '_internal_a_i_trigger') {
|
|
1849
|
+
this.showAIScreen = true;
|
|
1850
|
+
this.askButtonOnClick();
|
|
1851
|
+
return;
|
|
1852
|
+
}
|
|
1853
|
+
|
|
1854
|
+
// handle featured suggestions click event
|
|
1855
|
+
if (suggestion._suggestion_type === helper.suggestionTypes.Featured) {
|
|
1856
|
+
this.handleFeaturedSuggestionClicked(suggestion);
|
|
1857
|
+
// Handle AI
|
|
1858
|
+
if (!this.$props.enableAI) this.isOpen = false;else {
|
|
1859
|
+
this.showAIScreen = true;
|
|
1860
|
+
}
|
|
1861
|
+
return;
|
|
1671
1862
|
}
|
|
1672
|
-
var value = this.$props.value;
|
|
1673
1863
|
// Record analytics for selected suggestions
|
|
1674
1864
|
this.triggerClickAnalytics(suggestion._click_id);
|
|
1675
1865
|
if (value === undefined) {
|
|
@@ -1697,6 +1887,11 @@ var SearchBox = vue.defineComponent({
|
|
|
1697
1887
|
});
|
|
1698
1888
|
}
|
|
1699
1889
|
this.onValueSelectedHandler(suggestion.value, reactivecore.causes.SUGGESTION_SELECT, suggestion.source);
|
|
1890
|
+
|
|
1891
|
+
// Handle AI
|
|
1892
|
+
if (!this.$props.enableAI) this.isOpen = false;else if (this.currentTriggerMode === constants.AI_TRIGGER_MODES.QUESTION && suggestion.value.endsWith('?')) {
|
|
1893
|
+
this.showAIScreen = true;
|
|
1894
|
+
}
|
|
1700
1895
|
},
|
|
1701
1896
|
onValueSelectedHandler: function onValueSelectedHandler(currentValue) {
|
|
1702
1897
|
if (currentValue === void 0) {
|
|
@@ -1825,6 +2020,13 @@ var SearchBox = vue.defineComponent({
|
|
|
1825
2020
|
customQuery: true
|
|
1826
2021
|
});
|
|
1827
2022
|
},
|
|
2023
|
+
suggestionsFooter: function suggestionsFooter() {
|
|
2024
|
+
return typeof renderSuggestionsFooter === 'function' ? this.$props.renderSuggestionsFooter() : vue.createVNode(AutosuggestFooterContainer, null, {
|
|
2025
|
+
"default": function _default() {
|
|
2026
|
+
return [vue.createVNode("div", null, [vue.createTextVNode("\u2191\u2193 Navigate")]), vue.createVNode("div", null, [vue.createTextVNode("\u21A9 Go")])];
|
|
2027
|
+
}
|
|
2028
|
+
});
|
|
2029
|
+
},
|
|
1828
2030
|
renderEnterButtonElement: function renderEnterButtonElement() {
|
|
1829
2031
|
var _this6 = this;
|
|
1830
2032
|
var _this$$props2 = this.$props,
|
|
@@ -1852,71 +2054,98 @@ var SearchBox = vue.defineComponent({
|
|
|
1852
2054
|
}
|
|
1853
2055
|
return null;
|
|
1854
2056
|
},
|
|
1855
|
-
|
|
2057
|
+
renderShortcut: function renderShortcut() {
|
|
2058
|
+
if (this.$props.focusShortcuts && this.$props.focusShortcuts.length) {
|
|
2059
|
+
var shortcut = this.$props.focusShortcuts[0];
|
|
2060
|
+
shortcut = shortcut.toLowerCase();
|
|
2061
|
+
shortcut = shortcut.replace('shift', '⬆️');
|
|
2062
|
+
shortcut = shortcut.replace('command', 'cmd');
|
|
2063
|
+
shortcut = shortcut.replace('control', 'ctrl');
|
|
2064
|
+
shortcut = shortcut.replace('option', 'alt');
|
|
2065
|
+
return shortcut.toUpperCase();
|
|
2066
|
+
}
|
|
2067
|
+
return '/';
|
|
2068
|
+
},
|
|
2069
|
+
renderLeftIcons: function renderLeftIcons() {
|
|
1856
2070
|
var _this7 = this;
|
|
1857
|
-
var _slot3
|
|
2071
|
+
var _slot3;
|
|
1858
2072
|
var _this$$props3 = this.$props,
|
|
1859
2073
|
iconPosition = _this$$props3.iconPosition,
|
|
1860
|
-
showClear = _this$$props3.showClear,
|
|
1861
|
-
innerClass = _this$$props3.innerClass,
|
|
1862
|
-
getMicInstance = _this$$props3.getMicInstance,
|
|
1863
|
-
showVoiceSearch = _this$$props3.showVoiceSearch,
|
|
1864
2074
|
showIcon = _this$$props3.showIcon;
|
|
2075
|
+
return vue.createVNode("div", null, [vue.createVNode(DropDown.IconGroup, {
|
|
2076
|
+
"groupPosition": "left"
|
|
2077
|
+
}, {
|
|
2078
|
+
"default": function _default() {
|
|
2079
|
+
return [iconPosition === 'left' && showIcon && vue.createVNode(DropDown.IconWrapper, {
|
|
2080
|
+
"onClick": _this7.handleSearchIconClick
|
|
2081
|
+
}, _isSlot(_slot3 = _this7.renderIcon()) ? _slot3 : {
|
|
2082
|
+
"default": function _default() {
|
|
2083
|
+
return [_slot3];
|
|
2084
|
+
}
|
|
2085
|
+
})];
|
|
2086
|
+
}
|
|
2087
|
+
})]);
|
|
2088
|
+
},
|
|
2089
|
+
renderRightIcons: function renderRightIcons() {
|
|
2090
|
+
var _this8 = this;
|
|
2091
|
+
var _slot4, _slot5, _slot6;
|
|
2092
|
+
var _this$$props4 = this.$props,
|
|
2093
|
+
iconPosition = _this$$props4.iconPosition,
|
|
2094
|
+
showClear = _this$$props4.showClear,
|
|
2095
|
+
innerClass = _this$$props4.innerClass,
|
|
2096
|
+
getMicInstance = _this$$props4.getMicInstance,
|
|
2097
|
+
showVoiceSearch = _this$$props4.showVoiceSearch,
|
|
2098
|
+
showIcon = _this$$props4.showIcon,
|
|
2099
|
+
showFocusShortcutsIcon = _this$$props4.showFocusShortcutsIcon;
|
|
1865
2100
|
var renderMic = this.$slots.renderMic || this.$props.renderMic;
|
|
1866
2101
|
var currentValue = this.$data.currentValue;
|
|
1867
2102
|
return vue.createVNode("div", null, [vue.createVNode(DropDown.IconGroup, {
|
|
1868
|
-
"groupPosition": "right"
|
|
1869
|
-
"positionType": "absolute"
|
|
2103
|
+
"groupPosition": "right"
|
|
1870
2104
|
}, {
|
|
1871
2105
|
"default": function _default() {
|
|
1872
2106
|
return [currentValue && showClear && vue.createVNode(DropDown.IconWrapper, {
|
|
1873
|
-
"onClick":
|
|
2107
|
+
"onClick": _this8.clearValue,
|
|
1874
2108
|
"showIcon": showIcon,
|
|
1875
2109
|
"isClearIcon": true
|
|
1876
|
-
}, _isSlot(
|
|
2110
|
+
}, _isSlot(_slot4 = _this8.renderCancelIcon()) ? _slot4 : {
|
|
1877
2111
|
"default": function _default() {
|
|
1878
|
-
return [
|
|
2112
|
+
return [_slot4];
|
|
2113
|
+
}
|
|
2114
|
+
}), showFocusShortcutsIcon && vue.createVNode(DropDown.ButtonIconWrapper, {
|
|
2115
|
+
"onClick": function onClick(e) {
|
|
2116
|
+
return _this8.focusSearchBox(e);
|
|
2117
|
+
}
|
|
2118
|
+
}, _isSlot(_slot5 = _this8.renderShortcut()) ? _slot5 : {
|
|
2119
|
+
"default": function _default() {
|
|
2120
|
+
return [_slot5];
|
|
1879
2121
|
}
|
|
1880
2122
|
}), showVoiceSearch && vue.createVNode(Mic, {
|
|
1881
2123
|
"getInstance": getMicInstance,
|
|
1882
2124
|
"render": renderMic,
|
|
1883
|
-
"handleResult":
|
|
2125
|
+
"handleResult": _this8.handleVoiceResults,
|
|
1884
2126
|
"className": getClassName$1(innerClass, 'mic') || null
|
|
1885
2127
|
}, null), iconPosition === 'right' && showIcon && vue.createVNode(DropDown.IconWrapper, {
|
|
1886
|
-
"onClick":
|
|
1887
|
-
}, _isSlot(
|
|
2128
|
+
"onClick": _this8.handleSearchIconClick
|
|
2129
|
+
}, _isSlot(_slot6 = _this8.renderIcon()) ? _slot6 : {
|
|
1888
2130
|
"default": function _default() {
|
|
1889
|
-
return [
|
|
1890
|
-
}
|
|
1891
|
-
})];
|
|
1892
|
-
}
|
|
1893
|
-
}), vue.createVNode(DropDown.IconGroup, {
|
|
1894
|
-
"groupPosition": "left",
|
|
1895
|
-
"positionType": "absolute"
|
|
1896
|
-
}, {
|
|
1897
|
-
"default": function _default() {
|
|
1898
|
-
return [iconPosition === 'left' && showIcon && vue.createVNode(DropDown.IconWrapper, {
|
|
1899
|
-
"onClick": _this7.handleSearchIconClick
|
|
1900
|
-
}, _isSlot(_slot5 = _this7.renderIcon()) ? _slot5 : {
|
|
1901
|
-
"default": function _default() {
|
|
1902
|
-
return [_slot5];
|
|
2131
|
+
return [_slot6];
|
|
1903
2132
|
}
|
|
1904
2133
|
})];
|
|
1905
2134
|
}
|
|
1906
2135
|
})]);
|
|
1907
2136
|
},
|
|
1908
2137
|
focusSearchBox: function focusSearchBox(event) {
|
|
1909
|
-
var _this$$
|
|
2138
|
+
var _this$$refs4;
|
|
1910
2139
|
var elt = event.target || event.srcElement;
|
|
1911
2140
|
var tagName = elt.tagName;
|
|
1912
2141
|
if (elt.isContentEditable || tagName === 'INPUT' || tagName === 'SELECT' || tagName === 'TEXTAREA') {
|
|
1913
2142
|
// already in an input
|
|
1914
2143
|
return;
|
|
1915
2144
|
}
|
|
1916
|
-
(_this$$
|
|
2145
|
+
(_this$$refs4 = this.$refs) == null || (_this$$refs4 = _this$$refs4[this.$props.innerRef]) == null || (_this$$refs4 = _this$$refs4.$el) == null ? void 0 : _this$$refs4.focus(); // eslint-disable-line
|
|
1917
2146
|
},
|
|
1918
2147
|
listenForFocusShortcuts: function listenForFocusShortcuts() {
|
|
1919
|
-
var
|
|
2148
|
+
var _this9 = this;
|
|
1920
2149
|
var _this$$props$focusSho = this.$props.focusShortcuts,
|
|
1921
2150
|
focusShortcuts = _this$$props$focusSho === void 0 ? ['/'] : _this$$props$focusSho;
|
|
1922
2151
|
if (index.isEmpty(focusShortcuts)) {
|
|
@@ -1931,7 +2160,7 @@ var SearchBox = vue.defineComponent({
|
|
|
1931
2160
|
function (event, handler) {
|
|
1932
2161
|
// Prevent the default refresh event under WINDOWS system
|
|
1933
2162
|
event.preventDefault();
|
|
1934
|
-
|
|
2163
|
+
_this9.focusSearchBox(event);
|
|
1935
2164
|
});
|
|
1936
2165
|
|
|
1937
2166
|
// if one of modifier keys are used, they are handled below
|
|
@@ -1941,7 +2170,7 @@ var SearchBox = vue.defineComponent({
|
|
|
1941
2170
|
for (var index$1 = 0; index$1 < modifierKeys.length; index$1 += 1) {
|
|
1942
2171
|
var element = modifierKeys[index$1];
|
|
1943
2172
|
if (hotkeys[element]) {
|
|
1944
|
-
|
|
2173
|
+
_this9.focusSearchBox(event);
|
|
1945
2174
|
break;
|
|
1946
2175
|
}
|
|
1947
2176
|
}
|
|
@@ -1953,19 +2182,34 @@ var SearchBox = vue.defineComponent({
|
|
|
1953
2182
|
this.currentValue = index.decodeHtml(value);
|
|
1954
2183
|
this.triggerDefaultQuery(value);
|
|
1955
2184
|
},
|
|
1956
|
-
|
|
1957
|
-
var
|
|
2185
|
+
renderActionIcon: function renderActionIcon(suggestion) {
|
|
2186
|
+
var _this10 = this;
|
|
1958
2187
|
var handleAutoFillClick = function handleAutoFillClick(e) {
|
|
1959
2188
|
e.stopPropagation();
|
|
1960
|
-
|
|
2189
|
+
_this10.onAutofillClick(suggestion);
|
|
1961
2190
|
};
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
2191
|
+
if (suggestion._suggestion_type === helper.suggestionTypes.Featured) {
|
|
2192
|
+
if (suggestion.action === helper.featuredSuggestionsActionTypes.FUNCTION) {
|
|
2193
|
+
return vue.createVNode(AutoFillSvg, {
|
|
2194
|
+
"style": {
|
|
2195
|
+
transform: 'rotate(135deg)',
|
|
2196
|
+
pointerEvents: 'none'
|
|
2197
|
+
}
|
|
2198
|
+
}, null);
|
|
2199
|
+
}
|
|
2200
|
+
return null;
|
|
2201
|
+
}
|
|
2202
|
+
if (!suggestion._category) {
|
|
2203
|
+
/* 👇 avoid showing autofill for category suggestions👇 */
|
|
2204
|
+
|
|
2205
|
+
return vue.createVNode(AutoFillSvg, {
|
|
2206
|
+
"onClick": handleAutoFillClick
|
|
2207
|
+
}, null);
|
|
2208
|
+
}
|
|
2209
|
+
return null;
|
|
1966
2210
|
},
|
|
1967
2211
|
renderTag: function renderTag(item) {
|
|
1968
|
-
var
|
|
2212
|
+
var _this11 = this;
|
|
1969
2213
|
var innerClass = this.$props.innerClass;
|
|
1970
2214
|
return vue.createVNode(TagItem, {
|
|
1971
2215
|
"class": getClassName$1(innerClass, 'selected-tag') || ''
|
|
@@ -1976,7 +2220,7 @@ var SearchBox = vue.defineComponent({
|
|
|
1976
2220
|
"aria-label": "delete-tag",
|
|
1977
2221
|
"class": "close-icon",
|
|
1978
2222
|
"onClick": function onClick() {
|
|
1979
|
-
return
|
|
2223
|
+
return _this11.clearTag(item);
|
|
1980
2224
|
}
|
|
1981
2225
|
}, [vue.createVNode(DropDown.CancelSvg, null, null)])];
|
|
1982
2226
|
}
|
|
@@ -1999,7 +2243,7 @@ var SearchBox = vue.defineComponent({
|
|
|
1999
2243
|
}
|
|
2000
2244
|
},
|
|
2001
2245
|
renderTags: function renderTags() {
|
|
2002
|
-
var
|
|
2246
|
+
var _this12 = this;
|
|
2003
2247
|
if (!Array.isArray(this.selectedTags)) {
|
|
2004
2248
|
return null;
|
|
2005
2249
|
}
|
|
@@ -2013,16 +2257,16 @@ var SearchBox = vue.defineComponent({
|
|
|
2013
2257
|
}) : vue.createVNode(TagsContainer, null, {
|
|
2014
2258
|
"default": function _default() {
|
|
2015
2259
|
return [tagsList.map(function (item) {
|
|
2016
|
-
return
|
|
2260
|
+
return _this12.renderTag(item);
|
|
2017
2261
|
}), shouldRenderClearAllTag && vue.createVNode(TagItem, {
|
|
2018
|
-
"class": getClassName$1(
|
|
2262
|
+
"class": getClassName$1(_this12.$props.innerClass, 'selected-tag') || ''
|
|
2019
2263
|
}, {
|
|
2020
2264
|
"default": function _default() {
|
|
2021
2265
|
return [vue.createVNode("span", null, [vue.createTextVNode("Clear All")]), vue.createVNode("span", {
|
|
2022
2266
|
"role": "img",
|
|
2023
2267
|
"aria-label": "delete-tag",
|
|
2024
2268
|
"class": "close-icon",
|
|
2025
|
-
"onClick":
|
|
2269
|
+
"onClick": _this12.clearAllTags
|
|
2026
2270
|
}, [vue.createVNode(DropDown.CancelSvg, null, null)])];
|
|
2027
2271
|
}
|
|
2028
2272
|
})];
|
|
@@ -2030,13 +2274,13 @@ var SearchBox = vue.defineComponent({
|
|
|
2030
2274
|
});
|
|
2031
2275
|
},
|
|
2032
2276
|
getAISourceObjects: function getAISourceObjects() {
|
|
2033
|
-
var
|
|
2277
|
+
var _this13 = this;
|
|
2034
2278
|
var sourceObjects = [];
|
|
2035
2279
|
if (!this.AIResponse) return sourceObjects;
|
|
2036
2280
|
var docIds = this.AIResponse && this.AIResponse.response && this.AIResponse.response.answer && this.AIResponse.response.answer.documentIds || [];
|
|
2037
|
-
if (
|
|
2281
|
+
if (this.initialHits) {
|
|
2038
2282
|
docIds.forEach(function (id) {
|
|
2039
|
-
var foundSourceObj =
|
|
2283
|
+
var foundSourceObj = _this13.initialHits.find(function (hit) {
|
|
2040
2284
|
return hit._id === id;
|
|
2041
2285
|
}) || {};
|
|
2042
2286
|
if (foundSourceObj) {
|
|
@@ -2069,49 +2313,56 @@ var SearchBox = vue.defineComponent({
|
|
|
2069
2313
|
return vue.createVNode(HorizontalSkeletonLoader, null, null);
|
|
2070
2314
|
},
|
|
2071
2315
|
renderAIScreenFooter: function renderAIScreenFooter() {
|
|
2072
|
-
var
|
|
2073
|
-
var
|
|
2316
|
+
var _slot8;
|
|
2317
|
+
var _this14 = this;
|
|
2074
2318
|
var _this$$props$AIUIConf2 = this.$props.AIUIConfig,
|
|
2075
2319
|
AIUIConfig = _this$$props$AIUIConf2 === void 0 ? {} : _this$$props$AIUIConf2;
|
|
2076
2320
|
var _ref6 = AIUIConfig || {},
|
|
2077
2321
|
_ref6$showSourceDocum = _ref6.showSourceDocuments,
|
|
2078
2322
|
showSourceDocuments = _ref6$showSourceDocum === void 0 ? true : _ref6$showSourceDocum,
|
|
2079
|
-
_ref6$sourceDocumentL = _ref6.sourceDocumentLabel,
|
|
2080
|
-
sourceDocumentLabel = _ref6$sourceDocumentL === void 0 ? '_id' : _ref6$sourceDocumentL,
|
|
2081
2323
|
_ref6$onSourceClick = _ref6.onSourceClick,
|
|
2082
2324
|
onSourceClick = _ref6$onSourceClick === void 0 ? function () {} : _ref6$onSourceClick;
|
|
2325
|
+
var renderSourceDocumentLabel = function renderSourceDocumentLabel(sourceObj) {
|
|
2326
|
+
if (_this14.$props.AIUIConfig && _this14.$props.AIUIConfig.renderSourceDocument) {
|
|
2327
|
+
return _this14.$props.AIUIConfig.renderSourceDocument(sourceObj);
|
|
2328
|
+
}
|
|
2329
|
+
if (_this14.$slots.renderSourceDocument) {
|
|
2330
|
+
return _this14.$slots.renderSourceDocument(sourceObj);
|
|
2331
|
+
}
|
|
2332
|
+
return sourceObj._id;
|
|
2333
|
+
};
|
|
2083
2334
|
return showSourceDocuments && this.showAIScreenFooter && this.AIResponse && this.AIResponse.response && this.AIResponse.response.answer && this.AIResponse.response.answer.documentIds ? vue.createVNode(Footer, {
|
|
2084
2335
|
"themePreset": this.$props.themePreset
|
|
2085
2336
|
}, {
|
|
2086
2337
|
"default": function _default() {
|
|
2087
|
-
return [vue.createTextVNode("Summary generated using the following sources:"), ' ', vue.createVNode(SourceTags, null, _isSlot(
|
|
2338
|
+
return [vue.createTextVNode("Summary generated using the following sources:"), ' ', vue.createVNode(SourceTags, null, _isSlot(_slot8 = _this14.getAISourceObjects().map(function (el) {
|
|
2339
|
+
var _slot7;
|
|
2088
2340
|
return vue.createVNode(Button.Button, {
|
|
2089
|
-
"class": "--ai-source-tag " + (getClassName$1(
|
|
2090
|
-
"title": el[sourceDocumentLabel],
|
|
2341
|
+
"class": "--ai-source-tag " + (getClassName$1(_this14.$props.innerClass, 'ai-source-tag') || ''),
|
|
2091
2342
|
"info": true,
|
|
2092
2343
|
"onClick": function onClick() {
|
|
2093
2344
|
return onSourceClick && onSourceClick(el);
|
|
2094
2345
|
}
|
|
2095
|
-
}, {
|
|
2346
|
+
}, _isSlot(_slot7 = renderSourceDocumentLabel(el)) ? _slot7 : {
|
|
2096
2347
|
"default": function _default() {
|
|
2097
|
-
return [
|
|
2348
|
+
return [_slot7];
|
|
2098
2349
|
}
|
|
2099
2350
|
});
|
|
2100
|
-
})) ?
|
|
2351
|
+
})) ? _slot8 : {
|
|
2101
2352
|
"default": function _default() {
|
|
2102
|
-
return [
|
|
2353
|
+
return [_slot8];
|
|
2103
2354
|
}
|
|
2104
2355
|
})];
|
|
2105
2356
|
}
|
|
2106
2357
|
}) : null;
|
|
2107
2358
|
},
|
|
2108
2359
|
renderAIScreen: function renderAIScreen() {
|
|
2109
|
-
var
|
|
2360
|
+
var _this15 = this;
|
|
2110
2361
|
var customAIRenderer = this.$props.renderAIAnswer || this.$slots.renderAIAnswer;
|
|
2111
2362
|
if (customAIRenderer) {
|
|
2112
2363
|
return customAIRenderer({
|
|
2113
|
-
question: this.
|
|
2114
|
-
answer: this.
|
|
2364
|
+
question: this.mergedAIQuestion,
|
|
2365
|
+
answer: this.mergedAIAnswer,
|
|
2115
2366
|
documentIds: this.AIResponse && this.AIResponse.response && this.AIResponse.response.answer && this.AIResponse.response.answer.documentIds || [],
|
|
2116
2367
|
loading: this.isAIResponseLoading || this.isLoading,
|
|
2117
2368
|
sources: this.getAISourceObjects(),
|
|
@@ -2122,7 +2373,7 @@ var SearchBox = vue.defineComponent({
|
|
|
2122
2373
|
return this.renderAIScreenLoader();
|
|
2123
2374
|
}
|
|
2124
2375
|
return vue.createVNode("div", null, [vue.createVNode(Answer, {
|
|
2125
|
-
"innerHTML": md.render(this.
|
|
2376
|
+
"innerHTML": md.render(this.mergedAIAnswer)
|
|
2126
2377
|
}, null), this.renderAIScreenFooter(), this.showFeedbackComponent && vue.createVNode("div", {
|
|
2127
2378
|
"class": "" + (getClassName$1(this.$props.innerClass, 'ai-feedback') || '')
|
|
2128
2379
|
}, [vue.createVNode(AIFeedback, {
|
|
@@ -2130,11 +2381,11 @@ var SearchBox = vue.defineComponent({
|
|
|
2130
2381
|
"hideUI": this.isAIResponseLoading || this.isLoading || !this.sessionIdFromStore,
|
|
2131
2382
|
"key": this.sessionIdFromStore,
|
|
2132
2383
|
"onFeedbackSubmit": function onFeedbackSubmit(useful, reason) {
|
|
2133
|
-
|
|
2384
|
+
_this15.feedbackState = {
|
|
2134
2385
|
isRecorded: true,
|
|
2135
2386
|
feedbackType: useful ? 'positive' : 'negative'
|
|
2136
2387
|
};
|
|
2137
|
-
|
|
2388
|
+
_this15.recordAISessionUsefulness(_this15.sessionIdFromStore, {
|
|
2138
2389
|
useful: useful,
|
|
2139
2390
|
reason: reason
|
|
2140
2391
|
});
|
|
@@ -2169,22 +2420,22 @@ var SearchBox = vue.defineComponent({
|
|
|
2169
2420
|
});
|
|
2170
2421
|
},
|
|
2171
2422
|
renderAskButtonElement: function renderAskButtonElement() {
|
|
2172
|
-
var
|
|
2173
|
-
var _this$$
|
|
2174
|
-
AIUIConfig = _this$$
|
|
2175
|
-
innerClass = _this$$
|
|
2423
|
+
var _this16 = this;
|
|
2424
|
+
var _this$$props5 = this.$props,
|
|
2425
|
+
AIUIConfig = _this$$props5.AIUIConfig,
|
|
2426
|
+
innerClass = _this$$props5.innerClass;
|
|
2176
2427
|
var _ref7 = AIUIConfig || {},
|
|
2177
2428
|
askButton = _ref7.askButton;
|
|
2178
2429
|
var renderAskButton = this.$slots.renderAskButton;
|
|
2179
2430
|
if (askButton) {
|
|
2180
2431
|
var getEnterButtonMarkup = function getEnterButtonMarkup() {
|
|
2181
2432
|
if (renderAskButton) {
|
|
2182
|
-
return renderAskButton(
|
|
2433
|
+
return renderAskButton(_this16.askButtonOnClick);
|
|
2183
2434
|
}
|
|
2184
2435
|
return vue.createVNode(Button.Button, {
|
|
2185
2436
|
"class": "enter-btn " + getClassName$1(innerClass, 'ask-button'),
|
|
2186
2437
|
"info": true,
|
|
2187
|
-
"onClick":
|
|
2438
|
+
"onClick": _this16.askButtonOnClick
|
|
2188
2439
|
}, {
|
|
2189
2440
|
"default": function _default() {
|
|
2190
2441
|
return [vue.createTextVNode("Ask")];
|
|
@@ -2199,7 +2450,7 @@ var SearchBox = vue.defineComponent({
|
|
|
2199
2450
|
}
|
|
2200
2451
|
},
|
|
2201
2452
|
render: function render() {
|
|
2202
|
-
var
|
|
2453
|
+
var _this17 = this;
|
|
2203
2454
|
var expandSuggestionsContainer = this.$props.expandSuggestionsContainer;
|
|
2204
2455
|
var _this$$slots = this.$slots,
|
|
2205
2456
|
recentSearchesIcon = _this$$slots.recentSearchesIcon,
|
|
@@ -2210,17 +2461,17 @@ var SearchBox = vue.defineComponent({
|
|
|
2210
2461
|
"class": this.$props.className
|
|
2211
2462
|
}, {
|
|
2212
2463
|
"default": function _default() {
|
|
2213
|
-
return [
|
|
2214
|
-
"class": getClassName$1(
|
|
2464
|
+
return [_this17.$props.title && vue.createVNode(Title.Title, {
|
|
2465
|
+
"class": getClassName$1(_this17.$props.innerClass, 'title') || ''
|
|
2215
2466
|
}, {
|
|
2216
2467
|
"default": function _default() {
|
|
2217
|
-
return [
|
|
2468
|
+
return [_this17.$props.title];
|
|
2218
2469
|
}
|
|
2219
|
-
}),
|
|
2220
|
-
"id":
|
|
2221
|
-
"handleChange":
|
|
2222
|
-
"handleMouseup":
|
|
2223
|
-
"isOpen":
|
|
2470
|
+
}), _this17.$props.autosuggest ? vue.createVNode(DropDown.Downshift, {
|
|
2471
|
+
"id": _this17.$props.componentId + "-downshift",
|
|
2472
|
+
"handleChange": _this17.onSuggestionSelected,
|
|
2473
|
+
"handleMouseup": _this17.handleStateChange,
|
|
2474
|
+
"isOpen": _this17.$data.isOpen
|
|
2224
2475
|
}, {
|
|
2225
2476
|
"default": function _default(_ref8) {
|
|
2226
2477
|
var getInputEvents = _ref8.getInputEvents,
|
|
@@ -2231,156 +2482,249 @@ var SearchBox = vue.defineComponent({
|
|
|
2231
2482
|
highlightedIndex = _ref8.highlightedIndex,
|
|
2232
2483
|
setHighlightedIndex = _ref8.setHighlightedIndex;
|
|
2233
2484
|
var renderSuggestionsDropdown = function renderSuggestionsDropdown() {
|
|
2234
|
-
var getIcon = function getIcon(iconType) {
|
|
2485
|
+
var getIcon = function getIcon(iconType, item, leaveSpaceForIcon) {
|
|
2235
2486
|
switch (iconType) {
|
|
2236
2487
|
case helper.suggestionTypes.Recent:
|
|
2237
2488
|
return recentSearchesIcon;
|
|
2238
2489
|
case helper.suggestionTypes.Popular:
|
|
2239
2490
|
return popularSearchesIcon;
|
|
2491
|
+
case helper.suggestionTypes.Featured:
|
|
2492
|
+
if (item.icon) {
|
|
2493
|
+
return function () {
|
|
2494
|
+
return vue.createVNode("div", {
|
|
2495
|
+
"style": {
|
|
2496
|
+
display: 'flex'
|
|
2497
|
+
},
|
|
2498
|
+
"innerHTML": xss(item.icon)
|
|
2499
|
+
}, null);
|
|
2500
|
+
};
|
|
2501
|
+
}
|
|
2502
|
+
if (item.iconURL) {
|
|
2503
|
+
return function () {
|
|
2504
|
+
return (// When you change below also change the empty icon below
|
|
2505
|
+
vue.createVNode("img", {
|
|
2506
|
+
"style": {
|
|
2507
|
+
maxWidth: '30px'
|
|
2508
|
+
},
|
|
2509
|
+
"src": xss(item.iconURL),
|
|
2510
|
+
"alt": item.value
|
|
2511
|
+
}, null)
|
|
2512
|
+
);
|
|
2513
|
+
};
|
|
2514
|
+
}
|
|
2515
|
+
// Render an empty icon when no icon is provided from the dashboard
|
|
2516
|
+
return function () {
|
|
2517
|
+
return vue.createVNode("span", {
|
|
2518
|
+
"style": {
|
|
2519
|
+
display: 'inline-block',
|
|
2520
|
+
height: '30px',
|
|
2521
|
+
width: leaveSpaceForIcon ? '30px' : 0
|
|
2522
|
+
}
|
|
2523
|
+
}, null);
|
|
2524
|
+
};
|
|
2240
2525
|
default:
|
|
2241
2526
|
return null;
|
|
2242
2527
|
}
|
|
2243
2528
|
};
|
|
2244
|
-
|
|
2529
|
+
var indexOffset = 0;
|
|
2530
|
+
return vue.createVNode("div", null, [_this17.hasCustomRenderer && _this17.getComponent({
|
|
2245
2531
|
isOpen: isOpen,
|
|
2246
2532
|
getItemProps: getItemProps,
|
|
2247
2533
|
getItemEvents: getItemEvents,
|
|
2248
2534
|
highlightedIndex: highlightedIndex
|
|
2249
|
-
}),
|
|
2250
|
-
"class": Input.suggestions(
|
|
2535
|
+
}), _this17.renderErrorComponent(), !_this17.hasCustomRenderer && isOpen && hasSuggestions ? vue.createVNode("ul", {
|
|
2536
|
+
"class": Input.suggestions(_this17.themePreset, _this17.theme) + " " + getClassName$1(_this17.$props.innerClass, 'list') + " " + Input.searchboxSuggestions(_this17.themePreset, _this17.theme) + "\n\t\t\t\t\t\t\t\t\t\t\t\t\t",
|
|
2251
2537
|
"ref": _dropdownULRef
|
|
2252
|
-
}, [
|
|
2253
|
-
"themePreset":
|
|
2538
|
+
}, [_this17.showAIScreen && vue.createVNode(SearchBoxAISection, {
|
|
2539
|
+
"themePreset": _this17.$props.themePreset
|
|
2254
2540
|
}, {
|
|
2255
2541
|
"default": function _default() {
|
|
2256
|
-
return [
|
|
2542
|
+
return [_this17.renderAIScreen(), ' ', _this17.renderErrorComponent(true)];
|
|
2257
2543
|
}
|
|
2258
|
-
}), !
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
item
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2544
|
+
}), !_this17.showAIScreen && _this17.parsedSuggestions.map(function (item, itemIndex) {
|
|
2545
|
+
var index = indexOffset + itemIndex;
|
|
2546
|
+
if (Array.isArray(item)) {
|
|
2547
|
+
var sectionHtml = xss(item[0].sectionLabel);
|
|
2548
|
+
indexOffset += item.length - 1;
|
|
2549
|
+
return vue.createVNode("div", {
|
|
2550
|
+
"key": "section-" + itemIndex,
|
|
2551
|
+
"class": "section-container"
|
|
2552
|
+
}, [sectionHtml ? vue.createVNode("div", {
|
|
2553
|
+
"class": "section-header " + getClassName$1(_this17.$props.innerClass, 'section-label'),
|
|
2554
|
+
"key": "" + item[0].sectionId,
|
|
2555
|
+
"innerHTML": sectionHtml
|
|
2556
|
+
}, null) : null, vue.createVNode("ul", {
|
|
2557
|
+
"class": "section-list"
|
|
2558
|
+
}, [item.map(function (sectionItem, sectionIndex) {
|
|
2559
|
+
var suggestionsHaveIcon = item.some(function (s) {
|
|
2560
|
+
return s.icon || s.iconURL;
|
|
2561
|
+
});
|
|
2562
|
+
if (renderItem) {
|
|
2563
|
+
return vue.createVNode("li", vue.mergeProps(getItemProps({
|
|
2564
|
+
item: sectionItem
|
|
2565
|
+
}), _transformOn(getItemEvents({
|
|
2566
|
+
item: sectionItem
|
|
2567
|
+
})), {
|
|
2568
|
+
"key": sectionItem._id + "_" + index + "_" + sectionIndex,
|
|
2569
|
+
"style": {
|
|
2570
|
+
justifyContent: 'flex-start',
|
|
2571
|
+
alignItems: 'center'
|
|
2572
|
+
},
|
|
2573
|
+
"class": "" + (highlightedIndex === index + sectionIndex ? "active-li-item " + getClassName$1(_this17.$props.innerClass, 'active-suggestion-item') : "li-item " + getClassName$1(_this17.$props.innerClass, 'suggestion-item'))
|
|
2574
|
+
}), [renderItem(sectionItem)]);
|
|
2575
|
+
}
|
|
2576
|
+
if (sectionItem._suggestion_type === '_internal_a_i_trigger') {
|
|
2577
|
+
return vue.createVNode("li", vue.mergeProps(getItemProps({
|
|
2578
|
+
item: sectionItem
|
|
2579
|
+
}), _transformOn(getItemEvents({
|
|
2580
|
+
item: sectionItem
|
|
2581
|
+
})), {
|
|
2582
|
+
"key": sectionItem._id + "_" + index + "_" + sectionIndex,
|
|
2583
|
+
"style": {
|
|
2584
|
+
justifyContent: 'flex-start',
|
|
2585
|
+
alignItems: 'center'
|
|
2586
|
+
},
|
|
2587
|
+
"class": "" + (highlightedIndex === index + sectionIndex ? "active-li-item " + getClassName$1(_this17.$props.innerClass, 'active-suggestion-item') : "li-item " + getClassName$1(_this17.$props.innerClass, 'suggestion-item'))
|
|
2588
|
+
}), [vue.createVNode(SuggestionItem, {
|
|
2589
|
+
"currentValue": _this17.currentValue,
|
|
2590
|
+
"suggestion": sectionItem
|
|
2591
|
+
}, null)]);
|
|
2592
|
+
}
|
|
2593
|
+
return vue.createVNode("li", vue.mergeProps(getItemProps({
|
|
2594
|
+
item: sectionItem
|
|
2595
|
+
}), _transformOn(getItemEvents({
|
|
2596
|
+
item: sectionItem
|
|
2597
|
+
})), {
|
|
2598
|
+
"key": sectionItem._id + "_" + index + "_" + sectionIndex,
|
|
2599
|
+
"style": {
|
|
2600
|
+
justifyContent: 'flex-start',
|
|
2601
|
+
alignItems: 'center'
|
|
2602
|
+
},
|
|
2603
|
+
"class": "" + (highlightedIndex === index + sectionIndex ? "active-li-item " + getClassName$1(_this17.$props.innerClass, 'active-suggestion-item') : "li-item " + getClassName$1(_this17.$props.innerClass, 'suggestion-item'))
|
|
2604
|
+
}), [vue.createVNode("div", {
|
|
2605
|
+
"style": {
|
|
2606
|
+
padding: '0 10px 0 0',
|
|
2607
|
+
display: 'flex'
|
|
2608
|
+
}
|
|
2609
|
+
}, [vue.createVNode(CustomSvg, {
|
|
2610
|
+
"key": sectionItem._suggestion_type + "-" + sectionIndex,
|
|
2611
|
+
"className": getClassName$1(_this17.$props.innerClass, sectionItem._suggestion_type + "-search-icon") || null,
|
|
2612
|
+
"icon": getIcon(sectionItem._suggestion_type, sectionItem, suggestionsHaveIcon),
|
|
2613
|
+
"type": sectionItem._suggestion_type + "-search-icon"
|
|
2614
|
+
}, null)]), vue.createVNode(SuggestionItem, {
|
|
2615
|
+
"currentValue": _this17.currentValue,
|
|
2616
|
+
"suggestion": sectionItem
|
|
2617
|
+
}, null), _this17.renderActionIcon(sectionItem)]);
|
|
2618
|
+
})])]);
|
|
2619
|
+
}
|
|
2620
|
+
return vue.createVNode("div", null, [vue.createTextVNode("No suggestions")]);
|
|
2621
|
+
}), !_this17.showAIScreen && _this17.parsedSuggestions.length && _this17.$props.showSuggestionsFooter ? _this17.suggestionsFooter() : null]) : _this17.renderNoSuggestions(_this17.normalizedSuggestions)]);
|
|
2295
2622
|
};
|
|
2296
2623
|
return vue.createVNode("div", {
|
|
2297
2624
|
"class": Input.suggestionsContainer
|
|
2298
2625
|
}, [vue.createVNode(InputGroup, {
|
|
2299
|
-
"
|
|
2626
|
+
"searchBox": true,
|
|
2627
|
+
"ref": _inputGroupRef,
|
|
2628
|
+
"isOpen": _this17.$data.isOpen
|
|
2300
2629
|
}, {
|
|
2301
2630
|
"default": function _default() {
|
|
2302
|
-
return [
|
|
2631
|
+
return [vue.createVNode(Input.Actions, null, {
|
|
2632
|
+
"default": function _default() {
|
|
2633
|
+
return [_this17.renderInputAddonBefore(), _this17.renderLeftIcons()];
|
|
2634
|
+
}
|
|
2635
|
+
}), vue.createVNode(DropDown.InputWrapper, null, {
|
|
2303
2636
|
"default": function _default() {
|
|
2304
2637
|
return [vue.createVNode(Input.TextArea, vue.mergeProps(_transformOn(getInputEvents({
|
|
2305
|
-
onInput:
|
|
2638
|
+
onInput: _this17.onInputChange,
|
|
2306
2639
|
onBlur: function onBlur(e) {
|
|
2307
|
-
|
|
2640
|
+
_this17.$emit('blur', e, _this17.triggerQuery);
|
|
2308
2641
|
},
|
|
2309
|
-
onFocus:
|
|
2642
|
+
onFocus: _this17.handleFocus,
|
|
2310
2643
|
onKeyPress: function onKeyPress(e) {
|
|
2311
|
-
|
|
2312
|
-
|
|
2644
|
+
_this17.$emit('keyPress', e, _this17.triggerQuery);
|
|
2645
|
+
_this17.$emit('key-press', e, _this17.triggerQuery);
|
|
2313
2646
|
},
|
|
2314
2647
|
onKeyDown: function onKeyDown(e) {
|
|
2315
|
-
return
|
|
2648
|
+
return _this17.handleKeyDown(e, highlightedIndex);
|
|
2316
2649
|
},
|
|
2317
2650
|
onKeyUp: function onKeyUp(e) {
|
|
2318
|
-
|
|
2319
|
-
|
|
2651
|
+
_this17.$emit('keyUp', e, _this17.triggerQuery);
|
|
2652
|
+
_this17.$emit('key-up', e, _this17.triggerQuery);
|
|
2320
2653
|
},
|
|
2321
2654
|
onClick: function onClick() {
|
|
2322
2655
|
setHighlightedIndex(null);
|
|
2323
2656
|
}
|
|
2324
2657
|
})), {
|
|
2325
|
-
"
|
|
2326
|
-
"
|
|
2327
|
-
"
|
|
2328
|
-
"
|
|
2329
|
-
"
|
|
2330
|
-
"
|
|
2331
|
-
"
|
|
2332
|
-
"autoFocus": _this15.$props.autoFocus,
|
|
2333
|
-
"showFocusShortcutsIcon": _this15.$props.showFocusShortcutsIcon,
|
|
2334
|
-
"showVoiceSearch": _this15.$props.showVoiceSearch
|
|
2658
|
+
"searchBox": true,
|
|
2659
|
+
"isOpen": _this17.$data.isOpen,
|
|
2660
|
+
"id": _this17.$props.componentId + "-input",
|
|
2661
|
+
"ref": _this17.$props.innerRef,
|
|
2662
|
+
"class": getClassName$1(_this17.$props.innerClass, 'input'),
|
|
2663
|
+
"placeholder": _this17.$props.placeholder,
|
|
2664
|
+
"autoFocus": _this17.$props.autoFocus
|
|
2335
2665
|
}, getInputProps({
|
|
2336
|
-
value:
|
|
2666
|
+
value: _this17.$data.currentValue === null ? '' : _this17.$data.currentValue
|
|
2337
2667
|
}), {
|
|
2338
|
-
"themePreset":
|
|
2668
|
+
"themePreset": _this17.themePreset,
|
|
2339
2669
|
"autocomplete": "off"
|
|
2340
|
-
}), null),
|
|
2670
|
+
}), null), !expandSuggestionsContainer && renderSuggestionsDropdown()];
|
|
2671
|
+
}
|
|
2672
|
+
}), vue.createVNode(Input.Actions, null, {
|
|
2673
|
+
"default": function _default() {
|
|
2674
|
+
return [_this17.renderRightIcons(), _this17.renderInputAddonAfter(), _this17.renderAskButtonElement(), _this17.renderEnterButtonElement()];
|
|
2341
2675
|
}
|
|
2342
|
-
})
|
|
2676
|
+
})];
|
|
2343
2677
|
}
|
|
2344
|
-
}), expandSuggestionsContainer && renderSuggestionsDropdown(),
|
|
2678
|
+
}), expandSuggestionsContainer && renderSuggestionsDropdown(), _this17.renderTags()]);
|
|
2345
2679
|
}
|
|
2346
2680
|
}) : vue.createVNode("div", {
|
|
2347
2681
|
"class": Input.suggestionsContainer
|
|
2348
2682
|
}, [vue.createVNode(InputGroup, {
|
|
2683
|
+
"searchBox": true,
|
|
2349
2684
|
"ref": _inputGroupRef
|
|
2350
2685
|
}, {
|
|
2351
2686
|
"default": function _default() {
|
|
2352
|
-
return [
|
|
2687
|
+
return [vue.createVNode(Input.Actions, null, {
|
|
2688
|
+
"default": function _default() {
|
|
2689
|
+
return [_this17.renderInputAddonBefore(), _this17.renderLeftIcons()];
|
|
2690
|
+
}
|
|
2691
|
+
}), vue.createVNode(DropDown.InputWrapper, null, {
|
|
2353
2692
|
"default": function _default() {
|
|
2354
2693
|
return [vue.createVNode(Input.TextArea, vue.mergeProps(_transformOn({
|
|
2355
2694
|
blur: function blur(e) {
|
|
2356
|
-
|
|
2695
|
+
_this17.$emit('blur', e, _this17.triggerQuery);
|
|
2357
2696
|
},
|
|
2358
2697
|
keypress: function keypress(e) {
|
|
2359
|
-
|
|
2360
|
-
|
|
2698
|
+
_this17.$emit('keyPress', e, _this17.triggerQuery);
|
|
2699
|
+
_this17.$emit('key-press', e, _this17.triggerQuery);
|
|
2361
2700
|
},
|
|
2362
|
-
input:
|
|
2701
|
+
input: _this17.onInputChange,
|
|
2363
2702
|
focus: function focus(e) {
|
|
2364
|
-
|
|
2703
|
+
_this17.$emit('focus', e, _this17.triggerQuery);
|
|
2365
2704
|
},
|
|
2366
|
-
keydown:
|
|
2705
|
+
keydown: _this17.handleKeyDown,
|
|
2367
2706
|
keyup: function keyup(e) {
|
|
2368
|
-
|
|
2369
|
-
|
|
2707
|
+
_this17.$emit('keyUp', e, _this17.triggerQuery);
|
|
2708
|
+
_this17.$emit('key-up', e, _this17.triggerQuery);
|
|
2370
2709
|
}
|
|
2371
2710
|
}), {
|
|
2372
|
-
"
|
|
2373
|
-
"
|
|
2374
|
-
"
|
|
2375
|
-
"
|
|
2376
|
-
"
|
|
2377
|
-
"
|
|
2378
|
-
"
|
|
2379
|
-
"
|
|
2380
|
-
"
|
|
2381
|
-
|
|
2711
|
+
"searchBox": true,
|
|
2712
|
+
"class": getClassName$1(_this17.$props.innerClass, 'input') || '',
|
|
2713
|
+
"placeholder": _this17.$props.placeholder,
|
|
2714
|
+
"autofocus": _this17.$props.autoFocus,
|
|
2715
|
+
"value": _this17.$data.currentValue ? _this17.$data.currentValue : '',
|
|
2716
|
+
"iconPosition": _this17.$props.iconPosition,
|
|
2717
|
+
"showIcon": _this17.$props.showIcon,
|
|
2718
|
+
"showClear": _this17.$props.showClear,
|
|
2719
|
+
"ref": _this17.$props.innerRef,
|
|
2720
|
+
"themePreset": _this17.themePreset
|
|
2721
|
+
}), null)];
|
|
2382
2722
|
}
|
|
2383
|
-
}),
|
|
2723
|
+
}), vue.createVNode(Input.Actions, null, {
|
|
2724
|
+
"default": function _default() {
|
|
2725
|
+
return [_this17.renderRightIcons(), _this17.renderInputAddonAfter(), _this17.renderEnterButtonElement()];
|
|
2726
|
+
}
|
|
2727
|
+
})];
|
|
2384
2728
|
}
|
|
2385
2729
|
})])];
|
|
2386
2730
|
}
|
|
@@ -2466,6 +2810,7 @@ SBConnected.install = function (Vue) {
|
|
|
2466
2810
|
// Add componentType for SSR
|
|
2467
2811
|
SBConnected.componentType = constants.componentTypes.searchBox;
|
|
2468
2812
|
|
|
2813
|
+
var _excluded$1 = ["_source"];
|
|
2469
2814
|
function _isSlot$1(s) {
|
|
2470
2815
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
|
|
2471
2816
|
}
|
|
@@ -2473,7 +2818,9 @@ var md$1 = new remarkable.Remarkable();
|
|
|
2473
2818
|
md$1.set({
|
|
2474
2819
|
html: true,
|
|
2475
2820
|
breaks: true,
|
|
2476
|
-
xhtmlOut: true
|
|
2821
|
+
xhtmlOut: true,
|
|
2822
|
+
linkify: true,
|
|
2823
|
+
linkTarget: '_blank'
|
|
2477
2824
|
});
|
|
2478
2825
|
var _inputWrapperRef = 'inputWrapperRef';
|
|
2479
2826
|
var _inputRef = 'inputRef';
|
|
@@ -2486,7 +2833,10 @@ var AIAnswer = vue.defineComponent({
|
|
|
2486
2833
|
messages: [],
|
|
2487
2834
|
inputMessage: '',
|
|
2488
2835
|
AISessionId: '',
|
|
2489
|
-
error: null
|
|
2836
|
+
error: null,
|
|
2837
|
+
sourceDocIds: null,
|
|
2838
|
+
initialHits: null,
|
|
2839
|
+
isTriggered: false
|
|
2490
2840
|
};
|
|
2491
2841
|
this.internalComponent = props.componentId + "__internal";
|
|
2492
2842
|
return this.__state;
|
|
@@ -2496,7 +2846,16 @@ var AIAnswer = vue.defineComponent({
|
|
|
2496
2846
|
from: 'theme_reactivesearch'
|
|
2497
2847
|
}
|
|
2498
2848
|
},
|
|
2499
|
-
created: function created() {
|
|
2849
|
+
created: function created() {
|
|
2850
|
+
if (this.$props.triggerOn === constants.AI_TRIGGER_MODES.ALWAYS) {
|
|
2851
|
+
this.isTriggered = true;
|
|
2852
|
+
} else if (this.$props.triggerOn === constants.AI_TRIGGER_MODES.QUESTION && this.dependentComponentValue && this.dependentComponentValue.endsWith('?')) {
|
|
2853
|
+
this.isTriggered = true;
|
|
2854
|
+
if (this.AISessionId) {
|
|
2855
|
+
this.handleSendMessage(null, false, '', true);
|
|
2856
|
+
}
|
|
2857
|
+
}
|
|
2858
|
+
},
|
|
2500
2859
|
computed: {
|
|
2501
2860
|
hasCustomRenderer: function hasCustomRenderer() {
|
|
2502
2861
|
return index.hasCustomRenderer(this);
|
|
@@ -2509,6 +2868,9 @@ var AIAnswer = vue.defineComponent({
|
|
|
2509
2868
|
},
|
|
2510
2869
|
errorMessageForMissingSessionId: function errorMessageForMissingSessionId() {
|
|
2511
2870
|
return "AISessionId for " + this.$props.componentId + " is missing! AIAnswer component requires an AISessionId to function. Try reloading the App.";
|
|
2871
|
+
},
|
|
2872
|
+
hasTriggered: function hasTriggered() {
|
|
2873
|
+
return this.isTriggered;
|
|
2512
2874
|
}
|
|
2513
2875
|
},
|
|
2514
2876
|
props: {
|
|
@@ -2547,13 +2909,26 @@ var AIAnswer = vue.defineComponent({
|
|
|
2547
2909
|
sessionIdFromStore: VueTypes.string,
|
|
2548
2910
|
showComponent: vueTypes.types.boolRequired,
|
|
2549
2911
|
componentError: vueTypes.types.componentObject,
|
|
2550
|
-
style: vueTypes.types.style
|
|
2912
|
+
style: vueTypes.types.style,
|
|
2913
|
+
showSourceDocuments: VueTypes.bool.def(false),
|
|
2914
|
+
renderSourceDocument: vueTypes.types.func,
|
|
2915
|
+
onSourceClick: vueTypes.types.func,
|
|
2916
|
+
isAITyping: vueTypes.types.boolRequired,
|
|
2917
|
+
triggerOn: VueTypes.string.def(constants.AI_TRIGGER_MODES.ALWAYS),
|
|
2918
|
+
renderTriggerMessage: vueTypes.types.func
|
|
2551
2919
|
},
|
|
2552
2920
|
mounted: function mounted() {},
|
|
2553
2921
|
watch: {
|
|
2554
2922
|
AIResponse: function AIResponse(newVal) {
|
|
2555
2923
|
if (newVal) {
|
|
2556
|
-
this.
|
|
2924
|
+
if (this.$props.showSourceDocuments && newVal.response && newVal.response.answer && Array.isArray(newVal.response.answer.documentIds)) {
|
|
2925
|
+
this.sourceDocIds = newVal.response.answer.documentIds;
|
|
2926
|
+
var localCache = helper.getObjectFromLocalStorage(constants.AI_LOCAL_CACHE_KEY) && helper.getObjectFromLocalStorage(constants.AI_LOCAL_CACHE_KEY)[this.$props.componentId];
|
|
2927
|
+
if (localCache && localCache.meta && localCache.meta.hits) {
|
|
2928
|
+
this.initialHits = localCache.meta.hits;
|
|
2929
|
+
}
|
|
2930
|
+
}
|
|
2931
|
+
this.AISessionId = ((helper.getObjectFromLocalStorage(constants.AI_LOCAL_CACHE_KEY) || {})[this.$props.componentId] || {}).sessionId || (((helper.getObjectFromLocalStorage(constants.AI_LOCAL_CACHE_KEY) || {})[this.$props.componentId] || {}).response || {}).sessionId;
|
|
2557
2932
|
var messagesHistory = newVal.messages,
|
|
2558
2933
|
response = newVal.response;
|
|
2559
2934
|
var finalMessages = [];
|
|
@@ -2564,7 +2939,7 @@ var AIAnswer = vue.defineComponent({
|
|
|
2564
2939
|
}
|
|
2565
2940
|
|
|
2566
2941
|
// pushing message history so far
|
|
2567
|
-
if (messagesHistory &&
|
|
2942
|
+
if (messagesHistory && Array.isArray(messagesHistory)) {
|
|
2568
2943
|
finalMessages.push.apply(finalMessages, messagesHistory.filter(function (msg) {
|
|
2569
2944
|
return msg.role !== constants.AI_ROLES.SYSTEM;
|
|
2570
2945
|
}));
|
|
@@ -2589,6 +2964,9 @@ var AIAnswer = vue.defineComponent({
|
|
|
2589
2964
|
loading: this.$props.isAIResponseLoading || this.$props.isLoading,
|
|
2590
2965
|
error: this.$props.AIResponseError
|
|
2591
2966
|
});
|
|
2967
|
+
if (newVal && newVal.hits && newVal.hits.hits) {
|
|
2968
|
+
this.initialHits = newVal.hits.hits;
|
|
2969
|
+
}
|
|
2592
2970
|
},
|
|
2593
2971
|
isAIResponseLoading: function isAIResponseLoading(newVal) {
|
|
2594
2972
|
this.$emit('on-data', {
|
|
@@ -2613,7 +2991,7 @@ var AIAnswer = vue.defineComponent({
|
|
|
2613
2991
|
},
|
|
2614
2992
|
AIResponseError: function AIResponseError(newVal) {
|
|
2615
2993
|
this.error = newVal;
|
|
2616
|
-
this.AISessionId = ((helper.getObjectFromLocalStorage(constants.AI_LOCAL_CACHE_KEY) || {})[this.$props.componentId] || {}).sessionId ||
|
|
2994
|
+
this.AISessionId = ((helper.getObjectFromLocalStorage(constants.AI_LOCAL_CACHE_KEY) || {})[this.$props.componentId] || {}).sessionId || (((helper.getObjectFromLocalStorage(constants.AI_LOCAL_CACHE_KEY) || {})[this.$props.componentId] || {}).response || {}).sessionId;
|
|
2617
2995
|
if (this.error && !this.AISessionId) {
|
|
2618
2996
|
var errorMessage = this.errorMessageForMissingSessionId;
|
|
2619
2997
|
this.error = {
|
|
@@ -2634,7 +3012,7 @@ var AIAnswer = vue.defineComponent({
|
|
|
2634
3012
|
componentError: function componentError(newVal) {
|
|
2635
3013
|
var _this = this;
|
|
2636
3014
|
if (newVal && newVal._bodyBlob) {
|
|
2637
|
-
this.AISessionId = ((helper.getObjectFromLocalStorage(constants.AI_LOCAL_CACHE_KEY) || {})[this.$props.componentId] || {}).sessionId ||
|
|
3015
|
+
this.AISessionId = ((helper.getObjectFromLocalStorage(constants.AI_LOCAL_CACHE_KEY) || {})[this.$props.componentId] || {}).sessionId || (((helper.getObjectFromLocalStorage(constants.AI_LOCAL_CACHE_KEY) || {})[this.$props.componentId] || {}).response || {}).sessionId;
|
|
2638
3016
|
if (!this.AISessionId) {
|
|
2639
3017
|
this.generateNewSessionId();
|
|
2640
3018
|
}
|
|
@@ -2657,23 +3035,154 @@ var AIAnswer = vue.defineComponent({
|
|
|
2657
3035
|
console.error('Error reading component error text data:', error);
|
|
2658
3036
|
});
|
|
2659
3037
|
}
|
|
3038
|
+
},
|
|
3039
|
+
showComponent: function showComponent() {
|
|
3040
|
+
if (this.$props.triggerOn === constants.AI_TRIGGER_MODES.QUESTION && this.$props.dependentComponentValue.endsWith('?')) {
|
|
3041
|
+
this.isTriggered = true;
|
|
3042
|
+
}
|
|
3043
|
+
},
|
|
3044
|
+
dependentComponentValue: function dependentComponentValue(newVal) {
|
|
3045
|
+
if (this.$props.triggerOn === constants.AI_TRIGGER_MODES.QUESTION && newVal && newVal.endsWith('?')) {
|
|
3046
|
+
this.isTriggered = true;
|
|
3047
|
+
if (this.AISessionId) {
|
|
3048
|
+
this.handleSendMessage(null, false, '', true);
|
|
3049
|
+
}
|
|
3050
|
+
} else if (this.hasTriggered && this.$props.triggerOn !== constants.AI_TRIGGER_MODES.ALWAYS) {
|
|
3051
|
+
this.isTriggered = false;
|
|
3052
|
+
}
|
|
3053
|
+
},
|
|
3054
|
+
AISessionId: function AISessionId(newVal) {
|
|
3055
|
+
if (newVal) {
|
|
3056
|
+
if (this.$props.triggerOn === constants.AI_TRIGGER_MODES.QUESTION && this.dependentComponentValue && this.dependentComponentValue.endsWith('?') || this.$props.triggerOn === constants.AI_TRIGGER_MODES.ALWAYS) {
|
|
3057
|
+
this.handleSendMessage(null, false, '', true);
|
|
3058
|
+
}
|
|
3059
|
+
}
|
|
3060
|
+
},
|
|
3061
|
+
triggerOn: function triggerOn(newVal) {
|
|
3062
|
+
if (newVal === constants.AI_TRIGGER_MODES.ALWAYS) {
|
|
3063
|
+
this.isTriggered = true;
|
|
3064
|
+
}
|
|
2660
3065
|
}
|
|
2661
3066
|
},
|
|
2662
3067
|
methods: {
|
|
2663
|
-
|
|
3068
|
+
renderTriggerMessageFunc: function renderTriggerMessageFunc() {
|
|
3069
|
+
var triggerOn = this.$props.triggerOn;
|
|
3070
|
+
if (this.$props.renderTriggerMessage) {
|
|
3071
|
+
return this.$props.renderTriggerMessage;
|
|
3072
|
+
}
|
|
3073
|
+
if (this.$slots.renderTriggerMessage) {
|
|
3074
|
+
return this.$slots.renderTriggerMessage();
|
|
3075
|
+
}
|
|
3076
|
+
if (triggerOn === constants.AI_TRIGGER_MODES.QUESTION) {
|
|
3077
|
+
if (!this.dependentComponentValue.endsWith('?')) {
|
|
3078
|
+
return vue.createVNode("span", null, [vue.createVNode("span", {
|
|
3079
|
+
"role": "img",
|
|
3080
|
+
"aria-label": "bulb"
|
|
3081
|
+
}, [vue.createTextVNode("\uD83D\uDCA1")]), vue.createTextVNode("End your question with a question mark (?)")]);
|
|
3082
|
+
}
|
|
3083
|
+
} else if (triggerOn === constants.AI_TRIGGER_MODES.MANUAL) {
|
|
3084
|
+
return vue.createVNode("span", null, [vue.createTextVNode("Click here to ask AI"), ' ', vue.createVNode("span", {
|
|
3085
|
+
"role": "img",
|
|
3086
|
+
"aria-label": "bulb"
|
|
3087
|
+
}, [vue.createTextVNode("\uD83E\uDD16")])]);
|
|
3088
|
+
}
|
|
3089
|
+
return null;
|
|
3090
|
+
},
|
|
3091
|
+
handleTriggerClick: function handleTriggerClick() {
|
|
3092
|
+
if (this.$props.triggerOn === constants.AI_TRIGGER_MODES.MANUAL) {
|
|
3093
|
+
this.handleSendMessage(null, false, '', true);
|
|
3094
|
+
this.isTriggered = true;
|
|
3095
|
+
}
|
|
3096
|
+
},
|
|
3097
|
+
getAISourceObjects: function getAISourceObjects() {
|
|
2664
3098
|
var _this2 = this;
|
|
3099
|
+
var sourceObjects = [];
|
|
3100
|
+
if (!this.AIResponse) return sourceObjects;
|
|
3101
|
+
var docIds = this.sourceDocIds || [];
|
|
3102
|
+
if (this.initialHits) {
|
|
3103
|
+
docIds.forEach(function (id) {
|
|
3104
|
+
var foundSourceObj = _this2.initialHits.find(function (hit) {
|
|
3105
|
+
return hit._id === id;
|
|
3106
|
+
}) || {};
|
|
3107
|
+
if (foundSourceObj) {
|
|
3108
|
+
var _foundSourceObj$_sour = foundSourceObj._source,
|
|
3109
|
+
_source = _foundSourceObj$_sour === void 0 ? {} : _foundSourceObj$_sour,
|
|
3110
|
+
rest = _rollupPluginBabelHelpers._objectWithoutPropertiesLoose(foundSourceObj, _excluded$1);
|
|
3111
|
+
sourceObjects.push(_rollupPluginBabelHelpers._extends({}, rest, _source));
|
|
3112
|
+
}
|
|
3113
|
+
});
|
|
3114
|
+
} else {
|
|
3115
|
+
sourceObjects.push.apply(sourceObjects, docIds.map(function (id) {
|
|
3116
|
+
return {
|
|
3117
|
+
_id: id
|
|
3118
|
+
};
|
|
3119
|
+
}));
|
|
3120
|
+
}
|
|
3121
|
+
return sourceObjects;
|
|
3122
|
+
},
|
|
3123
|
+
renderAIScreenFooter: function renderAIScreenFooter() {
|
|
3124
|
+
var _slot2;
|
|
3125
|
+
var _this3 = this;
|
|
3126
|
+
var _ref = this.$props || {},
|
|
3127
|
+
_ref$showSourceDocume = _ref.showSourceDocuments,
|
|
3128
|
+
showSourceDocuments = _ref$showSourceDocume === void 0 ? true : _ref$showSourceDocume,
|
|
3129
|
+
_ref$onSourceClick = _ref.onSourceClick,
|
|
3130
|
+
onSourceClick = _ref$onSourceClick === void 0 ? function () {} : _ref$onSourceClick,
|
|
3131
|
+
renderSourceDocument = _ref.renderSourceDocument;
|
|
3132
|
+
var customRenderSourceDoc = renderSourceDocument || this.$slots.renderSourceDocument;
|
|
3133
|
+
if (this.isLoadingState || this.isAITyping) {
|
|
3134
|
+
return null;
|
|
3135
|
+
}
|
|
3136
|
+
var renderSourceDocumentLabel = function renderSourceDocumentLabel(sourceObj) {
|
|
3137
|
+
if (customRenderSourceDoc) {
|
|
3138
|
+
return customRenderSourceDoc(sourceObj);
|
|
3139
|
+
}
|
|
3140
|
+
return sourceObj._id;
|
|
3141
|
+
};
|
|
3142
|
+
return showSourceDocuments && Array.isArray(this.sourceDocIds) && this.sourceDocIds.length ? vue.createVNode(Footer, {
|
|
3143
|
+
"themePreset": this.$props.themePreset,
|
|
3144
|
+
"style": {
|
|
3145
|
+
marginTop: '1.5rem',
|
|
3146
|
+
background: 'inherit'
|
|
3147
|
+
}
|
|
3148
|
+
}, {
|
|
3149
|
+
"default": function _default() {
|
|
3150
|
+
return [vue.createTextVNode("Summary generated using the following sources:"), ' ', vue.createVNode(SourceTags, null, _isSlot$1(_slot2 = _this3.getAISourceObjects().map(function (el) {
|
|
3151
|
+
var _slot;
|
|
3152
|
+
return vue.createVNode(Button.Button, {
|
|
3153
|
+
"class": "--ai-source-tag " + (helper.getClassName(_this3.$props.innerClass, 'ai-source-tag') || ''),
|
|
3154
|
+
"info": true,
|
|
3155
|
+
"onClick": function onClick() {
|
|
3156
|
+
return onSourceClick && onSourceClick(el);
|
|
3157
|
+
},
|
|
3158
|
+
"key": el._id
|
|
3159
|
+
}, _isSlot$1(_slot = renderSourceDocumentLabel(el)) ? _slot : {
|
|
3160
|
+
"default": function _default() {
|
|
3161
|
+
return [_slot];
|
|
3162
|
+
}
|
|
3163
|
+
});
|
|
3164
|
+
})) ? _slot2 : {
|
|
3165
|
+
"default": function _default() {
|
|
3166
|
+
return [_slot2];
|
|
3167
|
+
}
|
|
3168
|
+
})];
|
|
3169
|
+
}
|
|
3170
|
+
}) : null;
|
|
3171
|
+
},
|
|
3172
|
+
generateNewSessionId: function generateNewSessionId() {
|
|
3173
|
+
var _this4 = this;
|
|
2665
3174
|
var newSessionPromise = this.createAISession();
|
|
2666
3175
|
newSessionPromise.then(function (res) {
|
|
2667
|
-
|
|
3176
|
+
_this4.AISessionId = res.AIsessionId;
|
|
2668
3177
|
})["catch"](function (e) {
|
|
2669
3178
|
console.error(e);
|
|
2670
3179
|
});
|
|
2671
3180
|
},
|
|
2672
3181
|
scrollToBottom: function scrollToBottom() {
|
|
2673
|
-
var
|
|
3182
|
+
var _this5 = this;
|
|
2674
3183
|
this.$nextTick(function () {
|
|
2675
|
-
var
|
|
2676
|
-
var messageContainer = (
|
|
3184
|
+
var _this5$$refs;
|
|
3185
|
+
var messageContainer = (_this5$$refs = _this5.$refs) == null ? void 0 : _this5$$refs[_this5.$props.innerRef];
|
|
2677
3186
|
if (messageContainer && messageContainer.$el) {
|
|
2678
3187
|
messageContainer.$el.scrollTo({
|
|
2679
3188
|
top: messageContainer.$el.scrollHeight,
|
|
@@ -2686,24 +3195,33 @@ var AIAnswer = vue.defineComponent({
|
|
|
2686
3195
|
this.inputMessage = e.target.value;
|
|
2687
3196
|
this.handleTextAreaHeightChange();
|
|
2688
3197
|
},
|
|
2689
|
-
handleSendMessage: function handleSendMessage(e, isRetry, text) {
|
|
3198
|
+
handleSendMessage: function handleSendMessage(e, isRetry, text, fetchMeta) {
|
|
2690
3199
|
if (isRetry === void 0) {
|
|
2691
3200
|
isRetry = false;
|
|
2692
3201
|
}
|
|
2693
3202
|
if (text === void 0) {
|
|
2694
3203
|
text = this.inputMessage;
|
|
2695
3204
|
}
|
|
3205
|
+
if (fetchMeta === void 0) {
|
|
3206
|
+
fetchMeta = false;
|
|
3207
|
+
}
|
|
2696
3208
|
if (typeof e === 'object' && e !== null) e.preventDefault();
|
|
2697
|
-
if (text.trim()) {
|
|
3209
|
+
if (text.trim() || !text && !e) {
|
|
2698
3210
|
if (this.isLoadingState) {
|
|
2699
3211
|
return;
|
|
2700
3212
|
}
|
|
2701
3213
|
if (this.AISessionId) {
|
|
2702
|
-
if (!isRetry)
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
3214
|
+
if (!isRetry) {
|
|
3215
|
+
var finalMessages = [].concat(this.messages);
|
|
3216
|
+
if (text) {
|
|
3217
|
+
finalMessages.push({
|
|
3218
|
+
content: text,
|
|
3219
|
+
role: constants.AI_ROLES.USER
|
|
3220
|
+
});
|
|
3221
|
+
}
|
|
3222
|
+
this.messages = [].concat(finalMessages);
|
|
3223
|
+
}
|
|
3224
|
+
this.getAIResponse(this.AISessionId, this.componentId, text, fetchMeta);
|
|
2707
3225
|
} else {
|
|
2708
3226
|
console.error(this.errorMessageForMissingSessionId);
|
|
2709
3227
|
this.error = {
|
|
@@ -2752,7 +3270,6 @@ var AIAnswer = vue.defineComponent({
|
|
|
2752
3270
|
return null;
|
|
2753
3271
|
},
|
|
2754
3272
|
handleKeyPress: function handleKeyPress(e) {
|
|
2755
|
-
window.console.log('e', e);
|
|
2756
3273
|
if (e.key === 'Enter') {
|
|
2757
3274
|
this.handleSendMessage(e);
|
|
2758
3275
|
this.inputMessage = '';
|
|
@@ -2784,15 +3301,15 @@ var AIAnswer = vue.defineComponent({
|
|
|
2784
3301
|
if (typeof window === 'undefined') return false;
|
|
2785
3302
|
return showVoiceSearch && (window.webkitSpeechRecognition || window.SpeechRecognition);
|
|
2786
3303
|
},
|
|
2787
|
-
handleVoiceResults: function handleVoiceResults(
|
|
2788
|
-
var results =
|
|
3304
|
+
handleVoiceResults: function handleVoiceResults(_ref2) {
|
|
3305
|
+
var results = _ref2.results;
|
|
2789
3306
|
if (results && results[0] && results[0].isFinal && results[0][0] && results[0][0].transcript && results[0][0].transcript.trim()) {
|
|
2790
3307
|
this.handleSendMessage(null, false, results[0][0].transcript.trim());
|
|
2791
3308
|
}
|
|
2792
3309
|
},
|
|
2793
3310
|
renderIcons: function renderIcons() {
|
|
2794
|
-
var
|
|
2795
|
-
var
|
|
3311
|
+
var _this6 = this;
|
|
3312
|
+
var _slot3, _slot4;
|
|
2796
3313
|
var _this$$props = this.$props,
|
|
2797
3314
|
getMicInstance = _this$$props.getMicInstance,
|
|
2798
3315
|
showVoiceInput = _this$$props.showVoiceInput,
|
|
@@ -2805,14 +3322,14 @@ var AIAnswer = vue.defineComponent({
|
|
|
2805
3322
|
"positionType": "absolute"
|
|
2806
3323
|
}, {
|
|
2807
3324
|
"default": function _default() {
|
|
2808
|
-
return [!
|
|
3325
|
+
return [!_this6.isLoadingState && _this6.AISessionId && _this6.shouldMicRender(showVoiceInput) && vue.createVNode(Mic, {
|
|
2809
3326
|
"getInstance": getMicInstance,
|
|
2810
3327
|
"render": renderMic,
|
|
2811
|
-
"handleResult":
|
|
3328
|
+
"handleResult": _this6.handleVoiceResults,
|
|
2812
3329
|
"class": helper.getClassName(innerClass, 'ai-search-mic') || null
|
|
2813
|
-
}, null), iconPosition === 'right' && vue.createVNode(DropDown.IconWrapper, null, _isSlot$1(
|
|
3330
|
+
}, null), iconPosition === 'right' && vue.createVNode(DropDown.IconWrapper, null, _isSlot$1(_slot3 = _this6.renderIcon()) ? _slot3 : {
|
|
2814
3331
|
"default": function _default() {
|
|
2815
|
-
return [
|
|
3332
|
+
return [_slot3];
|
|
2816
3333
|
}
|
|
2817
3334
|
})];
|
|
2818
3335
|
}
|
|
@@ -2822,9 +3339,9 @@ var AIAnswer = vue.defineComponent({
|
|
|
2822
3339
|
"positionType": "absolute"
|
|
2823
3340
|
}, {
|
|
2824
3341
|
"default": function _default() {
|
|
2825
|
-
return [iconPosition === 'left' && vue.createVNode(DropDown.IconWrapper, null, _isSlot$1(
|
|
3342
|
+
return [iconPosition === 'left' && vue.createVNode(DropDown.IconWrapper, null, _isSlot$1(_slot4 = _this6.renderIcon()) ? _slot4 : {
|
|
2826
3343
|
"default": function _default() {
|
|
2827
|
-
return [
|
|
3344
|
+
return [_slot4];
|
|
2828
3345
|
}
|
|
2829
3346
|
})];
|
|
2830
3347
|
}
|
|
@@ -2834,7 +3351,7 @@ var AIAnswer = vue.defineComponent({
|
|
|
2834
3351
|
this.handleSendMessage(e);
|
|
2835
3352
|
},
|
|
2836
3353
|
renderEnterButtonElement: function renderEnterButtonElement() {
|
|
2837
|
-
var
|
|
3354
|
+
var _this7 = this;
|
|
2838
3355
|
var _this$$props2 = this.$props,
|
|
2839
3356
|
enterButton = _this$$props2.enterButton,
|
|
2840
3357
|
innerClass = _this$$props2.innerClass;
|
|
@@ -2842,16 +3359,16 @@ var AIAnswer = vue.defineComponent({
|
|
|
2842
3359
|
if (enterButton) {
|
|
2843
3360
|
var getEnterButtonMarkup = function getEnterButtonMarkup() {
|
|
2844
3361
|
if (renderEnterButton) {
|
|
2845
|
-
return renderEnterButton(
|
|
3362
|
+
return renderEnterButton(_this7.enterButtonOnClick);
|
|
2846
3363
|
}
|
|
2847
3364
|
return vue.createVNode(SendButton, {
|
|
2848
3365
|
"primary": true,
|
|
2849
3366
|
"type": "submit",
|
|
2850
3367
|
"tabIndex": 0,
|
|
2851
|
-
"onClick":
|
|
2852
|
-
"onKeyPress":
|
|
3368
|
+
"onClick": _this7.handleSendMessage,
|
|
3369
|
+
"onKeyPress": _this7.handleKeyPress,
|
|
2853
3370
|
"class": "ask-btn " + helper.getClassName(innerClass, 'ai-enter-button'),
|
|
2854
|
-
"disabled":
|
|
3371
|
+
"disabled": _this7.isLoadingState || !_this7.AISessionId
|
|
2855
3372
|
}, {
|
|
2856
3373
|
"default": function _default() {
|
|
2857
3374
|
return [vue.createTextVNode("Send")];
|
|
@@ -2874,9 +3391,9 @@ var AIAnswer = vue.defineComponent({
|
|
|
2874
3391
|
return index.getComponent(data, this);
|
|
2875
3392
|
},
|
|
2876
3393
|
handleTextAreaHeightChange: function handleTextAreaHeightChange() {
|
|
2877
|
-
var _this$$refs, _this$$
|
|
2878
|
-
var textArea = (_this$$refs = this.$refs) == null
|
|
2879
|
-
var inputWrapper = (_this$$refs2 = this.$refs) == null
|
|
3394
|
+
var _this$$refs, _this$$refs2, _this$$refs3;
|
|
3395
|
+
var textArea = (_this$$refs = this.$refs) == null || (_this$$refs = _this$$refs[_inputRef]) == null ? void 0 : _this$$refs.$el;
|
|
3396
|
+
var inputWrapper = (_this$$refs2 = this.$refs) == null || (_this$$refs2 = _this$$refs2[_inputWrapperRef]) == null ? void 0 : _this$$refs2.$el;
|
|
2880
3397
|
var errorContainer = (_this$$refs3 = this.$refs) == null ? void 0 : _this$$refs3[_errorContainerRef];
|
|
2881
3398
|
if (textArea) {
|
|
2882
3399
|
textArea.style.height = '42px';
|
|
@@ -2894,6 +3411,20 @@ var AIAnswer = vue.defineComponent({
|
|
|
2894
3411
|
}
|
|
2895
3412
|
this.$forceUpdate();
|
|
2896
3413
|
}
|
|
3414
|
+
},
|
|
3415
|
+
getTitle: function getTitle() {
|
|
3416
|
+
var _this8 = this;
|
|
3417
|
+
var hasTitle = this.$props.title || this.$slots.title || null;
|
|
3418
|
+
if (hasTitle) {
|
|
3419
|
+
return vue.createVNode(Title.Title, {
|
|
3420
|
+
"class": helper.getClassName(this.$props.innerClass, 'ai-title') || null
|
|
3421
|
+
}, {
|
|
3422
|
+
"default": function _default() {
|
|
3423
|
+
return [_this8.$props.title || _this8.$slots.title()];
|
|
3424
|
+
}
|
|
3425
|
+
});
|
|
3426
|
+
}
|
|
3427
|
+
return null;
|
|
2897
3428
|
}
|
|
2898
3429
|
},
|
|
2899
3430
|
beforeUnmount: function beforeUnmount() {
|
|
@@ -2908,55 +3439,62 @@ var AIAnswer = vue.defineComponent({
|
|
|
2908
3439
|
}
|
|
2909
3440
|
},
|
|
2910
3441
|
render: function render() {
|
|
2911
|
-
var
|
|
2912
|
-
var
|
|
3442
|
+
var _slot5;
|
|
3443
|
+
var _this9 = this;
|
|
2913
3444
|
var props = this.$props;
|
|
2914
3445
|
if (!this.shouldShowComponent) {
|
|
2915
3446
|
return null;
|
|
2916
3447
|
}
|
|
3448
|
+
if (!this.isTriggered) {
|
|
3449
|
+
return vue.createVNode(Chatbox, {
|
|
3450
|
+
"style": props.style || {}
|
|
3451
|
+
}, {
|
|
3452
|
+
"default": function _default() {
|
|
3453
|
+
return [_this9.getTitle(), vue.createVNode("div", {
|
|
3454
|
+
"class": "--trigger-message-wrapper",
|
|
3455
|
+
"onClick": _this9.handleTriggerClick,
|
|
3456
|
+
"aria-hidden": "true"
|
|
3457
|
+
}, [_this9.renderTriggerMessageFunc()])];
|
|
3458
|
+
}
|
|
3459
|
+
});
|
|
3460
|
+
}
|
|
2917
3461
|
return vue.createVNode(Chatbox, {
|
|
2918
3462
|
"style": props.style || {}
|
|
2919
3463
|
}, {
|
|
2920
3464
|
"default": function _default() {
|
|
2921
|
-
return [
|
|
2922
|
-
"class": helper.getClassName(_this6.$props.innerClass, 'title') || ''
|
|
2923
|
-
}, {
|
|
2924
|
-
"default": function _default() {
|
|
2925
|
-
return [_this6.$props.title];
|
|
2926
|
-
}
|
|
2927
|
-
}), vue.createVNode(ChatContainer, {
|
|
3465
|
+
return [_this9.getTitle(), vue.createVNode(ChatContainer, {
|
|
2928
3466
|
"class": "--ai-chat-container",
|
|
2929
3467
|
"theme": props.theme,
|
|
2930
3468
|
"showInput": props.showInput
|
|
2931
3469
|
}, {
|
|
2932
3470
|
"default": function _default() {
|
|
2933
|
-
return [
|
|
2934
|
-
"themePreset":
|
|
3471
|
+
return [_this9.hasCustomRenderer && vue.createVNode(MessagesContainer, {
|
|
3472
|
+
"themePreset": _this9.themePreset,
|
|
2935
3473
|
"theme": props.theme,
|
|
2936
|
-
"ref":
|
|
3474
|
+
"ref": _this9.$props.innerRef,
|
|
2937
3475
|
"class": "--ai-message-container " + (helper.getClassName(props.innerClass, 'ai-message-container') || '')
|
|
2938
|
-
}, _isSlot$1(
|
|
3476
|
+
}, _isSlot$1(_slot5 = _this9.getComponent()) ? _slot5 : {
|
|
2939
3477
|
"default": function _default() {
|
|
2940
|
-
return [
|
|
3478
|
+
return [_slot5];
|
|
2941
3479
|
}
|
|
2942
|
-
}), !
|
|
2943
|
-
"themePreset":
|
|
3480
|
+
}), !_this9.hasCustomRenderer && vue.createVNode(MessagesContainer, {
|
|
3481
|
+
"themePreset": _this9.themePreset,
|
|
2944
3482
|
"theme": props.theme,
|
|
2945
|
-
"ref":
|
|
3483
|
+
"ref": _this9.$props.innerRef,
|
|
2946
3484
|
"class": "--ai-message-container " + (helper.getClassName(props.innerClass, 'ai-message-container') || '')
|
|
2947
3485
|
}, {
|
|
2948
3486
|
"default": function _default() {
|
|
2949
|
-
return [
|
|
3487
|
+
return [_this9.messages.map(function (message, index) {
|
|
2950
3488
|
return vue.createVNode(Message, {
|
|
2951
3489
|
"key": index,
|
|
2952
3490
|
"isSender": message.role === constants.AI_ROLES.USER,
|
|
2953
3491
|
"innerHTML": md$1.render(message.content),
|
|
2954
|
-
"themePreset":
|
|
3492
|
+
"themePreset": _this9.themePreset,
|
|
2955
3493
|
"theme": props.theme,
|
|
2956
3494
|
"class": "--ai-answer-message " + (helper.getClassName(props.innerClass, 'ai-message') || '')
|
|
2957
3495
|
}, null);
|
|
2958
|
-
}),
|
|
2959
|
-
"themePreset":
|
|
3496
|
+
}), _this9.isLoadingState && vue.createVNode(Message, {
|
|
3497
|
+
"themePreset": _this9.themePreset,
|
|
2960
3498
|
"theme": props.theme,
|
|
2961
3499
|
"isSender": false,
|
|
2962
3500
|
"class": "--ai-answer-message " + (helper.getClassName(props.innerClass, 'ai-message') || null)
|
|
@@ -2965,31 +3503,31 @@ var AIAnswer = vue.defineComponent({
|
|
|
2965
3503
|
return [vue.createVNode(TypingIndicator, null, {
|
|
2966
3504
|
"default": function _default() {
|
|
2967
3505
|
return [vue.createVNode(TypingDot, {
|
|
2968
|
-
"themePreset":
|
|
3506
|
+
"themePreset": _this9.themePreset
|
|
2969
3507
|
}, null), vue.createVNode(TypingDot, {
|
|
2970
|
-
"themePreset":
|
|
3508
|
+
"themePreset": _this9.themePreset
|
|
2971
3509
|
}, null), vue.createVNode(TypingDot, {
|
|
2972
|
-
"themePreset":
|
|
3510
|
+
"themePreset": _this9.themePreset
|
|
2973
3511
|
}, null)];
|
|
2974
3512
|
}
|
|
2975
3513
|
})];
|
|
2976
3514
|
}
|
|
2977
3515
|
})];
|
|
2978
3516
|
}
|
|
2979
|
-
}),
|
|
3517
|
+
}), _this9.renderErrorComponent(), ' ', props.showFeedback && !_this9.isLoadingState && !_this9.isAITyping && vue.createVNode("div", {
|
|
2980
3518
|
"class": "--ai-answer-feedback-container " + (helper.getClassName(props.innerClass, 'ai-feedback') || '')
|
|
2981
3519
|
}, [vue.createVNode(AIFeedback, {
|
|
2982
|
-
"hideUI":
|
|
2983
|
-
"key":
|
|
3520
|
+
"hideUI": _this9.isLoadingState || !_this9.sessionId,
|
|
3521
|
+
"key": _this9.sessionId,
|
|
2984
3522
|
"onFeedbackSubmit": function onFeedbackSubmit(useful, reason) {
|
|
2985
|
-
|
|
3523
|
+
_this9.trackUsefullness(_this9.sessionId, {
|
|
2986
3524
|
useful: useful,
|
|
2987
3525
|
reason: reason
|
|
2988
3526
|
});
|
|
2989
3527
|
}
|
|
2990
|
-
}, null)]), props.showInput && vue.createVNode(MessageInputContainer, {
|
|
3528
|
+
}, null)]), ' ', _this9.renderAIScreenFooter(), props.showInput && !_this9.isLoadingState && !_this9.isAITyping && vue.createVNode(MessageInputContainer, {
|
|
2991
3529
|
"class": "--ai-input-container",
|
|
2992
|
-
"onSubmit":
|
|
3530
|
+
"onSubmit": _this9.handleSendMessage
|
|
2993
3531
|
}, {
|
|
2994
3532
|
"default": function _default() {
|
|
2995
3533
|
return [vue.createVNode(InputGroup, {
|
|
@@ -3005,19 +3543,19 @@ var AIAnswer = vue.defineComponent({
|
|
|
3005
3543
|
"ref": _inputRef,
|
|
3006
3544
|
"placeholder": props.placeholder,
|
|
3007
3545
|
"enterButton": props.enterButton,
|
|
3008
|
-
"value":
|
|
3009
|
-
"onInput":
|
|
3546
|
+
"value": _this9.inputMessage,
|
|
3547
|
+
"onInput": _this9.handleMessageInputChange,
|
|
3010
3548
|
"id": props.componentId + "-ai-input",
|
|
3011
3549
|
"showIcon": props.showIcon,
|
|
3012
3550
|
"iconPosition": props.iconPosition,
|
|
3013
|
-
"themePreset":
|
|
3014
|
-
"disabled":
|
|
3551
|
+
"themePreset": _this9.themePreset,
|
|
3552
|
+
"disabled": _this9.isLoadingState || !_this9.AISessionId,
|
|
3015
3553
|
"class": helper.getClassName(props.innerClass, 'ai-input') || null
|
|
3016
|
-
}, null), ' ',
|
|
3554
|
+
}, null), ' ', _this9.renderIcons()];
|
|
3017
3555
|
}
|
|
3018
3556
|
})];
|
|
3019
3557
|
}
|
|
3020
|
-
}),
|
|
3558
|
+
}), _this9.renderEnterButtonElement()];
|
|
3021
3559
|
}
|
|
3022
3560
|
}), ' '];
|
|
3023
3561
|
}
|
|
@@ -3035,9 +3573,11 @@ var mapStateToProps$1 = function mapStateToProps(state, props) {
|
|
|
3035
3573
|
// eslint-disable-next-line prefer-destructuring
|
|
3036
3574
|
dependencyComponent = dependencyComponent[0];
|
|
3037
3575
|
}
|
|
3038
|
-
var showComponent = state.selectedValues[dependencyComponent] && state.selectedValues[dependencyComponent].value;
|
|
3576
|
+
var showComponent = !!(state.selectedValues[dependencyComponent] && state.selectedValues[dependencyComponent].value);
|
|
3577
|
+
var dependentComponentValue = state.selectedValues[dependencyComponent] && state.selectedValues[dependencyComponent].value || '';
|
|
3039
3578
|
return {
|
|
3040
3579
|
showComponent: showComponent,
|
|
3580
|
+
dependentComponentValue: dependentComponentValue,
|
|
3041
3581
|
AIResponse: state.AIResponses[props.componentId] && state.AIResponses[props.componentId].response,
|
|
3042
3582
|
isAIResponseLoading: state.AIResponses[props.componentId] && state.AIResponses[props.componentId].isLoading,
|
|
3043
3583
|
AIResponseError: state.AIResponses[props.componentId] && state.AIResponses[props.componentId].error,
|
|
@@ -3045,11 +3585,17 @@ var mapStateToProps$1 = function mapStateToProps(state, props) {
|
|
|
3045
3585
|
themePreset: state.config.themePreset,
|
|
3046
3586
|
isLoading: state.isLoading[props.componentId] || false,
|
|
3047
3587
|
sessionIdFromStore: state.AIResponses[props.componentId] && state.AIResponses[props.componentId].response && state.AIResponses[props.componentId].response.sessionId || '',
|
|
3048
|
-
componentError: state.error[props.componentId]
|
|
3588
|
+
componentError: state.error[props.componentId] || null,
|
|
3589
|
+
isAITyping: state.AIResponses[props.componentId] && state.AIResponses[props.componentId].response && state.AIResponses[props.componentId].response.isTyping || false
|
|
3049
3590
|
};
|
|
3050
3591
|
};
|
|
3051
3592
|
var mapDispatchToProps$1 = {
|
|
3052
|
-
getAIResponse:
|
|
3593
|
+
getAIResponse: function getAIResponse(sessionId, componentId, message, shouldFetchMeta) {
|
|
3594
|
+
if (shouldFetchMeta === void 0) {
|
|
3595
|
+
shouldFetchMeta = false;
|
|
3596
|
+
}
|
|
3597
|
+
return query.fetchAIResponse(sessionId, componentId, message, null, shouldFetchMeta);
|
|
3598
|
+
},
|
|
3053
3599
|
trackUsefullness: analytics.recordAISessionUsefulness,
|
|
3054
3600
|
createAISession: query.createAISession
|
|
3055
3601
|
};
|
|
@@ -3065,8 +3611,8 @@ AIConnected.install = function (Vue) {
|
|
|
3065
3611
|
// Add componentType for SSR
|
|
3066
3612
|
AIConnected.componentType = constants.componentTypes.AIAnswer;
|
|
3067
3613
|
|
|
3068
|
-
var _templateObject$
|
|
3069
|
-
var HierarchicalMenuList = vueEmotion.styled('ul')(_templateObject$
|
|
3614
|
+
var _templateObject$9, _templateObject2$4;
|
|
3615
|
+
var HierarchicalMenuList = vueEmotion.styled('ul')(_templateObject$9 || (_templateObject$9 = _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
3616
|
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) {
|
|
3071
3617
|
return !props.showLine && "\n\t\t\t\t\tdisplay: none;\n\t\t\t\t";
|
|
3072
3618
|
});
|