oft/module/apps/elements/_index.mjs
2026-02-10 23:03:43 -07:00

22 lines
527 B
JavaScript

import { OFTIcon } from "./Icon.mjs";
import { OFTSVGLoader } from "./SVGLoader.mjs";
const components = [
OFTSVGLoader,
OFTIcon,
];
export function registerCustomComponents() {
(CONFIG.CACHE ??= {}).componentListeners ??= [];
for (const component of components) {
if (!window.customElements.get(component.elementName)) {
window.customElements.define(
component.elementName,
component,
);
if (component.formAssociated) {
CONFIG.CACHE.componentListeners.push(component.elementName);
}
};
}
};