UNPKG

n8n-editor-ui

Version:

Workflow Editor UI for n8n

2 lines 3.4 kB
(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{};e.SENTRY_RELEASE={id:`n8n@2.13.4`}}catch{}})();try{(function(){var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`f7185d1d-e5e2-4b8b-9d52-edcb7f1294a7`,e._sentryDebugIdIdentifier=`sentry-dbid-f7185d1d-e5e2-4b8b-9d52-edcb7f1294a7`)})()}catch{}import{$ as e,E as t,Ft as n,N as r,R as i,S as a,Wt as o,_n as s,gt as c,j as l,yn as u,yt as d}from"./vue.runtime.esm-bundler-D9KLAxvJ.js";import{O as f,bt as p}from"./_MapCache-CUJwh2qp.js";import{$i as m,Fi as h,Ht as g}from"./src-wni2AGA3.js";import{t as _}from"./_plugin-vue_export-helper-Dm3nT7Ps.js";import"./sanitize-html-my1ogl5v.js";import{Ic as v}from"./constants-CIP7tKq1.js";import"./merge-BqvKZ38d.js";import{t as y}from"./useDebounce-CTeIt-cH.js";var b={"data-test-id":`ndv-search-container`},x=`30px`,S=`204px`,C=`120px`,w=_(r({__name:`RunDataSearch`,props:{modelValue:{},paneType:{default:`output`},displayMode:{default:`schema`},shortcut:{default:void 0}},emits:[`update:modelValue`,`focus`],setup(r,{emit:_}){let w=_,T=r,E=p(),{debounce:D}=y(),{isCtrlKeyPressed:O,controlKeyText:k}=g(),A=i(v,void 0),j=a(()=>A?.value?.document??window.document),M=n(null),N=n(null),P=n(T.modelValue??``),F=n(!!P.value),I=a(()=>T.shortcut===`ctrl+f`?E.baseText(`ndv.search.placeholder.shortcutHint`,{interpolate:{shortcut:`${k.value}+F`}}):T.paneType===`output`?E.baseText(`ndv.search.placeholder.output`):T.displayMode===`schema`?E.baseText(`ndv.search.placeholder.input.schema`):E.baseText(`ndv.search.placeholder.input`)),L=a(()=>F.value?{maxWidth:S,minWidth:C}:{maxWidth:x}),R=e=>{let t=W(e);if(t)switch(e.preventDefault(),e.stopImmediatePropagation(),t){case`open`:M.value=document.activeElement,N.value?.focus(),N.value?.select();break;case`cancel`:N.value?.blur(),F.value=!1,w(`update:modelValue`,``),M.value instanceof HTMLElement&&M.value.focus()}},z=D(async e=>w(`update:modelValue`,e),{debounceTime:300,trailing:!0}),B=e=>{P.value=e,z(e)},V=()=>{F.value=!0,N.value?.select(),w(`focus`)},H=()=>{T.modelValue||(F.value=!1)};function U(e){return e instanceof HTMLElement?e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement||e.getAttribute(`contentEditable`)===`true`:!1}function W(e){if(F.value&&e.key===`Escape`)return`cancel`;switch(T.shortcut){case`/`:return e.key===`/`&&!U(e.target)?`open`:void 0;case`ctrl+f`:return e.key===`f`&&O(e)?`open`:void 0;case void 0:return}}return f(j,`keydown`,R,{capture:!0}),c(()=>T.modelValue,e=>{let t=P.value&&!e;P.value=e,t&&(F.value=!1)}),(n,r)=>(e(),t(`div`,b,[l(o(h),{ref_key:`inputRef`,ref:N,"data-test-id":`ndv-search`,class:s({[n.$style.ioSearch]:!0,[n.$style.ioSearchOpened]:F.value}),style:u(L.value),"model-value":P.value,placeholder:I.value,size:`small`,"onUpdate:modelValue":B,onFocus:V,onBlur:H},{prefix:d(()=>[l(o(m),{class:s(n.$style.ioSearchIcon),icon:`search`,size:`large`},null,8,[`class`])]),_:1},8,[`class`,`style`,`model-value`,`placeholder`])]))}}),[[`__cssModules`,{$style:{ioSearch:`_ioSearch_1bmr7_125`,ioSearchIcon:`_ioSearchIcon_1bmr7_132`,ioSearchOpened:`_ioSearchOpened_1bmr7_142`}}]]);export{w as default}; //# sourceMappingURL=RunDataSearch-BYJPqu40.js.map