Browse Source

MINOR,FEAT: Adjusted the component container logic

master
chris 2 months ago
parent
commit
4479c92bb4
  1. 22
      src/baseComponents.js

22
src/baseComponents.js

@ -82,6 +82,15 @@ class FlexContainerComponent extends Component {
} }
return super.childContext(innerComponent); 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") .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;
}
} }
/** /**

Loading…
Cancel
Save