UNPKG

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

Version:

Folder browser plugin for inquirer-gui

67 lines (66 loc) 2.01 kB
import { resolveComponent as s, createBlock as f, openBlock as m, withCtx as n, createElementVNode as l, createVNode as i, mergeProps as v, createTextVNode as w, pushScopeId as g, popScopeId as C } from "vue"; const q = (e, t) => { const o = e.__vccOpts || e; for (const [r, a] of t) o[r] = a; return o; }, x = { name: "QuestionFolderBrowser", props: { question: Object }, data: () => ({ path: "/home/" }), methods: { setFolderPath(e) { this.question.answer = e, this.$emit("answerChanged", this.question.name, e); }, onSelectFolder() { this.$emit("customEvent", this.question.name, "getPath", this.setFolderPath, this.question.answer); }, onAnswerChanged(e) { e !== void 0 && this.$emit("answerChanged", this.question.name, e.target.value); } } }, F = (e) => (g("data-v-7f384726"), e = e(), C(), e), B = { slot: "content-after" }, k = /* @__PURE__ */ F(() => /* @__PURE__ */ l("span", null, "Browse for folder", -1)); function S(e, t, o, r, a, c) { const _ = s("v-icon"), p = s("v-tooltip"), u = s("vscode-textfield"); return m(), f(u, { ref: "path", onChange: c.onAnswerChanged, value: o.question.answer }, { default: n(() => [ l("template", B, [ i(p, { location: "top" }, { activator: n(({ props: h }) => [ i(_, v(h, { onClick: c.onSelectFolder }), { default: n(() => [ w("mdi-folder-outline") ]), _: 2 }, 1040, ["onClick"]) ]), default: n(() => [ k ]), _: 1 }) ]) ]), _: 1 }, 8, ["onChange", "value"]); } const d = /* @__PURE__ */ q(x, [["render", S], ["__scopeId", "data-v-7f384726"]]), P = { install(e, t) { e.component("QuestionFolderBrowser", d), t && (t.plugin = { questionType: "folder-browser", component: d }); } }; export { P as default }; //# sourceMappingURL=folderBrowserPlugin.es.js.map