2024-03-29 22:33:38 +00:00
|
|
|
import { openBlock as r, createElementBlock as o, createElementVNode as g, normalizeClass as m, Fragment as y, renderList as w, createCommentVNode as _, toDisplayString as v, renderSlot as T, resolveComponent as f, createVNode as i, withCtx as b, createTextVNode as h } from "../lib/vue.esm-browser.js";
|
|
|
|
function k(...t) {
|
|
|
|
return t.reduce((a, e) => a + e, "");
|
2024-03-29 22:10:11 +00:00
|
|
|
}
|
2024-03-29 22:33:38 +00:00
|
|
|
const p = (t, a) => {
|
|
|
|
const e = t.__vccOpts || t;
|
|
|
|
for (const [l, s] of a)
|
|
|
|
e[l] = s;
|
|
|
|
return e;
|
|
|
|
}, x = {
|
2024-03-29 22:10:11 +00:00
|
|
|
name: "Tabs",
|
|
|
|
props: ["context", "actor", "group", "tabs", "flags"],
|
|
|
|
setup() {
|
2024-03-29 22:33:38 +00:00
|
|
|
return { concat: k };
|
2024-03-29 22:10:11 +00:00
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
currentTab: "creatures"
|
|
|
|
};
|
|
|
|
},
|
|
|
|
methods: {
|
2024-03-29 22:33:38 +00:00
|
|
|
changeTab(t) {
|
|
|
|
t && t.currentTarget && (this.currentTab = t.currentTarget.dataset.tab);
|
|
|
|
for (let [a, e] of Object.entries(this.tabs))
|
2024-03-29 22:10:11 +00:00
|
|
|
this.tabs[a].active = !1;
|
|
|
|
this.tabs[this.currentTab] && (this.tabs[this.currentTab].active = !0);
|
|
|
|
},
|
2024-03-29 22:33:38 +00:00
|
|
|
getTabClass(t, a) {
|
|
|
|
return `tab-link tab-link--${a}${t.active ? " active" : ""}`;
|
2024-03-29 22:10:11 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
async mounted() {
|
2024-03-29 22:33:38 +00:00
|
|
|
var a;
|
|
|
|
const t = (a = Object.values(this.tabs)) == null ? void 0 : a.find((e) => e.active);
|
|
|
|
Object.values(this.tabs).forEach((e) => console.log(e)), console.log("Active", t), this.currentTab = (t == null ? void 0 : t.key) ?? "creatures", this.changeTab(!1);
|
2024-03-29 22:10:11 +00:00
|
|
|
}
|
2024-03-29 22:33:38 +00:00
|
|
|
}, C = { class: "section section--tabs flexshrink" }, $ = ["data-group"], B = ["data-tab"], S = { key: 1 };
|
|
|
|
function N(t, a, e, l, s, u) {
|
|
|
|
return r(), o("section", C, [
|
|
|
|
g("nav", {
|
|
|
|
class: m("sheet-tabs tabs tabs--" + e.group),
|
|
|
|
"data-group": e.group
|
2024-03-29 22:10:11 +00:00
|
|
|
}, [
|
2024-03-29 22:33:38 +00:00
|
|
|
(r(!0), o(y, null, w(e.tabs, (n, c) => (r(), o("span", {
|
|
|
|
key: "tab-" + e.group + "-" + c
|
2024-03-29 22:10:11 +00:00
|
|
|
}, [
|
2024-03-29 22:33:38 +00:00
|
|
|
n.hidden ? _("", !0) : (r(), o("a", {
|
2024-03-29 22:10:11 +00:00
|
|
|
key: 0,
|
2024-03-29 22:33:38 +00:00
|
|
|
onClick: a[0] || (a[0] = (...d) => u.changeTab && u.changeTab(...d)),
|
|
|
|
class: m(u.getTabClass(n, c)),
|
|
|
|
"data-tab": c
|
2024-03-29 22:10:11 +00:00
|
|
|
}, [
|
2024-03-29 22:33:38 +00:00
|
|
|
n.icon ? (r(), o("i", {
|
2024-03-29 22:10:11 +00:00
|
|
|
key: 0,
|
2024-03-29 22:33:38 +00:00
|
|
|
class: m(l.concat("fas ", n.icon))
|
|
|
|
}, null, 2)) : _("", !0),
|
|
|
|
n.hideLabel ? _("", !0) : (r(), o("span", S, v(n.label), 1))
|
|
|
|
], 10, B))
|
2024-03-29 22:10:11 +00:00
|
|
|
]))), 128))
|
|
|
|
], 10, $)
|
|
|
|
]);
|
|
|
|
}
|
2024-03-29 22:33:38 +00:00
|
|
|
const O = /* @__PURE__ */ p(x, [["render", N]]), V = {
|
2024-03-29 22:10:11 +00:00
|
|
|
name: "Tab",
|
|
|
|
props: ["context", "actor", "tab", "group", "classes"]
|
2024-03-29 22:33:38 +00:00
|
|
|
}, z = ["data-group", "data-tab"];
|
|
|
|
function I(t, a, e, l, s, u) {
|
|
|
|
return r(), o("div", {
|
|
|
|
class: m("tab " + e.tab.key + (e.tab.active ? " active" : "") + (e.classes ? " " + e.classes : "")),
|
|
|
|
"data-group": e.group,
|
|
|
|
"data-tab": e.tab.key
|
2024-03-29 22:10:11 +00:00
|
|
|
}, [
|
2024-03-29 22:33:38 +00:00
|
|
|
T(t.$slots, "default")
|
|
|
|
], 10, z);
|
2024-03-29 22:10:11 +00:00
|
|
|
}
|
2024-03-29 22:33:38 +00:00
|
|
|
const P = /* @__PURE__ */ p(V, [["render", I]]), j = {
|
2024-03-29 22:10:11 +00:00
|
|
|
name: "Stub",
|
|
|
|
props: ["context"]
|
|
|
|
};
|
2024-03-29 22:33:38 +00:00
|
|
|
function E(t, a, e, l, s, u) {
|
|
|
|
return r(), o("h1", null, [
|
|
|
|
T(t.$slots, "default", {}, void 0, !0)
|
|
|
|
]);
|
2024-03-29 22:10:11 +00:00
|
|
|
}
|
2024-03-29 22:33:38 +00:00
|
|
|
const M = /* @__PURE__ */ p(j, [["render", E], ["__scopeId", "data-v-ceecbcd3"]]), A = {
|
2024-03-29 22:10:11 +00:00
|
|
|
name: "ArchmageCompendiumBrowser",
|
|
|
|
props: ["context"],
|
|
|
|
components: {
|
2024-03-29 22:33:38 +00:00
|
|
|
Tabs: O,
|
|
|
|
Tab: P,
|
|
|
|
Stub: M
|
2024-03-29 22:10:11 +00:00
|
|
|
// CompendiumBrowserCreatures,
|
|
|
|
// CompendiumBrowserPowers,
|
|
|
|
// CompendiumBrowserItems
|
|
|
|
},
|
|
|
|
setup() {
|
|
|
|
return {
|
|
|
|
CONFIG,
|
|
|
|
game
|
|
|
|
};
|
|
|
|
},
|
|
|
|
data() {
|
2024-03-29 22:33:38 +00:00
|
|
|
var t, a, e;
|
2024-03-29 22:10:11 +00:00
|
|
|
return {
|
|
|
|
// The only variable we actually need to track is the active tab.
|
|
|
|
tabs: {
|
|
|
|
primary: {
|
|
|
|
// Default tab is assigned in the flags() computed property.
|
|
|
|
creatures: {
|
|
|
|
key: "creatures",
|
|
|
|
label: game.i18n.localize("CMPBrowser.Tab.NPCBrowser"),
|
2024-03-29 22:33:38 +00:00
|
|
|
active: ((t = this.context) == null ? void 0 : t.defaultTab) === "creatures",
|
2024-03-29 22:10:11 +00:00
|
|
|
opened: !1
|
|
|
|
},
|
|
|
|
powers: {
|
|
|
|
key: "powers",
|
|
|
|
label: game.i18n.localize("CMPBrowser.Tab.SpellBrowser"),
|
2024-03-29 22:33:38 +00:00
|
|
|
active: ((a = this.context) == null ? void 0 : a.defaultTab) === "powers",
|
2024-03-29 22:10:11 +00:00
|
|
|
opened: !1
|
|
|
|
},
|
|
|
|
items: {
|
|
|
|
key: "items",
|
|
|
|
label: game.i18n.localize("CMPBrowser.Tab.ItemBrowser"),
|
2024-03-29 22:33:38 +00:00
|
|
|
active: ((e = this.context) == null ? void 0 : e.defaultTab) === "items",
|
2024-03-29 22:10:11 +00:00
|
|
|
opened: !1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
},
|
|
|
|
methods: {},
|
|
|
|
computed: {},
|
|
|
|
watch: {},
|
|
|
|
async created() {
|
|
|
|
console.log("Creating compendium browser...");
|
|
|
|
},
|
|
|
|
async mounted() {
|
|
|
|
console.log("Compendium browser mounted.");
|
|
|
|
}
|
2024-03-29 22:33:38 +00:00
|
|
|
}, F = { class: "compendium-browser-vue flexcol" }, L = { class: "container container--top" }, D = { class: "container container--bottom" };
|
|
|
|
function G(t, a, e, l, s, u) {
|
|
|
|
const n = f("Tabs"), c = f("Stub"), d = f("Tab");
|
|
|
|
return r(), o("div", F, [
|
|
|
|
g("section", L, [
|
|
|
|
i(n, {
|
2024-03-29 22:10:11 +00:00
|
|
|
group: "primary",
|
2024-03-29 22:33:38 +00:00
|
|
|
tabs: s.tabs.primary
|
|
|
|
}, null, 8, ["tabs"])
|
2024-03-29 22:10:11 +00:00
|
|
|
]),
|
2024-03-29 22:33:38 +00:00
|
|
|
g("section", D, [
|
|
|
|
i(d, {
|
|
|
|
group: "primary",
|
|
|
|
tab: s.tabs.primary.creatures,
|
|
|
|
classes: "container container--bottom flexrow"
|
|
|
|
}, {
|
|
|
|
default: b(() => [
|
|
|
|
i(c, null, {
|
|
|
|
default: b(() => [
|
|
|
|
h("Creatures")
|
|
|
|
]),
|
|
|
|
_: 1
|
|
|
|
})
|
|
|
|
]),
|
|
|
|
_: 1
|
|
|
|
}, 8, ["tab"]),
|
|
|
|
i(d, {
|
|
|
|
group: "primary",
|
|
|
|
tab: s.tabs.primary.powers,
|
|
|
|
classes: "container container--bottom flexrow"
|
|
|
|
}, {
|
|
|
|
default: b(() => [
|
|
|
|
i(c, null, {
|
|
|
|
default: b(() => [
|
|
|
|
h("Spells")
|
|
|
|
]),
|
|
|
|
_: 1
|
|
|
|
})
|
|
|
|
]),
|
|
|
|
_: 1
|
|
|
|
}, 8, ["tab"]),
|
|
|
|
i(d, {
|
2024-03-29 22:10:11 +00:00
|
|
|
group: "primary",
|
2024-03-29 22:33:38 +00:00
|
|
|
tab: s.tabs.primary.items,
|
2024-03-29 22:10:11 +00:00
|
|
|
classes: "container container--bottom flexrow"
|
|
|
|
}, {
|
2024-03-29 22:33:38 +00:00
|
|
|
default: b(() => [
|
|
|
|
i(c, null, {
|
|
|
|
default: b(() => [
|
|
|
|
h("Items")
|
|
|
|
]),
|
|
|
|
_: 1
|
|
|
|
})
|
2024-03-29 22:10:11 +00:00
|
|
|
]),
|
|
|
|
_: 1
|
|
|
|
}, 8, ["tab"])
|
|
|
|
])
|
|
|
|
]);
|
|
|
|
}
|
2024-03-29 22:33:38 +00:00
|
|
|
const H = /* @__PURE__ */ p(A, [["render", G]]);
|
2024-03-29 22:10:11 +00:00
|
|
|
export {
|
2024-03-29 22:33:38 +00:00
|
|
|
H as VueCompendiumBrowser
|
2024-03-29 22:10:11 +00:00
|
|
|
};
|
|
|
|
//# sourceMappingURL=components.vue.es.js.map
|