Browse Source

DOC: Added or modified some doc

Mainly to increase accessibility during usage of code (through e.g. vscode)
master
chris 1 month 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.
*
* @extends Component
* @inheritdoc
*/
class InputComponent extends Component {
@ -41,7 +41,7 @@ class InputComponent extends Component {
/**
* Represents container Components.
* Some predefined modifications are applied on the child components.
*
* @extends Component
* @inheritdoc
*/
class FlexContainerComponent extends Component {
@ -95,7 +95,7 @@ class FlexContainerComponent extends Component {
/**
* A FlexContainerComponent, which organizes the children in a column like manner.
*
* @extends FlexContainerComponent
* @inheritdoc
*/
class Column extends FlexContainerComponent {
@ -130,6 +130,7 @@ class Column extends FlexContainerComponent {
/**
* A FlexContainerComponent, which organizes the children in a row like manner.
*
* @extends FlexContainerComponent
* @inheritdoc
*/
class Row extends FlexContainerComponent {

4
src/component.js

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

1
src/componentAncestry/addStyleAndFunctions.js

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

1
src/componentAncestry/modifiableComponent.js

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

1
src/componentAncestry/wrapperComponent.js

@ -116,6 +116,7 @@ class ElementWrapper {
/**
* @inheritdoc
* @extends ElementWrapper
* @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.
* @extends ScriptAndStyleContext
*/
class PageBuilder extends ScriptAndStyleContext {
/**
* @type {Array<string>}
*/
#autoRegisteredComponents;
/**
* @type {Array<string>}
*/
#registeredComponents;
/**
* @type {boolean}
@ -31,7 +43,7 @@ class PageBuilder extends ScriptAndStyleContext {
/**
*
* @param {*|Array<*>} groups
* @param {*} component
* @param {Component} component
*/
subscribeComponentToGroup(groups, component) {
if (groups instanceof Array && !(groups instanceof String)) {

11
src/modifier.js

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

15
src/sizeSide/border.js

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

21
src/sizeSide/dimensions.js

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

19
src/sizeSide/shapes.js

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

11
src/sizeSide/siding.js

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

Loading…
Cancel
Save