mirror of
https://github.com/Bubka/2FAuth.git
synced 2024-12-12 10:10:59 +01:00
2 lines
1.4 KiB
JavaScript
Vendored
2 lines
1.4 KiB
JavaScript
Vendored
import{r as d,o as u,v as h,m as n,d as c,e as a,n as m,h as k,l as p}from"./app-D4Udf6Mm.js";/*! 2FAuth version 5.4.1 - Copyright (c) 2024 Bubka - https://github.com/Bubka/2FAuth */const y={role:"search",class:"field"},f={class:"control has-icons-right"},v=["aria-label","title","placeholder","value"],w={class:"icon is-small is-right"},g=["title"],b={__name:"SearchBox",props:{keyword:String,hasNoBackground:{type:Boolean,default:!1},placeholder:String},setup(t){const s=d(null);u(()=>{document.addEventListener("keydown",r)}),h(()=>{document.removeEventListener("keydown",r)});function r(e){var o;e.key==="f"&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),(o=s.value)==null||o.focus())}return(e,o)=>{const i=p("FontAwesomeIcon");return n(),c("div",y,[a("div",f,[a("input",{ref_key:"searchInput",ref:s,id:"txtSearch",type:"search",tabindex:"1","aria-label":e.$t("commons.search"),title:e.$t("commons.search"),placeholder:t.placeholder,class:m(["input is-rounded is-search",{"has-no-background":t.hasNoBackground}]),value:t.keyword,onKeyup:o[0]||(o[0]=l=>e.$emit("update:keyword",l.target.value))},null,42,v),a("span",w,[t.keyword!=""?(n(),c("button",{key:0,id:"btnClearSearch",tabindex:"1",title:e.$t("commons.clear_search"),class:"clear-selection delete",onClick:o[1]||(o[1]=l=>e.$emit("update:keyword",""))},null,8,g)):(n(),k(i,{key:1,icon:["fas","search"]}))])])])}}};export{b as _};
|