@rcsb/rcsb-saguaro-app
Version:
RCSB 1D Saguaro Web App
26 lines • 1.41 kB
JavaScript
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
import { RcsbTabs } from "../RcsbFvWeb/RcsbFvComponents/RcsbTabs";
import { createRoot } from "react-dom/client";
import * as classes from "../scss/bootstrap-fv-display.module.scss";
import { ItemComponent } from "./Components/ItemComponent";
export class GroupPfvUI {
static fvUI(element, uiComponent) {
createRoot(typeof element === "string" ? GroupPfvUI.htmlElementUI(element) : element).render(_jsx(_Fragment, { children: uiComponent.map((b, n) => (_jsx(ItemComponent, { role: "", children: _jsx(b.component, Object.assign({}, b.props)) }, "uiItem_" + n))) }));
}
static addBootstrapElement(elementId) {
const div = GroupPfvUI.htmlElementUI(elementId);
div.className = classes.bootstrapFvComponentScope;
return div;
}
static htmlElementUI(elementId) {
var _a, _b;
let uiDiv = document.getElementById(elementId + RcsbTabs.UI_SUFFIX);
if (!uiDiv) {
uiDiv = document.createElement("div");
uiDiv.setAttribute("id", elementId + RcsbTabs.UI_SUFFIX);
(_b = (_a = document.getElementById(elementId)) === null || _a === void 0 ? void 0 : _a.parentElement) === null || _b === void 0 ? void 0 : _b.insertBefore(uiDiv, document.getElementById(elementId));
}
return uiDiv;
}
}
//# sourceMappingURL=GroupPfvUI.js.map