@infinilabs/discover 0.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/LICENSE +9 -0
- package/README.md +8 -0
- package/dist/abap-B988NUrV.js +122 -0
- package/dist/abap-obercqiY.cjs +1 -0
- package/dist/apex-B0_UGK1B.cjs +1 -0
- package/dist/apex-BlHPPQK-.js +168 -0
- package/dist/azcli-C7iyZFGk.js +53 -0
- package/dist/azcli-CEoytwx_.cjs +1 -0
- package/dist/bat-Buc0l0C3.js +123 -0
- package/dist/bat-D65OC-jj.cjs +1 -0
- package/dist/bicep-DvD_e5vW.cjs +2 -0
- package/dist/bicep-U66iJ-pV.js +219 -0
- package/dist/cameligo-C9Dwkdmm.js +189 -0
- package/dist/cameligo-DzMHfeEs.cjs +1 -0
- package/dist/chunk-BjqF3vbe.cjs +1 -0
- package/dist/chunk-CIp4IH9D.js +21 -0
- package/dist/classnames-BXjDNQ6Q.cjs +1 -0
- package/dist/classnames-eUba3oot.js +29 -0
- package/dist/clojure-BC7BzAFK.cjs +1 -0
- package/dist/clojure-DDWmWbSx.js +146 -0
- package/dist/coffee-7Sx2S8NH.js +260 -0
- package/dist/coffee-Ca9F0OWZ.cjs +1 -0
- package/dist/common-BeXEy5sz.cjs +18 -0
- package/dist/common-BlOHZJzI.js +64 -0
- package/dist/common-DuYIpe6b.cjs +1 -0
- package/dist/common-Tr1I-HCs.js +6725 -0
- package/dist/cpp-CHjqaSPQ.js +230 -0
- package/dist/cpp-DKy9h6xR.cjs +1 -0
- package/dist/createLucideIcon-239Z-2by.cjs +1 -0
- package/dist/createLucideIcon-BO6TDGE7.js +43 -0
- package/dist/csharp-CkbgT9vH.cjs +1 -0
- package/dist/csharp-jwStnVeK.js +260 -0
- package/dist/csp-C2qFd6iv.cjs +1 -0
- package/dist/csp-DkO8Np0h.js +46 -0
- package/dist/css-BFvwcljm.js +284 -0
- package/dist/css-DCKUCzD6.cjs +3 -0
- package/dist/cssMode-CU2AJQMM.js +1509 -0
- package/dist/cssMode-l7eR8WSG.cjs +4 -0
- package/dist/cypher-122TYSjJ.cjs +1 -0
- package/dist/cypher-DaQ7hFRL.js +212 -0
- package/dist/dart-D8p_2HKP.js +236 -0
- package/dist/dart-DshcPGU8.cjs +1 -0
- package/dist/dist-DCz_Qv0B.js +884 -0
- package/dist/dist-D_2dZQH5.cjs +11 -0
- package/dist/dockerfile-CL8dwZCe.cjs +1 -0
- package/dist/dockerfile-DKWOQrwp.js +191 -0
- package/dist/ecl-DP3PNWGB.js +226 -0
- package/dist/ecl-DVx2J_EE.cjs +1 -0
- package/dist/editor.api-CbUDOph7.js +70302 -0
- package/dist/editor.api-lY2thcaq.cjs +644 -0
- package/dist/elixir-Xgx_1krO.cjs +1 -0
- package/dist/elixir-e9tDp1p1.js +523 -0
- package/dist/filter_label-DRJC3vpe.js +58 -0
- package/dist/filter_label-DssaWGpx.cjs +1 -0
- package/dist/filter_operators-C-TaTcNc.js +70 -0
- package/dist/filter_operators-D0kyB-XI.cjs +1 -0
- package/dist/flow9-C9BjpX8h.js +176 -0
- package/dist/flow9-DR-EyjYV.cjs +1 -0
- package/dist/freemarker2-BTGUjvgA.cjs +3 -0
- package/dist/freemarker2-C6Iq5MB-.js +724 -0
- package/dist/fsharp-BWm_FISn.js +147 -0
- package/dist/fsharp-DaBEigN7.cjs +1 -0
- package/dist/go-Xyq33f0v.cjs +1 -0
- package/dist/go-cmqV0Vy_.js +165 -0
- package/dist/graphql-BkFHHVmI.js +174 -0
- package/dist/graphql-Cj7XAy25.cjs +1 -0
- package/dist/handlebars-B2b1q7PA.cjs +1 -0
- package/dist/handlebars-DGGN9u4Y.js +418 -0
- package/dist/hcl-5I-P7bYX.js +219 -0
- package/dist/hcl-C3dpBsgU.cjs +1 -0
- package/dist/html-RJa-j-qT.js +339 -0
- package/dist/html-qfcUzk8e.cjs +1 -0
- package/dist/htmlMode-CYIxo4hc.cjs +4 -0
- package/dist/htmlMode-DDZ48mdp.js +1520 -0
- package/dist/index.cjs +303 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +72895 -0
- package/dist/index_pattern_select--iGeA3sP.js +93 -0
- package/dist/index_pattern_select-BeN5049F.cjs +1 -0
- package/dist/ini-ChENqKh8.cjs +1 -0
- package/dist/ini-DSIAxBZt.js +94 -0
- package/dist/java-DGeAxsRb.js +173 -0
- package/dist/java-LZ6g7weJ.cjs +1 -0
- package/dist/javascript-CN5gTHH2.js +19 -0
- package/dist/javascript-CZ97a-BN.cjs +1 -0
- package/dist/jsonMode-BZDeJMLL.cjs +10 -0
- package/dist/jsonMode-DraOl-ka.js +1885 -0
- package/dist/julia-BeebccKw.cjs +1 -0
- package/dist/julia-CU4CtsP4.js +414 -0
- package/dist/kotlin-B8NxXJ89.js +183 -0
- package/dist/kotlin-M82nl514.cjs +1 -0
- package/dist/less-B4Q3fV9Y.cjs +2 -0
- package/dist/less-DbeQQzer.js +242 -0
- package/dist/lexon-CXQaaecE.cjs +1 -0
- package/dist/lexon-Cw9JuAKc.js +185 -0
- package/dist/lib-C9j_E-l0.js +47 -0
- package/dist/lib-Chy_6VKj.cjs +1 -0
- package/dist/liquid-BYNEOJvX.cjs +1 -0
- package/dist/liquid-DvB-d2w7.js +205 -0
- package/dist/lodash-C_2NO1eK.cjs +35 -0
- package/dist/lodash-D-qGlPRW.js +3769 -0
- package/dist/lua-CnG8Tpu2.cjs +1 -0
- package/dist/lua-yl5NzA_S.js +200 -0
- package/dist/m3-CVcm-OIn.cjs +1 -0
- package/dist/m3-CdNAqvIX.js +193 -0
- package/dist/markdown-C1h-EuiT.js +262 -0
- package/dist/markdown-DrRHDVSU.cjs +1 -0
- package/dist/mdx-BbiOYPr2.cjs +1 -0
- package/dist/mdx-Fk8VTCUK.js +335 -0
- package/dist/mips-DIWpzGF0.js +128 -0
- package/dist/mips-D_p8UYQb.cjs +1 -0
- package/dist/monaco.contribution-BpuUCejv.cjs +1 -0
- package/dist/monaco.contribution-Cq4QrMn0.js +134 -0
- package/dist/msdax-BiazpDQ1.js +156 -0
- package/dist/msdax-xM1_j20x.cjs +1 -0
- package/dist/mysql-DMsJkSnA.cjs +1 -0
- package/dist/mysql-DphBFJlP.js +168 -0
- package/dist/objective-c-BG02Lrht.cjs +1 -0
- package/dist/objective-c-DWZ8Qpyc.js +144 -0
- package/dist/pascal-BcvlMOdu.js +176 -0
- package/dist/pascal-CnP2Fqes.cjs +1 -0
- package/dist/pascaligo-BzDEm-l_.cjs +1 -0
- package/dist/pascaligo-DHEp4kzh.js +201 -0
- package/dist/perl-USYKPHpO.js +316 -0
- package/dist/perl-nIxw-e4R.cjs +1 -0
- package/dist/pgsql-Buk6XzVf.cjs +1 -0
- package/dist/pgsql-DzPhAh9W.js +158 -0
- package/dist/php-B3sFYUqV.cjs +1 -0
- package/dist/php-PfpSTefE.js +471 -0
- package/dist/pla-CZtnfWl6.cjs +1 -0
- package/dist/pla-DrFOZwDB.js +146 -0
- package/dist/postiats-4OGxVVUT.js +504 -0
- package/dist/postiats-CgJZf83Q.cjs +1 -0
- package/dist/powerquery-D9gzk2Dq.cjs +1 -0
- package/dist/powerquery-_h9-HEnY.js +190 -0
- package/dist/powershell-CZHaQY6z.cjs +1 -0
- package/dist/powershell-nOzcY8gy.js +211 -0
- package/dist/protobuf-DAgxhnea.js +659 -0
- package/dist/protobuf-D_C8Guej.cjs +2 -0
- package/dist/public-1PveQco4.js +1756 -0
- package/dist/public-D1K7oN7t.cjs +3 -0
- package/dist/pug-quEtG4rz.cjs +1 -0
- package/dist/pug-raGZNmZ1.js +300 -0
- package/dist/python-C45c7K7W.js +260 -0
- package/dist/python-CQX8JcT4.cjs +1 -0
- package/dist/qsharp-C2jz5tuo.js +143 -0
- package/dist/qsharp-CX1SSV_j.cjs +1 -0
- package/dist/query_bar_top_row-3UclS1nm.cjs +1 -0
- package/dist/query_bar_top_row-CfV4Iu71.cjs +1 -0
- package/dist/query_bar_top_row-D6a48VTk.js +11 -0
- package/dist/query_bar_top_row-DonV1OzY.js +2930 -0
- package/dist/query_string_input-75waAcWy.js +9 -0
- package/dist/query_string_input-CHG9w1ze.cjs +1 -0
- package/dist/query_string_input-CyPZVKif.js +366 -0
- package/dist/query_string_input-SOULY6dl.cjs +1 -0
- package/dist/r-CXkPcYYf.js +189 -0
- package/dist/r-DpVDQTST.cjs +1 -0
- package/dist/razor-BnoJmj1k.js +525 -0
- package/dist/razor-DYx4yJJn.cjs +1 -0
- package/dist/redis-DsCuCZIT.cjs +1 -0
- package/dist/redis-giKZvbbg.js +123 -0
- package/dist/redshift-qKVxBsP_.js +158 -0
- package/dist/redshift-z5_aUfdC.cjs +1 -0
- package/dist/restructuredtext-D0n4pabr.js +287 -0
- package/dist/restructuredtext-DdXoKocW.cjs +1 -0
- package/dist/ruby-BNrBlpcw.js +527 -0
- package/dist/ruby-Dj0sNBey.cjs +1 -0
- package/dist/rust-D6mpPoli.js +178 -0
- package/dist/rust-DjkW1U4M.cjs +1 -0
- package/dist/sb-BCN0JcpS.cjs +1 -0
- package/dist/sb-DhS9GhXl.js +143 -0
- package/dist/scala-BqxBEpi8.js +551 -0
- package/dist/scala-CyXWhZaJ.cjs +1 -0
- package/dist/scheme-Bh4oGAk3.js +170 -0
- package/dist/scheme-Cs9G6QEE.cjs +1 -0
- package/dist/scss-Byf08jwC.js +417 -0
- package/dist/scss-Fl7taPuq.cjs +3 -0
- package/dist/search_bar-Caqi1NVo.js +1815 -0
- package/dist/search_bar-DyO_WsC5.cjs +1 -0
- package/dist/services-9wPHk1eh.js +2350 -0
- package/dist/services-BPC3fXx4.cjs +7 -0
- package/dist/shard_failure_open_modal_button-BYTThYch.js +199 -0
- package/dist/shard_failure_open_modal_button-Dx8ML4VE.cjs +2 -0
- package/dist/shell-Cw5yNfC4.cjs +1 -0
- package/dist/shell-UoRv_tpG.js +223 -0
- package/dist/solidity-B5t7Lkol.js +147 -0
- package/dist/solidity-BoAzg9X_.cjs +1 -0
- package/dist/sophia-BrXXWhvp.js +147 -0
- package/dist/sophia-L84Jz6Ow.cjs +1 -0
- package/dist/sparql-B8ZTY48u.js +124 -0
- package/dist/sparql-D6lnG7vO.cjs +1 -0
- package/dist/sql-D_74hUL-.js +171 -0
- package/dist/sql-VXdYzIyz.cjs +1 -0
- package/dist/src/App.d.ts +2 -0
- package/dist/src/components/ResultHeader/Info.d.ts +30 -0
- package/dist/src/components/ResultHeader/index.d.ts +13 -0
- package/dist/src/components/context.d.ts +82 -0
- package/dist/src/components/euiicons.d.ts +1 -0
- package/dist/src/components/index.d.ts +8 -0
- package/dist/src/main.d.ts +1 -0
- package/dist/src/utils/request.d.ts +1 -0
- package/dist/src/utils/utils.d.ts +1 -0
- package/dist/st-CxJLwAAK.cjs +1 -0
- package/dist/st-D8Rdx9Bz.js +476 -0
- package/dist/suggestions_component-BBHwbjYT.js +1243 -0
- package/dist/suggestions_component-CF4sehth.cjs +77 -0
- package/dist/swift-ZBC6wQdc.cjs +1 -0
- package/dist/swift-s19Ivx3X.js +213 -0
- package/dist/systemverilog-DoSgAb1I.cjs +1 -0
- package/dist/systemverilog-fA72PnKj.js +298 -0
- package/dist/tcl-B8QLbcxi.js +223 -0
- package/dist/tcl-IXmy-lJ0.cjs +1 -0
- package/dist/tsMode-BrPRpJvb.js +597 -0
- package/dist/tsMode-CNvH6xuC.cjs +11 -0
- package/dist/tsup.config.d.ts +2 -0
- package/dist/twig-CT2RXmm0.cjs +1 -0
- package/dist/twig-Dy7NkzKI.js +388 -0
- package/dist/typescript-BRKHcp4S.js +263 -0
- package/dist/typescript-Bbw9fxuo.cjs +1 -0
- package/dist/typescript-CQjO9XnF.js +3 -0
- package/dist/typescript-D6q4AO2z.cjs +1 -0
- package/dist/typespec-CkKpvaMv.cjs +1 -0
- package/dist/typespec-ndyv0mQx.js +234 -0
- package/dist/vb-DET0NIW-.js +260 -0
- package/dist/vb-R3Kcrzvd.cjs +1 -0
- package/dist/vite.config.d.ts +2 -0
- package/dist/wgsl-D5TeQchR.js +145 -0
- package/dist/wgsl-FTDBzylH.cjs +298 -0
- package/dist/xml-BZjE3dtf.js +136 -0
- package/dist/xml-CxbMIueA.cjs +1 -0
- package/dist/yaml-Di_6aXC4.js +229 -0
- package/dist/yaml-DvaGkWBl.cjs +1 -0
- package/package.json +98 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import "./lodash-D-qGlPRW.js";
|
|
2
|
+
import "./services-9wPHk1eh.js";
|
|
3
|
+
import "./public-1PveQco4.js";
|
|
4
|
+
import "./classnames-eUba3oot.js";
|
|
5
|
+
import "./common-BlOHZJzI.js";
|
|
6
|
+
import "./lib-C9j_E-l0.js";
|
|
7
|
+
import "./common-Tr1I-HCs.js";
|
|
8
|
+
import { t as QueryStringInputUI } from "./query_string_input-CyPZVKif.js";
|
|
9
|
+
export { QueryStringInputUI as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`./chunk-BjqF3vbe.cjs`),t=require(`./lodash-C_2NO1eK.cjs`),n=require(`./services-BPC3fXx4.cjs`),r=require(`./public-D1K7oN7t.cjs`),i=require(`./classnames-BXjDNQ6Q.cjs`);let a=require(`react`);a=e.a(a);let o=require(`@elastic/eui`);var s=t.t();async function c(e,t,n){if(!t||(0,s.isEmpty)(t))return[];let i=t.map(e=>`"${e}"`).join(` | `),a=(await e.find({type:`index-pattern`,fields:[`title`,`fields`],search:i,searchFields:[`title`]})).savedObjects.filter(e=>t.includes(e.attributes.title)),o=n.get(`defaultIndex`);return(a.length===t.length?a:[...a,await e.get(`index-pattern`,o)]).map(r.t.getFromSavedObject)}var l=e.a(i.t(),1),u=t.t(),d=t.n(),f={LEFT:37,UP:38,RIGHT:39,DOWN:40,ENTER:13,ESC:27,TAB:9,HOME:36,END:35},p=class extends a.Component{state={isSuggestionsVisible:!1,index:null,suggestions:[],suggestionLimit:50,selectionStart:null,selectionEnd:null,indexPatterns:[],queryBarRect:void 0};inputRef=null;persistedLog;abortController;services=this.props.kibana.services;componentIsUnmounting=!1;queryBarInputDivRefInstance=(0,a.createRef)();getQueryString=()=>r.r(this.props.query.query);fetchIndexPatterns=async()=>{let e=this.props.indexPatterns.filter(e=>typeof e==`string`),t=this.props.indexPatterns.filter(e=>typeof e!=`string`),n=await c(this.props.services.savedObjects.client,e,this.services.uiSettings);this.setState({indexPatterns:[...t,...n]})};getSuggestions=async()=>{if(!this.inputRef)return;let e=this.props.query.language,t=this.getQueryString(),n=this.getRecentSearchSuggestions(t);if(!this.props.services.data.autocomplete.hasQuerySuggestions(e)||!Array.isArray(this.state.indexPatterns)||(0,u.compact)(this.state.indexPatterns).length===0)return n;let r=this.state.indexPatterns,{selectionStart:i,selectionEnd:a}=this.inputRef;if(!(i===null||a===null))try{return this.abortController&&this.abortController.abort(),this.abortController=new AbortController,[...await this.props.services.data.autocomplete.getQuerySuggestions({language:e,indexPatterns:r,query:t,selectionStart:i,selectionEnd:a,signal:this.abortController.signal})||[],...n]}catch(e){if(e.message===`The user aborted a request.`)return;throw e}};getRecentSearchSuggestions=e=>this.persistedLog?this.persistedLog.get().filter(t=>(typeof t==`object`?r.r(t):t).includes(e)).map(t=>{let n=r.r(t),i=e.length;return{type:r.S.RecentSearch,text:n,start:0,end:i}}):[];updateSuggestions=(0,u.debounce)(async()=>{let e=await this.getSuggestions()||[];this.componentIsUnmounting||this.setState({suggestions:e})},100);onSubmit=e=>{this.props.onSubmit&&(this.persistedLog&&this.persistedLog.add(e.query),this.props.onSubmit({query:r.a(e.query),language:e.language}))};onChange=e=>{this.updateSuggestions(),this.props.onChange&&this.props.onChange({query:r.a(e.query),language:e.language})};onQueryStringChange=e=>{this.setState({isSuggestionsVisible:!0,index:null,suggestionLimit:50}),this.onChange({query:e,language:this.props.query.language})};onInputChange=e=>{this.onQueryStringChange(e.target.value),e.target.value===``?this.handleRemoveHeight():this.handleAutoHeight()};onClickInput=e=>{e.target instanceof HTMLTextAreaElement&&this.onQueryStringChange(e.target.value)};onKeyUp=e=>{[f.LEFT,f.RIGHT,f.HOME,f.END].includes(e.keyCode)&&(this.setState({isSuggestionsVisible:!0}),e.target instanceof HTMLTextAreaElement&&this.onQueryStringChange(e.target.value))};onKeyDown=e=>{if(e.target instanceof HTMLTextAreaElement){let{isSuggestionsVisible:t,index:n}=this.state,i=e.preventDefault.bind(e),{target:a,key:o,metaKey:s}=e,{value:c,selectionStart:l,selectionEnd:u}=a,d=(e,t,n)=>{this.onQueryStringChange(e),this.setState({selectionStart:t,selectionEnd:n})};switch(e.keyCode){case f.DOWN:t&&n!==null?(e.preventDefault(),this.incrementIndex(n)):(t&&n==null||this.getQueryString()===``)&&(e.preventDefault(),this.setState({isSuggestionsVisible:!0,index:0}));break;case f.UP:t&&n!==null&&(e.preventDefault(),this.decrementIndex(n));break;case f.ENTER:this.props.bubbleSubmitEvent||e.preventDefault(),t&&n!==null&&this.state.suggestions[n]?(e.preventDefault(),this.selectSuggestion(this.state.suggestions[n])):(this.onSubmit(this.props.query),this.setState({isSuggestionsVisible:!1}));break;case f.ESC:e.preventDefault(),this.setState({isSuggestionsVisible:!1,index:null});break;case f.TAB:this.setState({isSuggestionsVisible:!1,index:null});break;default:l!==null&&u!==null&&r.i({value:c,selectionStart:l,selectionEnd:u,key:o,metaKey:s,updateQuery:d,preventDefault:i});break}}};selectSuggestion=e=>{if(!this.inputRef)return;let{type:t,text:n,start:i,end:a,cursorIndex:o}=e;this.handleNestedFieldSyntaxNotification(e);let s=this.getQueryString(),{selectionStart:c,selectionEnd:l}=this.inputRef;if(c===null||l===null)return;let u=s.substr(0,c)+s.substr(l),d=u.substr(0,i)+n+u.substr(a);this.onQueryStringChange(d),this.setState({selectionStart:i+(o||n.length),selectionEnd:i+(o||n.length)}),t===r.S.RecentSearch&&(this.setState({isSuggestionsVisible:!1,index:null}),this.onSubmit({query:d,language:this.props.query.language}))};handleNestedFieldSyntaxNotification=e=>{if(`field`in e&&e.field.subType&&e.field.subType.nested&&!this.services.storage.get(`kibana.KQLNestedQuerySyntaxInfoOptOut`)){let{notifications:e,docLinks:t}=this.services,r=t=>{this.services.storage&&(this.services.storage.set(`kibana.KQLNestedQuerySyntaxInfoOptOut`,!0),e.toasts.remove(t))};if(e&&t){let i=e.toasts.add({title:`KQL nested query syntax`,text:n.h((0,d.jsxs)(`div`,{children:[(0,d.jsxs)(`p`,{children:[`It looks like you're querying on a nested field. You can construct KQL syntax for nested queries in different ways, depending on the results you want. Learn more in our`,` `,(0,d.jsx)(o.EuiLink,{href:t.links.query.kueryQuerySyntax,target:`_blank`,children:`docs`}),`.`]}),(0,d.jsx)(o.EuiFlexGroup,{justifyContent:`flexEnd`,gutterSize:`s`,children:(0,d.jsx)(o.EuiFlexItem,{grow:!1,children:(0,d.jsx)(o.EuiButton,{size:`s`,onClick:()=>r(i),children:`Don't show again`})})})]}))})}}};increaseLimit=()=>{this.setState({suggestionLimit:this.state.suggestionLimit+50})};incrementIndex=e=>{let t=e+1;(e===null||t>=this.state.suggestions.length)&&(t=0),this.setState({index:t})};decrementIndex=e=>{let t=e-1;t<0?this.setState({index:this.state.suggestions.length-1}):this.setState({index:t})};onSelectLanguage=e=>{this.services.http.post(`/api/kibana/kql_opt_in_stats`,{body:JSON.stringify({opt_in:e===`kuery`})}),this.services.storage.set(`kibana.userQueryLanguage`,e);let t={query:``,language:e};this.onChange(t),this.onSubmit(t)};onOutsideClick=()=>{this.state.isSuggestionsVisible&&this.setState({isSuggestionsVisible:!1,index:null}),this.handleBlurHeight(),this.props.onChangeQueryInputFocus&&this.props.onChangeQueryInputFocus(!1)};onInputBlur=()=>{this.handleBlurHeight(),this.props.onChangeQueryInputFocus&&this.props.onChangeQueryInputFocus(!1),(0,u.isFunction)(this.props.onBlur)&&this.props.onBlur()};onClickSuggestion=e=>{this.inputRef&&(this.selectSuggestion(e),this.inputRef.focus())};initPersistedLog=()=>{let{uiSettings:e,storage:t,appName:n}=this.services;this.persistedLog=this.props.persistedLog?this.props.persistedLog:r.o(e,t,n,this.props.query.language)};onMouseEnterSuggestion=e=>{this.setState({index:e})};textareaId=(0,o.htmlIdGenerator)()();componentDidMount(){this.componentIsUnmounting=!1;let e=r.a(r.r(this.props.query.query));(0,u.isEqual)(this.props.query.query,e)||this.onChange({...this.props.query,query:e}),this.fetchIndexPatterns().then(this.updateSuggestions),this.handleListUpdate(),window.addEventListener(`resize`,this.handleAutoHeight),window.addEventListener(`scroll`,this.handleListUpdate,{passive:!0,capture:!0})}componentDidUpdate(e){let t=r.a(r.r(this.props.query.query));(0,u.isEqual)(this.props.query.query,t)||this.onChange({...this.props.query,query:t}),(0,u.isEqual)(e.indexPatterns,this.props.indexPatterns)?(0,u.isEqual)(e.query,this.props.query)||this.updateSuggestions():this.fetchIndexPatterns().then(this.updateSuggestions),this.state.selectionStart!==null&&this.state.selectionEnd!==null&&(this.inputRef!=null&&this.inputRef.setSelectionRange(this.state.selectionStart,this.state.selectionEnd),this.setState({selectionStart:null,selectionEnd:null}),document.activeElement!==null&&document.activeElement.id===this.textareaId?this.handleAutoHeight():this.handleRemoveHeight())}componentWillUnmount(){this.abortController&&this.abortController.abort(),this.updateSuggestions.cancel&&this.updateSuggestions.cancel(),this.componentIsUnmounting=!0,window.removeEventListener(`resize`,this.handleAutoHeight),window.removeEventListener(`scroll`,this.handleListUpdate,{capture:!0})}handleListUpdate=()=>{if(!this.componentIsUnmounting)return this.setState({queryBarRect:this.queryBarInputDivRefInstance.current?.getBoundingClientRect()})};handleAutoHeight=()=>{this.inputRef!==null&&document.activeElement===this.inputRef&&this.inputRef.style.setProperty(`height`,`${this.inputRef.scrollHeight}px`,`important`),this.handleListUpdate()};handleRemoveHeight=()=>{this.inputRef!==null&&this.inputRef.style.removeProperty(`height`)};handleBlurHeight=()=>{this.inputRef!==null&&(this.handleRemoveHeight(),this.inputRef.scrollTop=0)};handleOnFocus=()=>{this.props.onChangeQueryInputFocus&&this.props.onChangeQueryInputFocus(!0),requestAnimationFrame(()=>{this.handleAutoHeight()})};render(){let e={...this.state.isSuggestionsVisible&&{"aria-controls":`kbnTypeahead__items`,"aria-owns":`kbnTypeahead__items`},role:`combobox`};return(0,d.jsxs)(`div`,{className:(0,l.default)(this.props.className),children:[this.props.prepend,(0,d.jsx)(o.EuiOutsideClickDetector,{onOutsideClick:this.onOutsideClick,children:(0,d.jsxs)(`div`,{...e,style:{position:`relative`,width:`100%`},"aria-label":`Search and filter the discover page`,"aria-haspopup":`true`,"aria-expanded":this.state.isSuggestionsVisible,"data-skip-axe":`aria-required-children`,children:[(0,d.jsx)(`div`,{role:`search`,className:`euiFormControlLayout__childrenWrapper kbnQueryBar__textareaWrap z-4001`,ref:this.queryBarInputDivRefInstance,children:(0,d.jsx)(o.EuiTextArea,{placeholder:this.props.placeholder||`Search`,value:this.getQueryString(),onKeyDown:this.onKeyDown,onKeyUp:this.onKeyUp,onChange:this.onInputChange,onClick:this.onClickInput,onBlur:this.onInputBlur,onFocus:this.handleOnFocus,className:`kbnQueryBar__textarea !shadow-[0_0_transparent,_inset_0_0_0_1px_var(--ant-color-border)] !rounded-6px !bg-[var(--ant-color-bg-container)] !px-5px relative top-1px`,fullWidth:!0,rows:1,id:this.textareaId,autoFocus:this.props.onChangeQueryInputFocus?!1:!this.props.disableAutoFocus,inputRef:e=>{e&&(this.inputRef=e)},autoComplete:`off`,spellCheck:!1,"aria-label":`Start typing to search and filter the discover page`,"aria-autocomplete":`list`,"aria-controls":this.state.isSuggestionsVisible?`kbnTypeahead__items`:void 0,"aria-activedescendant":this.state.isSuggestionsVisible&&typeof this.state.index==`number`?`suggestion-${this.state.index}`:void 0,role:`textbox`,"data-test-subj":this.props.dataTestSubj||`queryInput`,isInvalid:this.props.isInvalid,children:this.getQueryString()})}),(0,d.jsx)(o.EuiPortal,{children:(0,d.jsx)(r.s,{show:this.state.isSuggestionsVisible,suggestions:this.state.suggestions.slice(0,this.state.suggestionLimit),index:this.state.index,onClick:this.onClickSuggestion,onMouseEnter:this.onMouseEnterSuggestion,loadMore:this.increaseLimit,queryBarRect:this.state.queryBarRect,size:this.props.size})})]})})]})}};Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return p}});
|
|
@@ -0,0 +1,366 @@
|
|
|
1
|
+
import { o as __toESM } from "./chunk-CIp4IH9D.js";
|
|
2
|
+
import { n as require_jsx_runtime, t as require_lodash } from "./lodash-D-qGlPRW.js";
|
|
3
|
+
import { h as toMountPoint } from "./services-9wPHk1eh.js";
|
|
4
|
+
import { S as QuerySuggestionTypes, a as fromUser, i as matchPairs, o as getQueryLog, r as toUser, s as SuggestionsComponent, t as indexPatterns } from "./public-1PveQco4.js";
|
|
5
|
+
import { t as require_classnames } from "./classnames-eUba3oot.js";
|
|
6
|
+
import React, { Component, createRef } from "react";
|
|
7
|
+
import { EuiButton, EuiFlexGroup, EuiFlexItem, EuiLink, EuiOutsideClickDetector, EuiPortal, EuiTextArea, htmlIdGenerator } from "@elastic/eui";
|
|
8
|
+
var import_lodash$1 = require_lodash();
|
|
9
|
+
async function fetchIndexPatterns(e, y, b) {
|
|
10
|
+
if (!y || (0, import_lodash$1.isEmpty)(y)) return [];
|
|
11
|
+
let x = y.map((e) => `"${e}"`).join(" | "), S = (await e.find({
|
|
12
|
+
type: "index-pattern",
|
|
13
|
+
fields: ["title", "fields"],
|
|
14
|
+
search: x,
|
|
15
|
+
searchFields: ["title"]
|
|
16
|
+
})).savedObjects.filter((e) => y.includes(e.attributes.title)), C = b.get("defaultIndex");
|
|
17
|
+
return (S.length === y.length ? S : [...S, await e.get("index-pattern", C)]).map(indexPatterns.getFromSavedObject);
|
|
18
|
+
}
|
|
19
|
+
var import_classnames = /* @__PURE__ */ __toESM(require_classnames(), 1), import_lodash = require_lodash(), import_jsx_runtime = require_jsx_runtime(), KEY_CODES = {
|
|
20
|
+
LEFT: 37,
|
|
21
|
+
UP: 38,
|
|
22
|
+
RIGHT: 39,
|
|
23
|
+
DOWN: 40,
|
|
24
|
+
ENTER: 13,
|
|
25
|
+
ESC: 27,
|
|
26
|
+
TAB: 9,
|
|
27
|
+
HOME: 36,
|
|
28
|
+
END: 35
|
|
29
|
+
}, QueryStringInputUI = class extends Component {
|
|
30
|
+
state = {
|
|
31
|
+
isSuggestionsVisible: !1,
|
|
32
|
+
index: null,
|
|
33
|
+
suggestions: [],
|
|
34
|
+
suggestionLimit: 50,
|
|
35
|
+
selectionStart: null,
|
|
36
|
+
selectionEnd: null,
|
|
37
|
+
indexPatterns: [],
|
|
38
|
+
queryBarRect: void 0
|
|
39
|
+
};
|
|
40
|
+
inputRef = null;
|
|
41
|
+
persistedLog;
|
|
42
|
+
abortController;
|
|
43
|
+
services = this.props.kibana.services;
|
|
44
|
+
componentIsUnmounting = !1;
|
|
45
|
+
queryBarInputDivRefInstance = createRef();
|
|
46
|
+
getQueryString = () => toUser(this.props.query.query);
|
|
47
|
+
fetchIndexPatterns = async () => {
|
|
48
|
+
let e = this.props.indexPatterns.filter((e) => typeof e == "string"), y = this.props.indexPatterns.filter((e) => typeof e != "string"), b = await fetchIndexPatterns(this.props.services.savedObjects.client, e, this.services.uiSettings);
|
|
49
|
+
this.setState({ indexPatterns: [...y, ...b] });
|
|
50
|
+
};
|
|
51
|
+
getSuggestions = async () => {
|
|
52
|
+
if (!this.inputRef) return;
|
|
53
|
+
let e = this.props.query.language, y = this.getQueryString(), b = this.getRecentSearchSuggestions(y);
|
|
54
|
+
if (!this.props.services.data.autocomplete.hasQuerySuggestions(e) || !Array.isArray(this.state.indexPatterns) || (0, import_lodash.compact)(this.state.indexPatterns).length === 0) return b;
|
|
55
|
+
let x = this.state.indexPatterns, { selectionStart: S, selectionEnd: C } = this.inputRef;
|
|
56
|
+
if (!(S === null || C === null)) try {
|
|
57
|
+
return this.abortController && this.abortController.abort(), this.abortController = new AbortController(), [...await this.props.services.data.autocomplete.getQuerySuggestions({
|
|
58
|
+
language: e,
|
|
59
|
+
indexPatterns: x,
|
|
60
|
+
query: y,
|
|
61
|
+
selectionStart: S,
|
|
62
|
+
selectionEnd: C,
|
|
63
|
+
signal: this.abortController.signal
|
|
64
|
+
}) || [], ...b];
|
|
65
|
+
} catch (e) {
|
|
66
|
+
if (e.message === "The user aborted a request.") return;
|
|
67
|
+
throw e;
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
getRecentSearchSuggestions = (e) => this.persistedLog ? this.persistedLog.get().filter((y) => (typeof y == "object" ? toUser(y) : y).includes(e)).map((y) => {
|
|
71
|
+
let b = toUser(y), x = e.length;
|
|
72
|
+
return {
|
|
73
|
+
type: QuerySuggestionTypes.RecentSearch,
|
|
74
|
+
text: b,
|
|
75
|
+
start: 0,
|
|
76
|
+
end: x
|
|
77
|
+
};
|
|
78
|
+
}) : [];
|
|
79
|
+
updateSuggestions = (0, import_lodash.debounce)(async () => {
|
|
80
|
+
let e = await this.getSuggestions() || [];
|
|
81
|
+
this.componentIsUnmounting || this.setState({ suggestions: e });
|
|
82
|
+
}, 100);
|
|
83
|
+
onSubmit = (e) => {
|
|
84
|
+
this.props.onSubmit && (this.persistedLog && this.persistedLog.add(e.query), this.props.onSubmit({
|
|
85
|
+
query: fromUser(e.query),
|
|
86
|
+
language: e.language
|
|
87
|
+
}));
|
|
88
|
+
};
|
|
89
|
+
onChange = (e) => {
|
|
90
|
+
this.updateSuggestions(), this.props.onChange && this.props.onChange({
|
|
91
|
+
query: fromUser(e.query),
|
|
92
|
+
language: e.language
|
|
93
|
+
});
|
|
94
|
+
};
|
|
95
|
+
onQueryStringChange = (e) => {
|
|
96
|
+
this.setState({
|
|
97
|
+
isSuggestionsVisible: !0,
|
|
98
|
+
index: null,
|
|
99
|
+
suggestionLimit: 50
|
|
100
|
+
}), this.onChange({
|
|
101
|
+
query: e,
|
|
102
|
+
language: this.props.query.language
|
|
103
|
+
});
|
|
104
|
+
};
|
|
105
|
+
onInputChange = (e) => {
|
|
106
|
+
this.onQueryStringChange(e.target.value), e.target.value === "" ? this.handleRemoveHeight() : this.handleAutoHeight();
|
|
107
|
+
};
|
|
108
|
+
onClickInput = (e) => {
|
|
109
|
+
e.target instanceof HTMLTextAreaElement && this.onQueryStringChange(e.target.value);
|
|
110
|
+
};
|
|
111
|
+
onKeyUp = (e) => {
|
|
112
|
+
[
|
|
113
|
+
KEY_CODES.LEFT,
|
|
114
|
+
KEY_CODES.RIGHT,
|
|
115
|
+
KEY_CODES.HOME,
|
|
116
|
+
KEY_CODES.END
|
|
117
|
+
].includes(e.keyCode) && (this.setState({ isSuggestionsVisible: !0 }), e.target instanceof HTMLTextAreaElement && this.onQueryStringChange(e.target.value));
|
|
118
|
+
};
|
|
119
|
+
onKeyDown = (e) => {
|
|
120
|
+
if (e.target instanceof HTMLTextAreaElement) {
|
|
121
|
+
let { isSuggestionsVisible: y, index: b } = this.state, x = e.preventDefault.bind(e), { target: S, key: C, metaKey: T } = e, { value: E, selectionStart: D, selectionEnd: O } = S, k = (e, y, b) => {
|
|
122
|
+
this.onQueryStringChange(e), this.setState({
|
|
123
|
+
selectionStart: y,
|
|
124
|
+
selectionEnd: b
|
|
125
|
+
});
|
|
126
|
+
};
|
|
127
|
+
switch (e.keyCode) {
|
|
128
|
+
case KEY_CODES.DOWN:
|
|
129
|
+
y && b !== null ? (e.preventDefault(), this.incrementIndex(b)) : (y && b == null || this.getQueryString() === "") && (e.preventDefault(), this.setState({
|
|
130
|
+
isSuggestionsVisible: !0,
|
|
131
|
+
index: 0
|
|
132
|
+
}));
|
|
133
|
+
break;
|
|
134
|
+
case KEY_CODES.UP:
|
|
135
|
+
y && b !== null && (e.preventDefault(), this.decrementIndex(b));
|
|
136
|
+
break;
|
|
137
|
+
case KEY_CODES.ENTER:
|
|
138
|
+
this.props.bubbleSubmitEvent || e.preventDefault(), y && b !== null && this.state.suggestions[b] ? (e.preventDefault(), this.selectSuggestion(this.state.suggestions[b])) : (this.onSubmit(this.props.query), this.setState({ isSuggestionsVisible: !1 }));
|
|
139
|
+
break;
|
|
140
|
+
case KEY_CODES.ESC:
|
|
141
|
+
e.preventDefault(), this.setState({
|
|
142
|
+
isSuggestionsVisible: !1,
|
|
143
|
+
index: null
|
|
144
|
+
});
|
|
145
|
+
break;
|
|
146
|
+
case KEY_CODES.TAB:
|
|
147
|
+
this.setState({
|
|
148
|
+
isSuggestionsVisible: !1,
|
|
149
|
+
index: null
|
|
150
|
+
});
|
|
151
|
+
break;
|
|
152
|
+
default:
|
|
153
|
+
D !== null && O !== null && matchPairs({
|
|
154
|
+
value: E,
|
|
155
|
+
selectionStart: D,
|
|
156
|
+
selectionEnd: O,
|
|
157
|
+
key: C,
|
|
158
|
+
metaKey: T,
|
|
159
|
+
updateQuery: k,
|
|
160
|
+
preventDefault: x
|
|
161
|
+
});
|
|
162
|
+
break;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
selectSuggestion = (e) => {
|
|
167
|
+
if (!this.inputRef) return;
|
|
168
|
+
let { type: y, text: b, start: x, end: C, cursorIndex: w } = e;
|
|
169
|
+
this.handleNestedFieldSyntaxNotification(e);
|
|
170
|
+
let T = this.getQueryString(), { selectionStart: E, selectionEnd: D } = this.inputRef;
|
|
171
|
+
if (E === null || D === null) return;
|
|
172
|
+
let O = T.substr(0, E) + T.substr(D), k = O.substr(0, x) + b + O.substr(C);
|
|
173
|
+
this.onQueryStringChange(k), this.setState({
|
|
174
|
+
selectionStart: x + (w || b.length),
|
|
175
|
+
selectionEnd: x + (w || b.length)
|
|
176
|
+
}), y === QuerySuggestionTypes.RecentSearch && (this.setState({
|
|
177
|
+
isSuggestionsVisible: !1,
|
|
178
|
+
index: null
|
|
179
|
+
}), this.onSubmit({
|
|
180
|
+
query: k,
|
|
181
|
+
language: this.props.query.language
|
|
182
|
+
}));
|
|
183
|
+
};
|
|
184
|
+
handleNestedFieldSyntaxNotification = (e) => {
|
|
185
|
+
if ("field" in e && e.field.subType && e.field.subType.nested && !this.services.storage.get("kibana.KQLNestedQuerySyntaxInfoOptOut")) {
|
|
186
|
+
let { notifications: e, docLinks: y } = this.services, b = (y) => {
|
|
187
|
+
this.services.storage && (this.services.storage.set("kibana.KQLNestedQuerySyntaxInfoOptOut", !0), e.toasts.remove(y));
|
|
188
|
+
};
|
|
189
|
+
if (e && y) {
|
|
190
|
+
let S = e.toasts.add({
|
|
191
|
+
title: "KQL nested query syntax",
|
|
192
|
+
text: toMountPoint(/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { children: [
|
|
193
|
+
"It looks like you're querying on a nested field. You can construct KQL syntax for nested queries in different ways, depending on the results you want. Learn more in our",
|
|
194
|
+
" ",
|
|
195
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(EuiLink, {
|
|
196
|
+
href: y.links.query.kueryQuerySyntax,
|
|
197
|
+
target: "_blank",
|
|
198
|
+
children: "docs"
|
|
199
|
+
}),
|
|
200
|
+
"."
|
|
201
|
+
] }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(EuiFlexGroup, {
|
|
202
|
+
justifyContent: "flexEnd",
|
|
203
|
+
gutterSize: "s",
|
|
204
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(EuiFlexItem, {
|
|
205
|
+
grow: !1,
|
|
206
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(EuiButton, {
|
|
207
|
+
size: "s",
|
|
208
|
+
onClick: () => b(S),
|
|
209
|
+
children: "Don't show again"
|
|
210
|
+
})
|
|
211
|
+
})
|
|
212
|
+
})] }))
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
};
|
|
217
|
+
increaseLimit = () => {
|
|
218
|
+
this.setState({ suggestionLimit: this.state.suggestionLimit + 50 });
|
|
219
|
+
};
|
|
220
|
+
incrementIndex = (e) => {
|
|
221
|
+
let y = e + 1;
|
|
222
|
+
(e === null || y >= this.state.suggestions.length) && (y = 0), this.setState({ index: y });
|
|
223
|
+
};
|
|
224
|
+
decrementIndex = (e) => {
|
|
225
|
+
let y = e - 1;
|
|
226
|
+
y < 0 ? this.setState({ index: this.state.suggestions.length - 1 }) : this.setState({ index: y });
|
|
227
|
+
};
|
|
228
|
+
onSelectLanguage = (e) => {
|
|
229
|
+
this.services.http.post("/api/kibana/kql_opt_in_stats", { body: JSON.stringify({ opt_in: e === "kuery" }) }), this.services.storage.set("kibana.userQueryLanguage", e);
|
|
230
|
+
let y = {
|
|
231
|
+
query: "",
|
|
232
|
+
language: e
|
|
233
|
+
};
|
|
234
|
+
this.onChange(y), this.onSubmit(y);
|
|
235
|
+
};
|
|
236
|
+
onOutsideClick = () => {
|
|
237
|
+
this.state.isSuggestionsVisible && this.setState({
|
|
238
|
+
isSuggestionsVisible: !1,
|
|
239
|
+
index: null
|
|
240
|
+
}), this.handleBlurHeight(), this.props.onChangeQueryInputFocus && this.props.onChangeQueryInputFocus(!1);
|
|
241
|
+
};
|
|
242
|
+
onInputBlur = () => {
|
|
243
|
+
this.handleBlurHeight(), this.props.onChangeQueryInputFocus && this.props.onChangeQueryInputFocus(!1), (0, import_lodash.isFunction)(this.props.onBlur) && this.props.onBlur();
|
|
244
|
+
};
|
|
245
|
+
onClickSuggestion = (e) => {
|
|
246
|
+
this.inputRef && (this.selectSuggestion(e), this.inputRef.focus());
|
|
247
|
+
};
|
|
248
|
+
initPersistedLog = () => {
|
|
249
|
+
let { uiSettings: e, storage: y, appName: b } = this.services;
|
|
250
|
+
this.persistedLog = this.props.persistedLog ? this.props.persistedLog : getQueryLog(e, y, b, this.props.query.language);
|
|
251
|
+
};
|
|
252
|
+
onMouseEnterSuggestion = (e) => {
|
|
253
|
+
this.setState({ index: e });
|
|
254
|
+
};
|
|
255
|
+
textareaId = htmlIdGenerator()();
|
|
256
|
+
componentDidMount() {
|
|
257
|
+
this.componentIsUnmounting = !1;
|
|
258
|
+
let e = fromUser(toUser(this.props.query.query));
|
|
259
|
+
(0, import_lodash.isEqual)(this.props.query.query, e) || this.onChange({
|
|
260
|
+
...this.props.query,
|
|
261
|
+
query: e
|
|
262
|
+
}), this.fetchIndexPatterns().then(this.updateSuggestions), this.handleListUpdate(), window.addEventListener("resize", this.handleAutoHeight), window.addEventListener("scroll", this.handleListUpdate, {
|
|
263
|
+
passive: !0,
|
|
264
|
+
capture: !0
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
componentDidUpdate(e) {
|
|
268
|
+
let y = fromUser(toUser(this.props.query.query));
|
|
269
|
+
(0, import_lodash.isEqual)(this.props.query.query, y) || this.onChange({
|
|
270
|
+
...this.props.query,
|
|
271
|
+
query: y
|
|
272
|
+
}), (0, import_lodash.isEqual)(e.indexPatterns, this.props.indexPatterns) ? (0, import_lodash.isEqual)(e.query, this.props.query) || this.updateSuggestions() : this.fetchIndexPatterns().then(this.updateSuggestions), this.state.selectionStart !== null && this.state.selectionEnd !== null && (this.inputRef != null && this.inputRef.setSelectionRange(this.state.selectionStart, this.state.selectionEnd), this.setState({
|
|
273
|
+
selectionStart: null,
|
|
274
|
+
selectionEnd: null
|
|
275
|
+
}), document.activeElement !== null && document.activeElement.id === this.textareaId ? this.handleAutoHeight() : this.handleRemoveHeight());
|
|
276
|
+
}
|
|
277
|
+
componentWillUnmount() {
|
|
278
|
+
this.abortController && this.abortController.abort(), this.updateSuggestions.cancel && this.updateSuggestions.cancel(), this.componentIsUnmounting = !0, window.removeEventListener("resize", this.handleAutoHeight), window.removeEventListener("scroll", this.handleListUpdate, { capture: !0 });
|
|
279
|
+
}
|
|
280
|
+
handleListUpdate = () => {
|
|
281
|
+
if (!this.componentIsUnmounting) return this.setState({ queryBarRect: this.queryBarInputDivRefInstance.current?.getBoundingClientRect() });
|
|
282
|
+
};
|
|
283
|
+
handleAutoHeight = () => {
|
|
284
|
+
this.inputRef !== null && document.activeElement === this.inputRef && this.inputRef.style.setProperty("height", `${this.inputRef.scrollHeight}px`, "important"), this.handleListUpdate();
|
|
285
|
+
};
|
|
286
|
+
handleRemoveHeight = () => {
|
|
287
|
+
this.inputRef !== null && this.inputRef.style.removeProperty("height");
|
|
288
|
+
};
|
|
289
|
+
handleBlurHeight = () => {
|
|
290
|
+
this.inputRef !== null && (this.handleRemoveHeight(), this.inputRef.scrollTop = 0);
|
|
291
|
+
};
|
|
292
|
+
handleOnFocus = () => {
|
|
293
|
+
this.props.onChangeQueryInputFocus && this.props.onChangeQueryInputFocus(!0), requestAnimationFrame(() => {
|
|
294
|
+
this.handleAutoHeight();
|
|
295
|
+
});
|
|
296
|
+
};
|
|
297
|
+
render() {
|
|
298
|
+
let e = {
|
|
299
|
+
...this.state.isSuggestionsVisible && {
|
|
300
|
+
"aria-controls": "kbnTypeahead__items",
|
|
301
|
+
"aria-owns": "kbnTypeahead__items"
|
|
302
|
+
},
|
|
303
|
+
role: "combobox"
|
|
304
|
+
};
|
|
305
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
306
|
+
className: (0, import_classnames.default)(this.props.className),
|
|
307
|
+
children: [this.props.prepend, /* @__PURE__ */ (0, import_jsx_runtime.jsx)(EuiOutsideClickDetector, {
|
|
308
|
+
onOutsideClick: this.onOutsideClick,
|
|
309
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
310
|
+
...e,
|
|
311
|
+
style: {
|
|
312
|
+
position: "relative",
|
|
313
|
+
width: "100%"
|
|
314
|
+
},
|
|
315
|
+
"aria-label": "Search and filter the discover page",
|
|
316
|
+
"aria-haspopup": "true",
|
|
317
|
+
"aria-expanded": this.state.isSuggestionsVisible,
|
|
318
|
+
"data-skip-axe": "aria-required-children",
|
|
319
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
320
|
+
role: "search",
|
|
321
|
+
className: "euiFormControlLayout__childrenWrapper kbnQueryBar__textareaWrap z-4001",
|
|
322
|
+
ref: this.queryBarInputDivRefInstance,
|
|
323
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(EuiTextArea, {
|
|
324
|
+
placeholder: this.props.placeholder || "Search",
|
|
325
|
+
value: this.getQueryString(),
|
|
326
|
+
onKeyDown: this.onKeyDown,
|
|
327
|
+
onKeyUp: this.onKeyUp,
|
|
328
|
+
onChange: this.onInputChange,
|
|
329
|
+
onClick: this.onClickInput,
|
|
330
|
+
onBlur: this.onInputBlur,
|
|
331
|
+
onFocus: this.handleOnFocus,
|
|
332
|
+
className: "kbnQueryBar__textarea !shadow-[0_0_transparent,_inset_0_0_0_1px_var(--ant-color-border)] !rounded-6px !bg-[var(--ant-color-bg-container)] !px-5px relative top-1px",
|
|
333
|
+
fullWidth: !0,
|
|
334
|
+
rows: 1,
|
|
335
|
+
id: this.textareaId,
|
|
336
|
+
autoFocus: this.props.onChangeQueryInputFocus ? !1 : !this.props.disableAutoFocus,
|
|
337
|
+
inputRef: (e) => {
|
|
338
|
+
e && (this.inputRef = e);
|
|
339
|
+
},
|
|
340
|
+
autoComplete: "off",
|
|
341
|
+
spellCheck: !1,
|
|
342
|
+
"aria-label": "Start typing to search and filter the discover page",
|
|
343
|
+
"aria-autocomplete": "list",
|
|
344
|
+
"aria-controls": this.state.isSuggestionsVisible ? "kbnTypeahead__items" : void 0,
|
|
345
|
+
"aria-activedescendant": this.state.isSuggestionsVisible && typeof this.state.index == "number" ? `suggestion-${this.state.index}` : void 0,
|
|
346
|
+
role: "textbox",
|
|
347
|
+
"data-test-subj": this.props.dataTestSubj || "queryInput",
|
|
348
|
+
isInvalid: this.props.isInvalid,
|
|
349
|
+
children: this.getQueryString()
|
|
350
|
+
})
|
|
351
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(EuiPortal, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SuggestionsComponent, {
|
|
352
|
+
show: this.state.isSuggestionsVisible,
|
|
353
|
+
suggestions: this.state.suggestions.slice(0, this.state.suggestionLimit),
|
|
354
|
+
index: this.state.index,
|
|
355
|
+
onClick: this.onClickSuggestion,
|
|
356
|
+
onMouseEnter: this.onMouseEnterSuggestion,
|
|
357
|
+
loadMore: this.increaseLimit,
|
|
358
|
+
queryBarRect: this.state.queryBarRect,
|
|
359
|
+
size: this.props.size
|
|
360
|
+
}) })]
|
|
361
|
+
})
|
|
362
|
+
})]
|
|
363
|
+
});
|
|
364
|
+
}
|
|
365
|
+
};
|
|
366
|
+
export { QueryStringInputUI as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`./chunk-BjqF3vbe.cjs`);require(`./lodash-C_2NO1eK.cjs`),require(`./services-BPC3fXx4.cjs`),require(`./public-D1K7oN7t.cjs`),require(`./classnames-BXjDNQ6Q.cjs`),require(`./common-DuYIpe6b.cjs`),require(`./lib-Chy_6VKj.cjs`),require(`./common-BeXEy5sz.cjs`);const t=require(`./query_string_input-CHG9w1ze.cjs`);exports.default=t.t;
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
var conf = {
|
|
2
|
+
comments: { lineComment: "#" },
|
|
3
|
+
brackets: [
|
|
4
|
+
["{", "}"],
|
|
5
|
+
["[", "]"],
|
|
6
|
+
["(", ")"]
|
|
7
|
+
],
|
|
8
|
+
autoClosingPairs: [
|
|
9
|
+
{
|
|
10
|
+
open: "{",
|
|
11
|
+
close: "}"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
open: "[",
|
|
15
|
+
close: "]"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
open: "(",
|
|
19
|
+
close: ")"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
open: "\"",
|
|
23
|
+
close: "\""
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
surroundingPairs: [
|
|
27
|
+
{
|
|
28
|
+
open: "{",
|
|
29
|
+
close: "}"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
open: "[",
|
|
33
|
+
close: "]"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
open: "(",
|
|
37
|
+
close: ")"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
open: "\"",
|
|
41
|
+
close: "\""
|
|
42
|
+
}
|
|
43
|
+
]
|
|
44
|
+
}, language = {
|
|
45
|
+
defaultToken: "",
|
|
46
|
+
tokenPostfix: ".r",
|
|
47
|
+
roxygen: /* @__PURE__ */ "@alias.@aliases.@assignee.@author.@backref.@callGraph.@callGraphDepth.@callGraphPrimitives.@concept.@describeIn.@description.@details.@docType.@encoding.@evalNamespace.@evalRd.@example.@examples.@export.@exportClass.@exportMethod.@exportPattern.@family.@field.@formals.@format.@import.@importClassesFrom.@importFrom.@importMethodsFrom.@include.@inherit.@inheritDotParams.@inheritParams.@inheritSection.@keywords.@md.@method.@name.@noMd.@noRd.@note.@param.@rawNamespace.@rawRd.@rdname.@references.@return.@S3method.@section.@seealso.@setClass.@slot.@source.@template.@templateVar.@title.@TODO.@usage.@useDynLib".split("."),
|
|
48
|
+
constants: [
|
|
49
|
+
"NULL",
|
|
50
|
+
"FALSE",
|
|
51
|
+
"TRUE",
|
|
52
|
+
"NA",
|
|
53
|
+
"Inf",
|
|
54
|
+
"NaN",
|
|
55
|
+
"NA_integer_",
|
|
56
|
+
"NA_real_",
|
|
57
|
+
"NA_complex_",
|
|
58
|
+
"NA_character_",
|
|
59
|
+
"T",
|
|
60
|
+
"F",
|
|
61
|
+
"LETTERS",
|
|
62
|
+
"letters",
|
|
63
|
+
"month.abb",
|
|
64
|
+
"month.name",
|
|
65
|
+
"pi",
|
|
66
|
+
"R.version.string"
|
|
67
|
+
],
|
|
68
|
+
keywords: /* @__PURE__ */ "break,next,return,if,else,for,in,repeat,while,array,category,character,complex,double,function,integer,list,logical,matrix,numeric,vector,data.frame,factor,library,require,attach,detach,source".split(","),
|
|
69
|
+
special: [
|
|
70
|
+
"\\n",
|
|
71
|
+
"\\r",
|
|
72
|
+
"\\t",
|
|
73
|
+
"\\b",
|
|
74
|
+
"\\a",
|
|
75
|
+
"\\f",
|
|
76
|
+
"\\v",
|
|
77
|
+
"\\'",
|
|
78
|
+
"\\\"",
|
|
79
|
+
"\\\\"
|
|
80
|
+
],
|
|
81
|
+
brackets: [
|
|
82
|
+
{
|
|
83
|
+
open: "{",
|
|
84
|
+
close: "}",
|
|
85
|
+
token: "delimiter.curly"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
open: "[",
|
|
89
|
+
close: "]",
|
|
90
|
+
token: "delimiter.bracket"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
open: "(",
|
|
94
|
+
close: ")",
|
|
95
|
+
token: "delimiter.parenthesis"
|
|
96
|
+
}
|
|
97
|
+
],
|
|
98
|
+
tokenizer: {
|
|
99
|
+
root: [
|
|
100
|
+
{ include: "@numbers" },
|
|
101
|
+
{ include: "@strings" },
|
|
102
|
+
[/[{}\[\]()]/, "@brackets"],
|
|
103
|
+
{ include: "@operators" },
|
|
104
|
+
[/#'$/, "comment.doc"],
|
|
105
|
+
[
|
|
106
|
+
/#'/,
|
|
107
|
+
"comment.doc",
|
|
108
|
+
"@roxygen"
|
|
109
|
+
],
|
|
110
|
+
[/(^#.*$)/, "comment"],
|
|
111
|
+
[/\s+/, "white"],
|
|
112
|
+
[/[,:;]/, "delimiter"],
|
|
113
|
+
[/@[a-zA-Z]\w*/, "tag"],
|
|
114
|
+
[/[a-zA-Z]\w*/, { cases: {
|
|
115
|
+
"@keywords": "keyword",
|
|
116
|
+
"@constants": "constant",
|
|
117
|
+
"@default": "identifier"
|
|
118
|
+
} }]
|
|
119
|
+
],
|
|
120
|
+
roxygen: [
|
|
121
|
+
[/@\w+/, { cases: {
|
|
122
|
+
"@roxygen": "tag",
|
|
123
|
+
"@eos": {
|
|
124
|
+
token: "comment.doc",
|
|
125
|
+
next: "@pop"
|
|
126
|
+
},
|
|
127
|
+
"@default": "comment.doc"
|
|
128
|
+
} }],
|
|
129
|
+
[/\s+/, { cases: {
|
|
130
|
+
"@eos": {
|
|
131
|
+
token: "comment.doc",
|
|
132
|
+
next: "@pop"
|
|
133
|
+
},
|
|
134
|
+
"@default": "comment.doc"
|
|
135
|
+
} }],
|
|
136
|
+
[/.*/, {
|
|
137
|
+
token: "comment.doc",
|
|
138
|
+
next: "@pop"
|
|
139
|
+
}]
|
|
140
|
+
],
|
|
141
|
+
numbers: [[/0[xX][0-9a-fA-F]+/, "number.hex"], [/-?(\d*\.)?\d+([eE][+\-]?\d+)?/, "number"]],
|
|
142
|
+
operators: [
|
|
143
|
+
[/<{1,2}-/, "operator"],
|
|
144
|
+
[/->{1,2}/, "operator"],
|
|
145
|
+
[/%[^%\s]+%/, "operator"],
|
|
146
|
+
[/\*\*/, "operator"],
|
|
147
|
+
[/%%/, "operator"],
|
|
148
|
+
[/&&/, "operator"],
|
|
149
|
+
[/\|\|/, "operator"],
|
|
150
|
+
[/<</, "operator"],
|
|
151
|
+
[/>>/, "operator"],
|
|
152
|
+
[/[-+=&|!<>^~*/:$]/, "operator"]
|
|
153
|
+
],
|
|
154
|
+
strings: [[
|
|
155
|
+
/'/,
|
|
156
|
+
"string.escape",
|
|
157
|
+
"@stringBody"
|
|
158
|
+
], [
|
|
159
|
+
/"/,
|
|
160
|
+
"string.escape",
|
|
161
|
+
"@dblStringBody"
|
|
162
|
+
]],
|
|
163
|
+
stringBody: [
|
|
164
|
+
[/\\./, { cases: {
|
|
165
|
+
"@special": "string",
|
|
166
|
+
"@default": "error-token"
|
|
167
|
+
} }],
|
|
168
|
+
[
|
|
169
|
+
/'/,
|
|
170
|
+
"string.escape",
|
|
171
|
+
"@popall"
|
|
172
|
+
],
|
|
173
|
+
[/./, "string"]
|
|
174
|
+
],
|
|
175
|
+
dblStringBody: [
|
|
176
|
+
[/\\./, { cases: {
|
|
177
|
+
"@special": "string",
|
|
178
|
+
"@default": "error-token"
|
|
179
|
+
} }],
|
|
180
|
+
[
|
|
181
|
+
/"/,
|
|
182
|
+
"string.escape",
|
|
183
|
+
"@popall"
|
|
184
|
+
],
|
|
185
|
+
[/./, "string"]
|
|
186
|
+
]
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
export { conf, language };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`./chunk-BjqF3vbe.cjs`);var t={comments:{lineComment:`#`},brackets:[[`{`,`}`],[`[`,`]`],[`(`,`)`]],autoClosingPairs:[{open:`{`,close:`}`},{open:`[`,close:`]`},{open:`(`,close:`)`},{open:`"`,close:`"`}],surroundingPairs:[{open:`{`,close:`}`},{open:`[`,close:`]`},{open:`(`,close:`)`},{open:`"`,close:`"`}]},n={defaultToken:``,tokenPostfix:`.r`,roxygen:`@alias.@aliases.@assignee.@author.@backref.@callGraph.@callGraphDepth.@callGraphPrimitives.@concept.@describeIn.@description.@details.@docType.@encoding.@evalNamespace.@evalRd.@example.@examples.@export.@exportClass.@exportMethod.@exportPattern.@family.@field.@formals.@format.@import.@importClassesFrom.@importFrom.@importMethodsFrom.@include.@inherit.@inheritDotParams.@inheritParams.@inheritSection.@keywords.@md.@method.@name.@noMd.@noRd.@note.@param.@rawNamespace.@rawRd.@rdname.@references.@return.@S3method.@section.@seealso.@setClass.@slot.@source.@template.@templateVar.@title.@TODO.@usage.@useDynLib`.split(`.`),constants:[`NULL`,`FALSE`,`TRUE`,`NA`,`Inf`,`NaN`,`NA_integer_`,`NA_real_`,`NA_complex_`,`NA_character_`,`T`,`F`,`LETTERS`,`letters`,`month.abb`,`month.name`,`pi`,`R.version.string`],keywords:`break,next,return,if,else,for,in,repeat,while,array,category,character,complex,double,function,integer,list,logical,matrix,numeric,vector,data.frame,factor,library,require,attach,detach,source`.split(`,`),special:[`\\n`,`\\r`,`\\t`,`\\b`,`\\a`,`\\f`,`\\v`,`\\'`,`\\"`,`\\\\`],brackets:[{open:`{`,close:`}`,token:`delimiter.curly`},{open:`[`,close:`]`,token:`delimiter.bracket`},{open:`(`,close:`)`,token:`delimiter.parenthesis`}],tokenizer:{root:[{include:`@numbers`},{include:`@strings`},[/[{}\[\]()]/,`@brackets`],{include:`@operators`},[/#'$/,`comment.doc`],[/#'/,`comment.doc`,`@roxygen`],[/(^#.*$)/,`comment`],[/\s+/,`white`],[/[,:;]/,`delimiter`],[/@[a-zA-Z]\w*/,`tag`],[/[a-zA-Z]\w*/,{cases:{"@keywords":`keyword`,"@constants":`constant`,"@default":`identifier`}}]],roxygen:[[/@\w+/,{cases:{"@roxygen":`tag`,"@eos":{token:`comment.doc`,next:`@pop`},"@default":`comment.doc`}}],[/\s+/,{cases:{"@eos":{token:`comment.doc`,next:`@pop`},"@default":`comment.doc`}}],[/.*/,{token:`comment.doc`,next:`@pop`}]],numbers:[[/0[xX][0-9a-fA-F]+/,`number.hex`],[/-?(\d*\.)?\d+([eE][+\-]?\d+)?/,`number`]],operators:[[/<{1,2}-/,`operator`],[/->{1,2}/,`operator`],[/%[^%\s]+%/,`operator`],[/\*\*/,`operator`],[/%%/,`operator`],[/&&/,`operator`],[/\|\|/,`operator`],[/<</,`operator`],[/>>/,`operator`],[/[-+=&|!<>^~*/:$]/,`operator`]],strings:[[/'/,`string.escape`,`@stringBody`],[/"/,`string.escape`,`@dblStringBody`]],stringBody:[[/\\./,{cases:{"@special":`string`,"@default":`error-token`}}],[/'/,`string.escape`,`@popall`],[/./,`string`]],dblStringBody:[[/\\./,{cases:{"@special":`string`,"@default":`error-token`}}],[/"/,`string.escape`,`@popall`],[/./,`string`]]}};exports.conf=t,exports.language=n;
|