53 lines
1.3 KiB
JavaScript
53 lines
1.3 KiB
JavaScript
import HamalronItemSheet from "./base-item-sheet.mjs"
|
|
|
|
export default class HamalronRegionSheet extends HamalronItemSheet {
|
|
/** @override */
|
|
static DEFAULT_OPTIONS = {
|
|
classes: ["region"],
|
|
position: {
|
|
width: 620,
|
|
},
|
|
window: {
|
|
contentClasses: ["region-content"],
|
|
},
|
|
}
|
|
|
|
/** @override */
|
|
static PARTS = {
|
|
tabs: {
|
|
template: "templates/generic/tab-navigation.hbs",
|
|
},
|
|
main: {
|
|
template: "systems/fvtt-hamalron/templates/region.hbs",
|
|
},
|
|
}
|
|
|
|
/** @override */
|
|
tabGroups = {
|
|
sheet: "main",
|
|
}
|
|
|
|
/**
|
|
* Prepare an array of form header tabs.
|
|
* @returns {Record<string, Partial<ApplicationTab>>}
|
|
*/
|
|
#getTabs() {
|
|
const tabs = {
|
|
main: { id: "main", group: "sheet", icon: "fa-solid fa-circle-info", label: "HAMALRON.Label.Details" },
|
|
}
|
|
for (const v of Object.values(tabs)) {
|
|
v.active = this.tabGroups[v.group] === v.id
|
|
v.cssClass = v.active ? "active" : ""
|
|
}
|
|
return tabs
|
|
}
|
|
|
|
/** @override */
|
|
async _prepareContext() {
|
|
const context = await super._prepareContext()
|
|
context.tabs = this.#getTabs()
|
|
context.enrichedDescription = await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.document.system.description, { async: true })
|
|
return context
|
|
}
|
|
}
|