UNPKG

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

Version:
3 lines (2 loc) 1.64 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[r,l]of n)i[r]=l;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)}}},c={slot:"content-after"};function f(t,n,i,r,l,a){const p=e.resolveComponent("v-icon"),m=e.resolveComponent("v-tooltip"),h=e.resolveComponent("vscode-textfield");return e.openBlock(),e.createBlock(h,{ref:"path",onChange:a.onAnswerChanged,value:i.question.answer},{default:e.withCtx(()=>[e.createElementVNode("template",c,[e.createVNode(m,{location:"top"},{activator:e.withCtx(({props:u})=>[e.createVNode(p,e.mergeProps(u,{onClick:a.onSelectFile}),{default:e.withCtx(()=>[...n[0]||(n[0]=[e.createTextVNode("mdi-folder-outline",-1)])]),_:1},16,["onClick"])]),default:e.withCtx(()=>[n[1]||(n[1]=e.createElementVNode("span",null,"Browse for files",-1))]),_: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