Browse Source

DOC: Added or modified some doc

Mainly to increase accessibility during usage of code (through e.g. vscode)
master
chris 2 months ago
parent
commit
eae24e4bd5
  1. 7
      src/baseComponents.js
  2. 4
      src/component.js
  3. 1
      src/componentAncestry/addStyleAndFunctions.js
  4. 1
      src/componentAncestry/modifiableComponent.js
  5. 1
      src/componentAncestry/wrapperComponent.js
  6. 14
      src/context.js
  7. 11
      src/modifier.js
  8. 15
      src/sizeSide/border.js
  9. 21
      src/sizeSide/dimensions.js
  10. 19
      src/sizeSide/shapes.js
  11. 11
      src/sizeSide/siding.js

7
src/baseComponents.js

@ -6,7 +6,7 @@
/** /**
* Represents a Component (of an HTMLElement) that is capable of receiving input. * Represents a Component (of an HTMLElement) that is capable of receiving input.
* * @extends Component
* @inheritdoc * @inheritdoc
*/ */
class InputComponent extends Component { class InputComponent extends Component {
@ -41,7 +41,7 @@ class InputComponent extends Component {
/** /**
* Represents container Components. * Represents container Components.
* Some predefined modifications are applied on the child components. * Some predefined modifications are applied on the child components.
* * @extends Component
* @inheritdoc * @inheritdoc
*/ */
class FlexContainerComponent extends Component { class FlexContainerComponent extends Component {
@ -95,7 +95,7 @@ class FlexContainerComponent extends Component {
/** /**
* A FlexContainerComponent, which organizes the children in a column like manner. * A FlexContainerComponent, which organizes the children in a column like manner.
* * @extends FlexContainerComponent
* @inheritdoc * @inheritdoc
*/ */
class Column extends FlexContainerComponent { class Column extends FlexContainerComponent {
@ -130,6 +130,7 @@ class Column extends FlexContainerComponent {
/** /**
* A FlexContainerComponent, which organizes the children in a row like manner. * A FlexContainerComponent, which organizes the children in a row like manner.
* *
* @extends FlexContainerComponent
* @inheritdoc * @inheritdoc
*/ */
class Row extends FlexContainerComponent { class Row extends FlexContainerComponent {

4
src/component.js

@ -10,7 +10,9 @@
* It is mainly a collection of wrapper methods * It is mainly a collection of wrapper methods
* around the HTMLElement methods to make them chainable. * around the HTMLElement methods to make them chainable.
* It serves as base for further functionallity extensions. * It serves as base for further functionallity extensions.
* @property {Map<string, SStoreDefinition>} _style * @extends StyleAndScriptStoringComponent
* @inheritdoc
*
*/ */
class Component extends StyleAndScriptStoringComponent { class Component extends StyleAndScriptStoringComponent {
/** /**

1
src/componentAncestry/addStyleAndFunctions.js

@ -5,6 +5,7 @@
*/ */
/** /**
* @inheritdoc
* @abstract * @abstract
* @extends ModifiableComponent * @extends ModifiableComponent
*/ */

1
src/componentAncestry/modifiableComponent.js

@ -6,6 +6,7 @@
/** /**
* @inheritdoc
* @extends ChildbearerComponent * @extends ChildbearerComponent
* @abstract * @abstract
*/ */

1
src/componentAncestry/wrapperComponent.js

@ -116,6 +116,7 @@ class ElementWrapper {
/** /**
* @inheritdoc
* @extends ElementWrapper * @extends ElementWrapper
* @abstract * @abstract
*/ */

14
src/context.js

@ -6,11 +6,23 @@
/** /**
* @todo Potentially class implementation could be removed entirely.
* Since it (at the time being) is only working as a singleton anyway.
* Further maybe rename to 'AppBuilder' instead of 'PageBuilder',
* page might later become part of a navigation setup.
*
*
* The class provides overreaching options for building the website. * The class provides overreaching options for building the website.
* @extends ScriptAndStyleContext * @extends ScriptAndStyleContext
*/ */
class PageBuilder extends ScriptAndStyleContext { class PageBuilder extends ScriptAndStyleContext {
/**
* @type {Array<string>}
*/
#autoRegisteredComponents; #autoRegisteredComponents;
/**
* @type {Array<string>}
*/
#registeredComponents; #registeredComponents;
/** /**
* @type {boolean} * @type {boolean}
@ -31,7 +43,7 @@ class PageBuilder extends ScriptAndStyleContext {
/** /**
* *
* @param {*|Array<*>} groups * @param {*|Array<*>} groups
* @param {*} component * @param {Component} component
*/ */
subscribeComponentToGroup(groups, component) { subscribeComponentToGroup(groups, component) {
if (groups instanceof Array && !(groups instanceof String)) { if (groups instanceof Array && !(groups instanceof String)) {

11
src/modifier.js

@ -352,9 +352,20 @@ class Modifier {
} }
/**
* @extends Modifier
* @inheritdoc
*/
class ChainableModifier extends Modifier { class ChainableModifier extends Modifier {
/**
* @type {Component}
*/
_component; _component;
/**
*
* @param {Component} component
*/
constructor(component) { constructor(component) {
super(); super();
this._component = component; this._component = component;

15
src/sizeSide/border.js

@ -52,6 +52,10 @@ const Define = Object.freeze({
color: new BorderDefinition().color color: new BorderDefinition().color
}) })
/**
* @inheritdoc
* @extends Sides
*/
class Border extends Sides { class Border extends Sides {
constructor(width = 0, color = Colors.black, style = LineStyles.solid, defaultUnit = SizeUnits.PIXEL, shape = Shapes.Rectangle) { constructor(width = 0, color = Colors.black, style = LineStyles.solid, defaultUnit = SizeUnits.PIXEL, shape = Shapes.Rectangle) {
super(0, defaultUnit); super(0, defaultUnit);
@ -75,6 +79,7 @@ class Border extends Sides {
* *
* @param {string} key * @param {string} key
* @param {*} value * @param {*} value
* @returns {Border}
*/ */
setOnDirections(key, value) { setOnDirections(key, value) {
let orderedAttributes = this.getOrderedAttributes() let orderedAttributes = this.getOrderedAttributes()
@ -110,6 +115,11 @@ class Border extends Sides {
return this; return this;
} }
/**
*
* @param {Shape} shape
* @returns {Border}
*/
shape(shape) { shape(shape) {
this._shape = shape; this._shape = shape;
return this; return this;
@ -169,7 +179,10 @@ class Border extends Sides {
} }
} }
/**
* @inheritdoc
* @extends Border
*/
class BorderChain extends Border { class BorderChain extends Border {
constructor(modifier){ constructor(modifier){
super(); super();

21
src/sizeSide/dimensions.js

@ -6,8 +6,16 @@
/** /**
* Simple Dimensions container for the height and width in pixels. * Simple Dimensions container for the height and width in pixels.
*
* @inheritdoc
* @extends DirectionUnitDependentAttribute
*/ */
class Dimensions extends DirectionUnitDependentAttribute { class Dimensions extends DirectionUnitDependentAttribute {
/**
*
* @param {number} defaultValue
* @param {SizeUnits} defaultUnit
*/
constructor(defaultValue = 0, defaultUnit = SizeUnits.PIXEL) { constructor(defaultValue = 0, defaultUnit = SizeUnits.PIXEL) {
super(); super();
this._unit = defaultUnit; this._unit = defaultUnit;
@ -81,9 +89,20 @@ class Dimensions extends DirectionUnitDependentAttribute {
} }
} }
/**
* @inheritdoc
* @extends Dimensions
*/
class DimensionsChain extends Dimensions { class DimensionsChain extends Dimensions {
/**
* @type {Modifier|ChainableModifier}
*/
_modifier; _modifier;
/**
*
* @param {Modifier|ChainableModifier} modifier
*/
constructor(modifier) { constructor(modifier) {
super(); super();
this._modifier = modifier; this._modifier = modifier;

19
src/sizeSide/shapes.js

@ -11,7 +11,8 @@
*/ */
/** /**
* * @extends DirectionUnitDependentAttribute
* @inheritdoc
*/ */
class Shape extends DirectionUnitDependentAttribute { class Shape extends DirectionUnitDependentAttribute {
constructor(defaultValue = 0, defaultUnit = SizeUnits.PIXEL) { constructor(defaultValue = 0, defaultUnit = SizeUnits.PIXEL) {
@ -117,6 +118,10 @@ class Shape extends DirectionUnitDependentAttribute {
} }
} }
/**
* @inheritdoc
* @extends Shape
*/
class ShapeChain extends Shape { class ShapeChain extends Shape {
_modifier; _modifier;
constructor(modifier) { constructor(modifier) {
@ -125,17 +130,17 @@ class ShapeChain extends Shape {
} }
/** /**
* *
* @returns {Modifier|ChainableModifier} * @returns {Modifier|ChainableModifier}
*/ */
toModifier() { toModifier() {
return this._modifier return this._modifier
.clip(this); .clip(this);
} }
/** /**
* *
* @returns {Modifier|ChainableModifier} * @returns {Modifier|ChainableModifier}
*/ */
ensureModifier() { ensureModifier() {
return this.toModifier() return this.toModifier()
} }

11
src/sizeSide/siding.js

@ -13,7 +13,7 @@ const SizeUnits = Object.freeze({
}) })
/** /**
* * @abstract
*/ */
class DirectionUnitDependentAttribute { class DirectionUnitDependentAttribute {
_unit; _unit;
@ -159,6 +159,8 @@ const CornerTransitionDirection = Object.freeze({
}); });
/** /**
* @inheritdoc
* @extends DirectionUnitDependentAttribute
* *
*/ */
class Sides extends DirectionUnitDependentAttribute { class Sides extends DirectionUnitDependentAttribute {
@ -253,7 +255,8 @@ class Sides extends DirectionUnitDependentAttribute {
} }
/** /**
* * @inheritdoc
* @extends Sides
*/ */
class PaddingChain extends Sides { class PaddingChain extends Sides {
_modifier; _modifier;
@ -312,6 +315,9 @@ class PaddingChain extends Sides {
} }
} }
/**
*
*/
class TwoDimPoint { class TwoDimPoint {
/** /**
* *
@ -458,6 +464,7 @@ function isPointInArea(point, area, tolerance = 0, usePercentage = false) {
/** /**
* *
* @param {HTMLElement} element * @param {HTMLElement} element
* @returns {Object<SideDirections, number}
*/ */
function getEnclosingBounds(element) { function getEnclosingBounds(element) {
let area = element.getBoundingClientRect(); let area = element.getBoundingClientRect();

Loading…
Cancel
Save