@sap-devx/inquirer-gui-folder-browser-plugin
Version:
Folder browser plugin for inquirer-gui
67 lines (66 loc) • 1.91 kB
JavaScript
import { resolveComponent as s, openBlock as _, createBlock as h, withCtx as n, createElementVNode as l, createVNode as d, mergeProps as v, createTextVNode as w } from "vue";
const g = (e, t) => {
const o = e.__vccOpts || e;
for (const [r, a] of t)
o[r] = a;
return o;
}, C = {
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);
}
}
}, q = { slot: "content-after" };
function x(e, t, o, r, a, i) {
const u = s("v-icon"), m = s("v-tooltip"), f = s("vscode-textfield");
return _(), h(f, {
ref: "path",
onChange: i.onAnswerChanged,
value: o.question.answer
}, {
default: n(() => [
l("template", q, [
d(m, { location: "top" }, {
activator: n(({ props: p }) => [
d(u, v(p, { onClick: i.onSelectFolder }), {
default: n(() => [...t[0] || (t[0] = [
w("mdi-folder-outline", -1)
])]),
_: 1
}, 16, ["onClick"])
]),
default: n(() => [
t[1] || (t[1] = l("span", null, "Browse for folder", -1))
]),
_: 1
})
])
]),
_: 1
}, 8, ["onChange", "value"]);
}
const c = /* @__PURE__ */ g(C, [["render", x], ["__scopeId", "data-v-7f384726"]]), B = {
install(e, t) {
e.component("QuestionFolderBrowser", c), t && (t.plugin = {
questionType: "folder-browser",
component: c
});
}
};
export {
B as default
};
//# sourceMappingURL=folderBrowserPlugin.es.js.map