@sap-devx/inquirer-gui-file-browser-plugin
Version:
File browser plugin for inquirer-gui
67 lines (66 loc) • 2 kB
JavaScript
import { resolveComponent as s, createBlock as m, openBlock as f, withCtx as n, createElementVNode as d, createVNode as r, 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 [i, a] of t)
o[i] = a;
return o;
}, x = {
name: "QuestionFileBrowser",
props: {
question: Object
},
data: () => ({
path: "/home/"
}),
methods: {
setFilePath(e) {
this.question.answer = e, this.$emit("answerChanged", this.question.name, e);
},
onSelectFile() {
this.$emit("customEvent", this.question.name, "getFilePath", this.setFilePath, this.question.answer);
},
onAnswerChanged(e) {
e !== void 0 && this.$emit("answerChanged", this.question.name, e.target.value);
}
}
}, F = (e) => (g("data-v-2414d4a4"), e = e(), C(), e), B = { slot: "content-after" }, k = /* @__PURE__ */ F(() => /* @__PURE__ */ d("span", null, "Browse for files", -1));
function S(e, t, o, i, a, c) {
const _ = s("v-icon"), p = s("v-tooltip"), u = s("vscode-textfield");
return f(), m(u, {
ref: "path",
onChange: c.onAnswerChanged,
value: o.question.answer
}, {
default: n(() => [
d("template", B, [
r(p, { location: "top" }, {
activator: n(({ props: h }) => [
r(_, v(h, { onClick: c.onSelectFile }), {
default: n(() => [
w("mdi-folder-outline")
]),
_: 2
}, 1040, ["onClick"])
]),
default: n(() => [
k
]),
_: 1
})
])
]),
_: 1
}, 8, ["onChange", "value"]);
}
const l = /* @__PURE__ */ q(x, [["render", S], ["__scopeId", "data-v-2414d4a4"]]), P = {
install(e, t) {
e.component("QuestionFileBrowser", l), t && (t.plugin = {
questionType: "file-browser",
component: l
});
}
};
export {
P as default
};
//# sourceMappingURL=fileBrowserPlugin.es.js.map