UNPKG

basb-cli

Version:
29 lines (22 loc) 857 B
import ChartImporter from "./importer.js" import importStyle from "../style.js" import { config } from "../../../utils/loadConfig.js" const { language, ganttOptions } = config let globalOptions = ganttOptions ?? {} if (!("language" in globalOptions)) { // set language of gantt charts as default globalOptions.language = language } class GanttImporter extends ChartImporter { _targetElList = () => document.querySelectorAll(".ganttchart-container") renderItem(el, chartContent) { new this._module(el, chartContent, globalOptions) } async importModule() { importStyle("./dist/libs/frappe-gantt/frappe-gantt.min.css") const module = await import("../../../libs/frappe-gantt/frappe-gantt.min.js") return module.default } } const inst = new GanttImporter() export default inst.render.bind(inst)