diff --git a/src/builder.js b/src/builder.js index b9ca1fa..4afb420 100644 --- a/src/builder.js +++ b/src/builder.js @@ -93,7 +93,7 @@ const builder = { * @param {InputTypes|string} type * @param {Map} attr * @param {Modifier} modifier - * @returns {Component} + * @returns {InputComponent} */ input: function (type, attr = {}, modifier = null) { return new InputComponent( @@ -109,7 +109,7 @@ const builder = { * * @param {Map} attr * @param {Modifier} modifier - * @returns {Function} + * @returns {function(Object): InputComponent} */ inputTags: Object.freeze({ button: function (attr = {}, modifier = null) { return builder.input("button", attr, modifier) }, @@ -172,7 +172,7 @@ const builder = { * * @param {Map} attr * @param {Modifier} modifier - * @returns {Component} + * @returns {InputComponent} */ checkbox: function (attr = {}, modifier = null) { return builder.input({ "type": "checkbox" }, modifier) }, @@ -220,7 +220,7 @@ const builder = { * * @param {Map} attr * @param {Modifier} modifier - * @returns {Component} + * @returns {InputComponent} */ textarea: function (attr = {}, modifier = null) { return new InputComponent( diff --git a/src/component.js b/src/component.js index 97275c8..fca0a36 100644 --- a/src/component.js +++ b/src/component.js @@ -126,6 +126,9 @@ class Component extends StyleAndScriptStoringComponent { } /** + * Subscribes element under higher_compel group + * sets corr. variable true + * setAttribute("data-compel-isHCompel", "true") * * @returns {Component} */ diff --git a/src/context/generalHelpers.js b/src/context/generalHelpers.js index 522cb3f..1d5d622 100644 --- a/src/context/generalHelpers.js +++ b/src/context/generalHelpers.js @@ -78,7 +78,14 @@ class ObjectAccessObject { } - +/** + * (De-) hides the given element. + * On ensureHidden=true it will be hidden regardless of the current state. + * + * @param {HTMLElement} element + * @param {boolean} ensureHidden + * @returns {boolean} + */ function toggleElementVisibility(element, ensureHidden = false) { element.classList.toggle("compel-mech-hidden"); diff --git a/src/sizeSide/siding.js b/src/sizeSide/siding.js index 1d5b416..8592518 100644 --- a/src/sizeSide/siding.js +++ b/src/sizeSide/siding.js @@ -176,8 +176,8 @@ class Sides extends DirectionUnitDependentAttribute { /** * sets the amount-value for the left side. - * @param {number} amount siding for left - * @returns {Siding} this Siding Object + * @param {number} amount Sides for left + * @returns {Sides} this Sides Object */ left(amount) { return this.setByIndex(1, amount); @@ -185,8 +185,8 @@ class Sides extends DirectionUnitDependentAttribute { /** * sets the amount-value for the right side. - * @param {number} amount siding for right - * @returns {Siding} this Siding Object + * @param {number} amount Sides for right + * @returns {Sides} this Sides Object */ right(amount) { return this.setByIndex(3, amount); @@ -194,8 +194,8 @@ class Sides extends DirectionUnitDependentAttribute { /** * sets the amount-value for the top side. - * @param {number} amount siding for top - * @returns {Siding} this Siding Object + * @param {number} amount Sides for top + * @returns {Sides} this Sides Object */ top(amount) { return this.setByIndex(2, amount); @@ -203,8 +203,8 @@ class Sides extends DirectionUnitDependentAttribute { /** * sets the amount-value for the bottom side. - * @param {number} amount siding for bottom - * @returns {Siding} this Siding Object + * @param {number} amount Sides for bottom + * @returns {Sides} this Sides Object */ bottom(amount) { return this.setByIndex(4, amount); @@ -213,8 +213,8 @@ class Sides extends DirectionUnitDependentAttribute { /** * sets the amount-value for the horizontal sides (left and right). - * @param {number} amount siding for left and right. - * @returns {Sides} this Siding Object + * @param {number} amount Sides for left and right. + * @returns {Sides} this Sides Object */ horizontal(amount) { return this.left(amount).right(amount); @@ -222,8 +222,8 @@ class Sides extends DirectionUnitDependentAttribute { /** * sets the amount-value for the vertical sides (left and right). - * @param {number} amount siding for top and bottom. - * @returns {Sides} this Siding Object + * @param {number} amount Sides for top and bottom. + * @returns {Sides} this Sides Object */ vertical(amount) { return this.top(amount).bottom(amount); @@ -259,12 +259,23 @@ class Sides extends DirectionUnitDependentAttribute { * @extends Sides */ class PaddingChain extends Sides { + /** + * @type {Modifier} + */ _modifier; + /** + * + * @param {Modifier} modifier + */ constructor(modifier) { super(); this._modifier = modifier; } + /** + * + * @returns {Modifier} + */ toModifier() { return this._modifier .padding(this);