From 4479c92bb4901d616337f40bec034341f5a5bbfc Mon Sep 17 00:00:00 2001 From: chris Date: Fri, 28 Feb 2025 23:15:23 +0100 Subject: [PATCH] MINOR,FEAT: Adjusted the component container logic --- src/baseComponents.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/baseComponents.js b/src/baseComponents.js index 4a31f06..e638474 100644 --- a/src/baseComponents.js +++ b/src/baseComponents.js @@ -82,6 +82,15 @@ class FlexContainerComponent extends Component { } return super.childContext(innerComponent); } + + /** + * + * @returns {FlexContainerComponent} + */ + distibuteSpacingEvenly() { + console.log("Doing nothing Flexcontainer doesn't know how to distribute spacing evenly - ask the children (Row, Column)"); + return this; + } } /** @@ -103,6 +112,19 @@ class Column extends FlexContainerComponent { .setStyleRule("flex-direction", "column") ); } + + /** + * @todo - adapt to extStore logic + * @override + * @returns {Column} + */ + distibuteSpacingEvenly() { + this._element.children.forEach(child => { + child.style["height"] = ((100 - this._element.childElementCount) / innerComponent.length); + }) + return this; + } + } /**