UNPKG

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

Version:
3 lines (2 loc) 1.68 kB
(function(e,o){typeof exports=="object"&&typeof module<"u"?module.exports=o(require("vue")):typeof define=="function"&&define.amd?define(["vue"],o):(e=typeof globalThis<"u"?globalThis:e||self,e.fileBrowserPlugin=o(e.Vue))})(this,function(e){"use strict";const o=(t,n)=>{const i=t.__vccOpts||t;for(const[c,r]of n)i[c]=r;return i},d={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)}}},l=t=>(e.pushScopeId("data-v-2414d4a4"),t=t(),e.popScopeId(),t),p={slot:"content-after"},h=l(()=>e.createElementVNode("span",null,"Browse for files",-1));function f(t,n,i,c,r,a){const _=e.resolveComponent("v-icon"),m=e.resolveComponent("v-tooltip"),u=e.resolveComponent("vscode-textfield");return e.openBlock(),e.createBlock(u,{ref:"path",onChange:a.onAnswerChanged,value:i.question.answer},{default:e.withCtx(()=>[e.createElementVNode("template",p,[e.createVNode(m,{location:"top"},{activator:e.withCtx(({props:w})=>[e.createVNode(_,e.mergeProps(w,{onClick:a.onSelectFile}),{default:e.withCtx(()=>[e.createTextVNode("mdi-folder-outline")]),_:2},1040,["onClick"])]),default:e.withCtx(()=>[h]),_:1})])]),_:1},8,["onChange","value"])}const s=o(d,[["render",f],["__scopeId","data-v-2414d4a4"]]);return{install(t,n){t.component("QuestionFileBrowser",s),n&&(n.plugin={questionType:"file-browser",component:s})}}}); //# sourceMappingURL=fileBrowserPlugin.umd.js.map