Browse Source

MINOR,REFA,FEAT: added children and store variables

master
chris 3 days ago
parent
commit
df8ceb0bd8
  1. 28
      src/componentAncestry/addStyleAndFunctions.js
  2. 7
      src/componentAncestry/wrapperComponent.js

28
src/componentAncestry/addStyleAndFunctions.js

@ -14,10 +14,18 @@ class StyleAndScriptStoringComponent extends ModifiableComponent {
* @type {ExtStorage}
*/
_styleClassesExtStore
/**
* @type {boolean}
*/
_isClassESDefault;
/**
* @type {ExtStorage}
*/
_stylesExtStore;
/**
* @type {boolean}
*/
_isStyleESDefault;
/**
* @type {Array<SStoreDefinition>}
*/
@ -26,25 +34,40 @@ class StyleAndScriptStoringComponent extends ModifiableComponent {
* @type {ExtStorage}
*/
_functionsExtStore;
/**
* @type {boolean}
*/
_isFunESDefault;
/**
* @type {Array<SStoreDefinition>}
*/
_functions;
/**
*
* @param {HTMLElement} element
* @param {Map<string,string>} attr
*/
constructor(element, attr = {}) {
super(element, attr);
this._styleClassesExtStore = ExtStoreType.CENTRALIZED_DOC_HEAD
.setOverwriteBehaviour(OverwriteBehaviour.REPLACE);
this._isClassESDefault = true;
this._stylesExtStore = ExtStoreType.INTERNALIZED_WITHIN
.setOverwriteBehaviour(OverwriteBehaviour.REPLACE);
this._isStyleESDefault = true;
this._styles = [];
this._functionsExtStore = ExtStoreType.CENTRALIZED_DOC_HEAD
.setOverwriteBehaviour(OverwriteBehaviour.REPLACE);
this._isFunESDefault = true;
this._functions = [];
}
@ -55,7 +78,7 @@ class StyleAndScriptStoringComponent extends ModifiableComponent {
* @todo: Differentiate between directions (horizontal, vertiacl)
* @override
* @inheritdoc
* Sets the alignment (modifications) for this element or more specific for its children.
* Sets the alignment (modifications) for this element.
* @param {Alignment} alignment
* @returns {Component} this component object
*/
@ -80,6 +103,7 @@ class StyleAndScriptStoringComponent extends ModifiableComponent {
* @override
* @inheritdoc
* Sets the arrangement (modifications) for this element or more specific for its children.
* Therefore it defines the space distribution to the children.
* @param {Arrangement} arrangement
* @returns {Component} this component object
*/
@ -110,6 +134,7 @@ class StyleAndScriptStoringComponent extends ModifiableComponent {
} else {
this._stylesExtStore.OverwriteBehaviour(extStore);
}
this._isStyleESDefault = false;
} else {
console.log("(Style)ExtStore was empty, did nothing");
}
@ -133,6 +158,7 @@ class StyleAndScriptStoringComponent extends ModifiableComponent {
} else {
this._stylesExtStore.OverwriteBehaviour(extStore);
}
this._isFunESDefault = false;
} else {
console.log("(Function)ExtStore was empty, did nothing");
}

7
src/componentAncestry/wrapperComponent.js

@ -58,6 +58,7 @@ class ElementWrapper {
/**
* (Wrapper) Sets the innerText of the element
* @todo add Alignment of text functionality
* @param {string} text
* @returns {Component} this component object
*/
@ -193,7 +194,11 @@ class ChildbearerComponent extends ElementWrapper {
this.childContext(component[i]);
}
} else {
this._children.push(component);
if (!(component instanceof Component)) {
this.childContext(component.toComponent())
} else {
this._children.push(component);
}
}
return this;
}

Loading…
Cancel
Save