Creation du système de base des widgets

This commit is contained in:
EpicKiwi 2026-06-14 13:29:00 +02:00
parent 8fda06c77f
commit e61c495cc4
Signed by: epickiwi
GPG key ID: C4B28FD2729941CE
9 changed files with 118 additions and 2 deletions

View file

@ -1,8 +1,10 @@
import "./feature-short-header.js"
import FEATURE_WIDGETS from "../feature-widgets/feature-widgets.js"
const TEMPLATE = document.createElement("template")
TEMPLATE.innerHTML = `
<camp-feature-short-header class="feature-header" ></camp-feature-short-header>
<div class="feature-widgets"></div
`
export class FeatureElement extends HTMLElement {
@ -19,6 +21,14 @@ export class FeatureElement extends HTMLElement {
let header = this.querySelector("camp-feature-short-header")
header.feature = this.feature
header.updateContent()
let widgetContainer = this.querySelector(".feature-widgets");
for(let widgetFn of FEATURE_WIDGETS){
let result = widgetFn(this.feature);
if(result !== undefined && result !== null){
widgetContainer.append(result)
}
}
}
}