UNPKG

@sap-devx/inquirer-gui-file-browser-plugin

Version:
3 lines (2 loc) 1.47 kB
"use strict";const e=require("vue"),u=(t,o)=>{const n=t.__vccOpts||t;for(const[s,i]of o)n[s]=i;return n},p={name:"QuestionFileBrowser",props:{question:Object},data:()=>({path:"/home/"}),methods:{setFilePath(t){this.question.answer=t,this.$emit("answerChanged",this.question.name,t)},onSelectFile(){this.$emit("customEvent",this.question.name,"getFilePath",this.setFilePath,this.question.answer)},onAnswerChanged(t){t!==void 0&&this.$emit("answerChanged",this.question.name,t.target.value)}}},_=t=>(e.pushScopeId("data-v-2414d4a4"),t=t(),e.popScopeId(),t),m={slot:"content-after"},f=_(()=>e.createElementVNode("span",null,"Browse for files",-1));function v(t,o,n,s,i,a){const r=e.resolveComponent("v-icon"),l=e.resolveComponent("v-tooltip"),d=e.resolveComponent("vscode-textfield");return e.openBlock(),e.createBlock(d,{ref:"path",onChange:a.onAnswerChanged,value:n.question.answer},{default:e.withCtx(()=>[e.createElementVNode("template",m,[e.createVNode(l,{location:"top"},{activator:e.withCtx(({props:h})=>[e.createVNode(r,e.mergeProps(h,{onClick:a.onSelectFile}),{default:e.withCtx(()=>[e.createTextVNode("mdi-folder-outline")]),_:2},1040,["onClick"])]),default:e.withCtx(()=>[f]),_:1})])]),_:1},8,["onChange","value"])}const c=u(p,[["render",v],["__scopeId","data-v-2414d4a4"]]),w={install(t,o){t.component("QuestionFileBrowser",c),o&&(o.plugin={questionType:"file-browser",component:c})}};module.exports=w; //# sourceMappingURL=fileBrowserPlugin.common.js.map