From 1a51451e825b2832c41012daff2dcc0f5ce2ff7a Mon Sep 17 00:00:00 2001 From: chris Date: Mon, 12 May 2025 11:31:42 +0200 Subject: [PATCH] DOC,REFA,LINT: implemented first couple of lint issues --- src/base/extStore.js | 17 ++++++++++++----- src/builder.js | 2 +- src/component/Component.js | 2 +- src/context/context.js | 1 + src/decorators/border.js | 10 ++++++++-- 5 files changed, 23 insertions(+), 9 deletions(-) diff --git a/src/base/extStore.js b/src/base/extStore.js index e598728..6edc109 100644 --- a/src/base/extStore.js +++ b/src/base/extStore.js @@ -62,6 +62,9 @@ function clearFunctionDeclarationText(func) { } /** + * @todo when ExtStorage-feature/logic is reevaluated + * the resolvement of functions (as basically major or main target) + * needs to be overlooked improved and simplified. * * @param {Function} func * @param {string} registrationName @@ -536,10 +539,12 @@ function resolveOverwrite(key, container, overwriteBehaviour) { )].length; switch (overwriteBehaviour) { - case OverwriteBehaviour.REPLACE: + case OverwriteBehaviour.REPLACE: { break; - case OverwriteBehaviour.RENAME_OLD: - nameForOld = `${key}${occurances}`; + + } + case OverwriteBehaviour.RENAME_OLD: { + let nameForOld = `${key}${occurances}`; if (dealAsMap) { container.set(nameForOld, container.get(key)); container.delete(key); @@ -548,8 +553,10 @@ function resolveOverwrite(key, container, overwriteBehaviour) { delete container[key]; } break; - case OverwriteBehaviour.RENAME: - default: + + } + case OverwriteBehaviour.RENAME: + default: key = `${key}${occurances}`; break; } diff --git a/src/builder.js b/src/builder.js index 144ddba..b26a261 100644 --- a/src/builder.js +++ b/src/builder.js @@ -181,7 +181,7 @@ const builder = { input: function (type, attr = {}, modifier = null) { let comp = new InputComponent( document.createElement("input"), - Object.assign({ "type": type }, attr), + Object.assign({ "type": (type || "text") }, attr), modifier ) .addStyleClass(`el-input`); diff --git a/src/component/Component.js b/src/component/Component.js index 56aff20..d78b10e 100644 --- a/src/component/Component.js +++ b/src/component/Component.js @@ -321,7 +321,7 @@ class Component extends StyleAndScriptStoringComponent { let parent = this._parentComponent; this._parentComponent = null; return parent.childContext(this) - .generate(generator, modifier, styleStore, functionStore); + .generate(generator, styleStore, functionStore); } return generator.generate(this, styleStore, functionStore); diff --git a/src/context/context.js b/src/context/context.js index ae83901..986bf98 100644 --- a/src/context/context.js +++ b/src/context/context.js @@ -192,4 +192,5 @@ const CommonCompelGroups = Object.freeze({ DROP_TARGET: "droptarget", }); + const Page = new PageBuilder(); diff --git a/src/decorators/border.js b/src/decorators/border.js index bfe50eb..4716751 100644 --- a/src/decorators/border.js +++ b/src/decorators/border.js @@ -85,11 +85,17 @@ class Border extends Sides { this._fForth = new BorderDefinition(width, color, style); } + /** + * @override + * @param {number} index + * @param {number} value + * @returns {Border} + */ setByIndex(index, value) { if (value instanceof BorderDefinition) { - this.getByIndex(index).join(value) + this.getByIndex(index).join(value); } else { - this.getByIndex(index)._width = value + this.getByIndex(index)._width = value; } return this; }