Browse Source

MINOR,FEAT,REFA,DOC,LINT:

Update Component.js and FlexContainerComponent.js
dev-main
Default User 1 month ago
committed by chris
parent
commit
3e04d6c6c2
  1. 19
      src/component/Component.js
  2. 12
      src/component/FlexContainerComponent.js

19
src/component/Component.js

@ -82,7 +82,7 @@ class Component extends StyleAndScriptStoringComponent {
* @param {boolean} horizontal Defines if the Component should overflow horizontally (default: false)
* @returns {Component}
*/
overflow(vertical = true, horizontal = false ) {
overflow(vertical = true, horizontal = false) {
if (vertical || horizontal) {
this._modifier.join(
new Modifier()
@ -124,6 +124,23 @@ class Component extends StyleAndScriptStoringComponent {
return this;
}
/**
* Since the "hidden" method call was quite often called as being conditional,
* and to resolve that it needed to be wrapped into an apply (and if condition within that) call.
* This method is purely convinience as it reduces unnecessary code line.
* @experimental
* @convenience
* @param {boolean} [condition=false]
* @param {boolean} [untilFound=false]
* @returns {Component}
*/
hiddenByCondition(condition = false, untilFound = false) {
if (condition) {
return this.hidden(untilFound);
}
return this;
}
/**
* Subscribes element under higher_compel group
* sets corr. variable true

12
src/component/FlexContainerComponent.js

@ -78,10 +78,9 @@ class FlexContainerComponent extends Component {
/**
*
* @param {number} [recessFraction=0.0] recessFraction a fraction/percentage of the recess
* @param {number} [recessFraction=0.0] recessFraction a fraction/percentage (<1.0) of the recess
* that should be left out before distributing the remaining space.
* @param {number} [gapPerChild=1] gapPerChild the gap per child, therefore inbetween children
* that shouldn't be distributed to the children
* @param {number} [gapPerChild=1] gapPerChild the gap per child, therefore the recess between children
*/
_distributingSpacing(recessFraction = 0.0, gapPerChild = 1) {
if (this._children && this._children.length > 1) {
@ -110,13 +109,14 @@ class FlexContainerComponent extends Component {
* Distributes the spacing of the childrens evengly,
* according to the flexdirection of this component.
* By default this will be executed imediately when called.
* The spacing is distributed by:
* 100 - 100 * recessFraction - (children) * gapPerChild
*
* @param {boolean} [rightNow=true] if set to false it will set properties accordingly
* so that the distribution will be executed on generate
* @param {number} [recessFraction=0.0] recessFraction a fraction/percentage of the recess
* @param {number} [recessFraction=0.0] recessFraction a fraction/percentage (<1.0) of the recess
* that should be left out before distributing the remaining space.
* @param {number} [gapPerChild=1] gapPerChild the gap per child, therefore inbetween children
* that shouldn't be distributed to the children
* @param {number} [gapPerChild=1] gapPerChild the gap per child, therefore the recess between children
* @returns {FlexContainerComponent}
*/
distibuteSpacingEvenly(rightNow = true, recessFraction = 0.0, gapPerChild = 1) {

Loading…
Cancel
Save