From 2cea82d4aced6a1a2361c0a64bc4517472f7afee Mon Sep 17 00:00:00 2001 From: Volker Schukai <volker.schukai@schukai.com> Date: Fri, 11 Oct 2024 13:32:57 +0200 Subject: [PATCH] doc: fix doc tags --- development/issues/open/251.html | 36 ++++++ development/issues/open/251.mjs | 15 +++ example/components/form/select.mjs | 25 ----- example/data/pathfinder-1.mjs | 23 ---- example/data/pathfinder-2.mjs | 19 ---- example/data/pipe.mjs | 14 --- example/data/transformer.mjs | 9 -- source/components/content/copy.mjs | 2 +- source/components/datatable/change-button.mjs | 2 +- source/components/datatable/columnbar.mjs | 2 +- source/components/datatable/dataset.mjs | 6 +- source/components/datatable/datasource.mjs | 6 +- .../components/datatable/datasource/dom.mjs | 4 +- .../components/datatable/datasource/rest.mjs | 14 +-- source/components/datatable/datatable.mjs | 18 +-- .../components/datatable/datatable/header.mjs | 22 ++-- .../datatable/embedded-pagination.mjs | 4 +- source/components/datatable/filter-button.mjs | 2 +- source/components/datatable/filter.mjs | 22 ++-- .../datatable/filter/date-range.mjs | 10 +- source/components/datatable/filter/input.mjs | 4 +- source/components/datatable/filter/range.mjs | 6 +- .../components/datatable/filter/settings.mjs | 10 +- source/components/datatable/filter/util.mjs | 6 +- source/components/datatable/pagination.mjs | 6 +- source/components/datatable/save-button.mjs | 2 +- source/components/datatable/status.mjs | 2 +- source/components/form/action-button.mjs | 2 +- source/components/form/api-button.mjs | 2 +- source/components/form/button-bar.mjs | 4 +- source/components/form/confirm-button.mjs | 8 +- source/components/form/context-error.mjs | 8 +- source/components/form/context-help.mjs | 2 +- source/components/form/field-set.mjs | 2 +- source/components/form/form.mjs | 6 +- .../components/form/message-state-button.mjs | 12 +- source/components/form/popper-button.mjs | 2 +- source/components/form/reload.mjs | 2 +- source/components/form/select.mjs | 21 ++-- source/components/form/shadow-reload.mjs | 2 +- source/components/form/state-button.mjs | 2 +- source/components/form/template.mjs | 2 +- source/components/form/toggle-switch.mjs | 2 +- source/components/form/tree-select.mjs | 2 +- source/components/form/util/floating-ui.mjs | 2 +- source/components/host/call-button.mjs | 2 +- source/components/host/config-manager.mjs | 12 +- source/components/host/host.mjs | 16 +-- source/components/host/overlay.mjs | 10 +- source/components/host/toggle-button.mjs | 2 +- source/components/host/util.mjs | 2 +- source/components/host/viewer.mjs | 10 +- source/components/layout/collapse.mjs | 24 ++-- source/components/layout/details.mjs | 10 +- source/components/layout/iframe.mjs | 4 +- source/components/layout/panel.mjs | 6 +- source/components/layout/popper.mjs | 2 +- source/components/layout/slider.mjs | 12 +- source/components/layout/split-panel.mjs | 4 +- source/components/layout/tabs.mjs | 5 +- source/components/layout/width-toggle.mjs | 8 +- .../navigation/table-of-content.mjs | 6 +- source/components/state/log.mjs | 6 +- source/components/state/log/entry.mjs | 12 +- source/components/state/state.mjs | 2 +- source/components/tree-menu/tree-menu.mjs | 2 +- source/constraints/abstract.mjs | 4 +- source/constraints/abstractoperator.mjs | 2 +- source/constraints/andoperator.mjs | 4 +- source/constraints/invalid.mjs | 4 +- source/constraints/isarray.mjs | 4 +- source/constraints/isobject.mjs | 4 +- source/constraints/oroperator.mjs | 4 +- source/constraints/valid.mjs | 4 +- source/data/datasource.mjs | 9 +- source/data/datasource/dom.mjs | 2 +- source/data/datasource/server.mjs | 10 +- source/data/datasource/server/restapi.mjs | 4 +- .../server/restapi/data-fetch-error.mjs | 2 +- .../datasource/server/restapi/writeerror.mjs | 2 +- source/data/datasource/server/webconnect.mjs | 8 +- source/data/datasource/storage.mjs | 2 +- .../data/datasource/storage/localstorage.mjs | 2 +- .../datasource/storage/sessionstorage.mjs | 2 +- source/data/pathfinder.mjs | 19 ++-- source/data/pipe.mjs | 9 +- source/data/transformer.mjs | 34 ++++-- source/dom/assembler.mjs | 4 +- source/dom/attributes.mjs | 4 +- source/dom/customcontrol.mjs | 2 +- source/dom/customelement.mjs | 103 ++++++------------ source/dom/dimension.mjs | 6 +- source/dom/focusmanager.mjs | 2 +- source/dom/locale.mjs | 2 +- source/dom/resource/data.mjs | 2 +- source/dom/resource/link.mjs | 2 +- source/dom/resource/link/stylesheet.mjs | 2 +- source/dom/resource/script.mjs | 2 +- source/dom/template.mjs | 4 +- source/dom/theme.mjs | 4 +- source/dom/updater.mjs | 2 +- source/dom/util.mjs | 18 +-- source/dom/util/extract-keys.mjs | 2 +- .../dom/util/init-options-from-attributes.mjs | 2 +- source/dom/util/set-option-from-attribute.mjs | 2 +- source/i18n/formatter.mjs | 2 +- source/i18n/locale.mjs | 4 +- source/i18n/provider.mjs | 2 +- source/i18n/providers/embed.mjs | 2 +- source/i18n/translations.mjs | 4 +- source/logging/handler.mjs | 22 ++-- source/logging/handler/console.mjs | 2 +- source/logging/logentry.mjs | 4 +- source/logging/logger.mjs | 22 ++-- source/math/random.mjs | 4 +- source/net/webconnect.mjs | 20 ++-- source/net/webconnect/message.mjs | 6 +- source/text/bracketed-key-value-hash.mjs | 4 +- .../generate-range-comparison-expression.mjs | 2 +- source/types/base.mjs | 8 +- source/types/dataurl.mjs | 14 +-- source/types/global.mjs | 4 +- source/types/internal.mjs | 6 +- source/types/is.mjs | 20 ++-- source/types/mediatype.mjs | 2 +- source/types/node.mjs | 2 +- source/types/nodelist.mjs | 14 +-- source/types/observablequeue.mjs | 14 +-- source/types/observer.mjs | 12 +- source/types/proxyobserver.mjs | 16 +-- source/types/queue.mjs | 6 +- source/types/stack.mjs | 6 +- source/types/tokenlist.mjs | 24 ++-- source/types/uniquequeue.mjs | 4 +- source/types/version.mjs | 8 +- source/util/clone.mjs | 4 +- source/util/freeze.mjs | 2 +- source/util/runtime.mjs | 2 +- 138 files changed, 520 insertions(+), 579 deletions(-) create mode 100644 development/issues/open/251.html create mode 100644 development/issues/open/251.mjs delete mode 100644 example/components/form/select.mjs delete mode 100644 example/data/pathfinder-1.mjs delete mode 100644 example/data/pathfinder-2.mjs delete mode 100644 example/data/pipe.mjs delete mode 100644 example/data/transformer.mjs diff --git a/development/issues/open/251.html b/development/issues/open/251.html new file mode 100644 index 000000000..3ea6869b7 --- /dev/null +++ b/development/issues/open/251.html @@ -0,0 +1,36 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="UTF-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <title>investigate the reloading of select #251</title> + <script src="./251.mjs" type="module"></script> +</head> +<body> + <h1>investigate the reloading of select #251</h1> + <p>there are problems with filtering remote url options</p> + <ul> + <li><a href="https://gitlab.schukai.com/oss/libraries/javascript/monster/-/issues/251">Issue #251</a></li> + <li><a href="/">Back to overview</a></li> + </ul> + <main> + + <script type="application/json" data-monster-role="translations"> + { + "51": "xyz", + "52": "abc", + "53": "def" + } + </script> + + + <monster-select + data-monster-option-features-lazyload="true" + data-monster-option-mapping-labeltemplate="${name} (${value})" + data-monster-option-mapping-valuetemplate="${id}" + data-monster-option-url="/issue-223.json" > + </monster-select> + + </main> +</body> +</html> diff --git a/development/issues/open/251.mjs b/development/issues/open/251.mjs new file mode 100644 index 000000000..0a8dd96c9 --- /dev/null +++ b/development/issues/open/251.mjs @@ -0,0 +1,15 @@ +/** +* @file development/issues/open/251.mjs +* @url https://gitlab.schukai.com/oss/libraries/javascript/monster/-/issues/251 +* @description investigate the reloading of select +* @issue 251 +*/ + +import "../../../source/components/style/property.pcss"; +import "../../../source/components/style/link.pcss"; +import "../../../source/components/style/color.pcss"; +import "../../../source/components/style/theme.pcss"; +import "../../../source/components/style/normalize.pcss"; +import "../../../source/components/style/typography.pcss"; +import "../../../source/components/form/select.mjs"; + diff --git a/example/components/form/select.mjs b/example/components/form/select.mjs deleted file mode 100644 index 04bae4dc9..000000000 --- a/example/components/form/select.mjs +++ /dev/null @@ -1,25 +0,0 @@ -import '@schukai/component-form/source/select.js'; - -const select = document.createElement('monster-select'); -select.setOption('mapping.labelTemplate', '${name} (${alpha-2})') -select.setOption('mapping.valueTemplate', '${country-code}') -select.importOptions([ - { - "name": "United Kingdom", - "alpha-2": "GB", - "country-code": "826", - }, - { - "name": "Sweden", - "alpha-2": "SE", - "country-code": "752", - - }, - { - "name": "Germany", - "alpha-2": "DE", - "country-code": "276", - } -]); - -document.body.appendChild(select); \ No newline at end of file diff --git a/example/data/pathfinder-1.mjs b/example/data/pathfinder-1.mjs deleted file mode 100644 index f6cfe5e15..000000000 --- a/example/data/pathfinder-1.mjs +++ /dev/null @@ -1,23 +0,0 @@ -import {Pathfinder} from '@schukai/monster/source/data/pathfinder.mjs'; - -let value = new Pathfinder({ - a: { - b: { - f: [ - { - g: false, - } - ], - } - } -}).getVia("a.b.f.0.g"); - -console.log(value); -// ↦ false - -try { - new Pathfinder({}).getVia("a.b.f.0.g"); -} catch (e) { - console.log(e.toString()); - // ↦ Error: the journey is not at its end (b.f.0.g) -} \ No newline at end of file diff --git a/example/data/pathfinder-2.mjs b/example/data/pathfinder-2.mjs deleted file mode 100644 index b90b3ac18..000000000 --- a/example/data/pathfinder-2.mjs +++ /dev/null @@ -1,19 +0,0 @@ -import {Pathfinder} from '@schukai/monster/source/data/pathfinder.mjs'; - -let p = new Pathfinder({ - a: { - x: [ - {c: 1}, {c: 2} - ], - y: true - }, - b: { - x: [ - {c: 1, d: false}, {c: 2} - ], - y: true - }, -}); - -let r = p.getVia("*.x.*.c"); -console.log(r); diff --git a/example/data/pipe.mjs b/example/data/pipe.mjs deleted file mode 100644 index 6628a7cb0..000000000 --- a/example/data/pipe.mjs +++ /dev/null @@ -1,14 +0,0 @@ -import {Pipe} from '@schukai/monster/source/data/pipe.mjs'; - -let obj = { - a: { - b: { - c: { - d: "world" - } - } - } -} - -console.log(new Pipe('path:a.b.c.d | toupper | prefix:Hello\\ ').run(obj)); -// ↦ Hello WORLD diff --git a/example/data/transformer.mjs b/example/data/transformer.mjs deleted file mode 100644 index 74b3c9fdb..000000000 --- a/example/data/transformer.mjs +++ /dev/null @@ -1,9 +0,0 @@ -import {Transformer} from '@schukai/monster/source/data/transformer.mjs'; - -const transformer = new Transformer("tolower") - -console.log(transformer.run("HELLO")) -// ↦ hello - -console.log(transformer.run("WORLD")) -// ↦ world \ No newline at end of file diff --git a/source/components/content/copy.mjs b/source/components/content/copy.mjs index 104ab94a9..71114f1d1 100644 --- a/source/components/content/copy.mjs +++ b/source/components/content/copy.mjs @@ -85,7 +85,7 @@ const resizeObserverSymbol = Symbol("resizeObserver"); class Copy extends CustomElement { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/monster/components/content/copy@@instance"); diff --git a/source/components/datatable/change-button.mjs b/source/components/datatable/change-button.mjs index 6a6b1ec6c..ea890434f 100644 --- a/source/components/datatable/change-button.mjs +++ b/source/components/datatable/change-button.mjs @@ -88,7 +88,7 @@ const overlayLinkedElementSymbol = Symbol("overlayLinkedElement"); class ChangeButton extends CustomElement { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for( diff --git a/source/components/datatable/columnbar.mjs b/source/components/datatable/columnbar.mjs index b2d76e467..34753cd38 100644 --- a/source/components/datatable/columnbar.mjs +++ b/source/components/datatable/columnbar.mjs @@ -96,7 +96,7 @@ const popperInstanceSymbol = Symbol("popperInstance"); class ColumnBar extends CustomElement { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/monster/components/column-bar"); diff --git a/source/components/datatable/dataset.mjs b/source/components/datatable/dataset.mjs index 24e920e71..b6a4cb1f4 100644 --- a/source/components/datatable/dataset.mjs +++ b/source/components/datatable/dataset.mjs @@ -81,7 +81,7 @@ export { DataSet }; class DataSet extends CustomElement { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/monster/components/dataset@@instance"); @@ -163,7 +163,7 @@ class DataSet extends CustomElement { /** * This method is called when the component is created. * @since 3.70.0 - * @returns {DataSet} + * @return {DataSet} */ refresh() { // makes sure that handleDataSourceChanges is called @@ -173,7 +173,7 @@ class DataSet extends CustomElement { /** * - * @returns {Promise<unknown>} + * @return {Promise<unknown>} */ write() { return new Promise((resolve, reject) => { diff --git a/source/components/datatable/datasource.mjs b/source/components/datatable/datasource.mjs index fa5caf146..728cbbde7 100644 --- a/source/components/datatable/datasource.mjs +++ b/source/components/datatable/datasource.mjs @@ -58,7 +58,7 @@ class Datasource extends CustomElement { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/monster/components/datasource@@instance"); @@ -87,7 +87,7 @@ class Datasource extends CustomElement { /** * Get the data, without proxy - * @returns {Object} + * @return {Object} */ get data() { return this[dataSourceSymbol].get(); @@ -103,7 +103,7 @@ class Datasource extends CustomElement { /** * Get the datasource - * @returns {Monster.Data.Datasource} + * @return {Monster.Data.Datasource} */ get datasource() { return this[dataSourceSymbol]; diff --git a/source/components/datatable/datasource/dom.mjs b/source/components/datatable/datasource/dom.mjs index 415ea9738..08301e3c1 100644 --- a/source/components/datatable/datasource/dom.mjs +++ b/source/components/datatable/datasource/dom.mjs @@ -52,7 +52,7 @@ const dataChangeEventHandlerSymbol = Symbol("dataChangeEventHandler"); class Dom extends Datasource { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/monster/components/datasource/dom@@instance"); @@ -107,7 +107,7 @@ class Dom extends Datasource { /** * Reloads the data - * @returns {Promise<never>|*} + * @return {Promise<never>|*} */ reload() {} diff --git a/source/components/datatable/datasource/rest.mjs b/source/components/datatable/datasource/rest.mjs index 0fd509a90..3dbfc58a5 100644 --- a/source/components/datatable/datasource/rest.mjs +++ b/source/components/datatable/datasource/rest.mjs @@ -93,7 +93,7 @@ class Rest extends Datasource { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/monster/components/datasource/rest@@instance"); @@ -176,7 +176,7 @@ class Rest extends Datasource { * @param {string} page * @param {string} query * @param {string} orderBy - * @returns {Monster.Components.Datatable.Datasource.Rest} + * @return {Monster.Components.Datatable.Datasource.Rest} */ setParameters({ page, query, orderBy }) { const parameters = this.getOption("read.parameters"); @@ -204,7 +204,7 @@ class Rest extends Datasource { /** * @deprecated 2023-06-25 - * @returns {Promise<never>|*} + * @return {Promise<never>|*} */ reload() { return this.fetch(); @@ -212,7 +212,7 @@ class Rest extends Datasource { /** * Fetches the data from the rest api - * @returns {Promise<never>|*} + * @return {Promise<never>|*} */ fetch() { const opt = clone(this.getOption("read")); @@ -276,7 +276,7 @@ class Rest extends Datasource { * This method activates the intersection observer manually. * For this purpose, the option `autoInit.intersectionObserver` must be set to `false`. * - * @returns {Monster.Components.Datatable.Datasource.Rest} + * @return {Monster.Components.Datatable.Datasource.Rest} */ initIntersectionObserver() { initIntersectionObserver.call(this); @@ -305,7 +305,7 @@ class Rest extends Datasource { } /** - * @returns {Promise<never>|*} + * @return {Promise<never>|*} */ read() { return this.fetch(); @@ -313,7 +313,7 @@ class Rest extends Datasource { /** * Fetches the data from the rest api - * @returns {Promise<never>|*} + * @return {Promise<never>|*} */ write() { const opt = clone(this.getOption("write")); diff --git a/source/components/datatable/datatable.mjs b/source/components/datatable/datatable.mjs index 6a1b1fc3e..38d412f09 100644 --- a/source/components/datatable/datatable.mjs +++ b/source/components/datatable/datatable.mjs @@ -146,7 +146,7 @@ const columnBarElementSymbol = Symbol("columnBarElement"); class DataTable extends CustomElement { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/monster/components/datatable@@instance"); @@ -233,7 +233,7 @@ class DataTable extends CustomElement { /** * * @param {string} selector - * @returns {NodeListOf<*>} + * @return {NodeListOf<*>} */ getGridElements(selector) { return this[gridElementSymbol].querySelectorAll(selector); @@ -358,7 +358,7 @@ class DataTable extends CustomElement { * Copy a row from the datatable * @param {number} fromIndex * @param {number} toIndex - * @returns {Monster.Components.Datatable.DataTable} + * @return {Monster.Components.Datatable.DataTable} * @fires monster-datatable-row-copied */ copyRow(fromIndex, toIndex) { @@ -412,7 +412,7 @@ class DataTable extends CustomElement { /** * Remove a row from the datatable * @param index - * @returns {Monster.Components.Datatable.DataTable} + * @return {Monster.Components.Datatable.DataTable} * @fires monster-datatable-row-removed */ removeRow(index) { @@ -458,7 +458,7 @@ class DataTable extends CustomElement { /** * Add a row to the datatable * @param {Object} data - * @returns {Monster.Components.Datatable.DataTable} + * @return {Monster.Components.Datatable.DataTable} * @fires monster-datatable-row-added **/ addRow(data) { @@ -496,7 +496,7 @@ class DataTable extends CustomElement { /** * @private - * @returns {string} + * @return {string} */ function getColumnVisibilityConfigKey() { return generateUniqueConfigKey("datatable", this?.id, "columns-visibility"); @@ -504,7 +504,7 @@ function getColumnVisibilityConfigKey() { /** * @private - * @returns {string} + * @return {string} */ function getFilterConfigKey() { return generateUniqueConfigKey("datatable", this?.id, "filter"); @@ -512,7 +512,7 @@ function getFilterConfigKey() { /** * @private - * @returns {Promise} + * @return {Promise} */ function getHostConfig(callback) { const host = findElementWithSelectorUpwards(this, "monster-host"); @@ -804,7 +804,7 @@ function initGridAndStructs(hostConfig, headerOrderMap) { /** * @private - * @returns {string} + * @return {string} */ export function getStoredOrderConfigKey() { return generateUniqueConfigKey("datatable", this?.id, "stored-order"); diff --git a/source/components/datatable/datatable/header.mjs b/source/components/datatable/datatable/header.mjs index 2848e9894..e66839454 100644 --- a/source/components/datatable/datatable/header.mjs +++ b/source/components/datatable/datatable/header.mjs @@ -82,7 +82,7 @@ class Header extends Base { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/monster/components/datatable/header@@instance"); @@ -90,7 +90,7 @@ class Header extends Base { /** * - * @returns {object} + * @return {object} */ get internalDefaults() { return { @@ -174,14 +174,14 @@ class Header extends Base { } /** - * @returns {string} + * @return {string} */ get labelKey() { return this.getInternal("labelKey"); } /** - * @returns {string} + * @return {string} */ get html() { return this.getInternal("html"); @@ -192,42 +192,42 @@ class Header extends Base { } /** - * @returns {string} + * @return {string} */ get field() { return this.getInternal("field"); } /** - * @returns {string} + * @return {string} */ get index() { return this.getInternal("index"); } /** - * @returns {string} + * @return {string} */ get classes() { return this.getInternal("classes"); } /** - * @returns {string} + * @return {string} */ get label() { return this.getInternal("label"); } /** - * @returns {string} + * @return {string} */ get direction() { return this.getInternal("direction"); } /** - * @returns {string} + * @return {string} */ get mode() { return this.getInternal("mode"); @@ -237,7 +237,7 @@ class Header extends Base { /** * @private * @param {Array<Header>} headers - * @returns {string} + * @return {string} */ function createOrderStatement(headers) { validateIterable(headers); diff --git a/source/components/datatable/embedded-pagination.mjs b/source/components/datatable/embedded-pagination.mjs index 8c2f28b37..039ee0fd5 100644 --- a/source/components/datatable/embedded-pagination.mjs +++ b/source/components/datatable/embedded-pagination.mjs @@ -62,7 +62,7 @@ export { EmbeddedPagination }; class EmbeddedPagination extends Pagination { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/monster/components/embedded-pagination"); @@ -93,7 +93,7 @@ class EmbeddedPagination extends Pagination { /** * @private - * @returns {CSSStyleSheet} + * @return {CSSStyleSheet} */ static getControlCSSStyleSheet() { return EmbeddedPaginationStyleSheet; diff --git a/source/components/datatable/filter-button.mjs b/source/components/datatable/filter-button.mjs index b11111276..f86991123 100644 --- a/source/components/datatable/filter-button.mjs +++ b/source/components/datatable/filter-button.mjs @@ -63,7 +63,7 @@ export { FilterButton }; class FilterButton extends ToggleButton { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/monster/components/filter-button@@instance"); diff --git a/source/components/datatable/filter.mjs b/source/components/datatable/filter.mjs index 737035d0f..7cf4d893f 100644 --- a/source/components/datatable/filter.mjs +++ b/source/components/datatable/filter.mjs @@ -162,7 +162,7 @@ class Filter extends CustomElement { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/monster/components/filter@@instance"); @@ -171,7 +171,7 @@ class Filter extends CustomElement { /** * * @param {string} message - * @returns {Monster.Components.Datatable.Filter} + * @return {Monster.Components.Datatable.Filter} */ showFailureMessage(message) { this[searchButtonElementSymbol].setState( @@ -186,7 +186,7 @@ class Filter extends CustomElement { /** * - * @returns {Monster.Components.Datatable.Filter} + * @return {Monster.Components.Datatable.Filter} */ resetFailureMessage() { this[searchButtonElementSymbol].hideMessage(); @@ -196,7 +196,7 @@ class Filter extends CustomElement { /** * - * @returns {Monster.Components.Datatable.Filter} + * @return {Monster.Components.Datatable.Filter} */ showSuccess() { this[searchButtonElementSymbol].setState( @@ -458,7 +458,7 @@ function initFilter() { /** * * @param {string} input - * @returns {*} + * @return {*} */ function escapeAttributeValue(input) { if (input === undefined || input === null) { @@ -476,7 +476,7 @@ function escapeAttributeValue(input) { /** * * @param {HTMLElement} element - * @returns {boolean} + * @return {boolean} */ function getVisibilityFromSlotAttribute(element) { return !( @@ -832,7 +832,7 @@ function updateFilterTabs() { /** * @private * @param showEffect - * @returns {Promise<*>} + * @return {Promise<*>} */ function doSearch({ showEffect } = { showEffect: true }) { this.resetFailureMessage(); @@ -909,7 +909,7 @@ function doSearch({ showEffect } = { showEffect: true }) { /** * @private * @param queries - * @returns {*|string} + * @return {*|string} */ function buildSearchQuery(queries) { if (!isArray(queries) || queries.length === 0) { @@ -931,7 +931,7 @@ function buildSearchQuery(queries) { /** * @private - * @returns {Promise<unknown>} + * @return {Promise<unknown>} */ function collectSearchQueries() { const currentHash = parseBracketedKeyValueHash(getGlobal().location.hash); @@ -1041,7 +1041,7 @@ function collectSearchQueries() { /** * @private * @param label - * @returns {null|Array|undefined|string} + * @return {null|Array|undefined|string} */ function getControlValuesFromLabel(label) { const foundControl = label.firstElementChild; @@ -1080,7 +1080,7 @@ function getControlValuesFromLabel(label) { /** * @private - * @returns {Promise<unknown>} + * @return {Promise<unknown>} */ function initFromConfig() { const host = findElementWithSelectorUpwards(this, "monster-host"); diff --git a/source/components/datatable/filter/date-range.mjs b/source/components/datatable/filter/date-range.mjs index f142c44ad..ec293bf44 100644 --- a/source/components/datatable/filter/date-range.mjs +++ b/source/components/datatable/filter/date-range.mjs @@ -149,7 +149,7 @@ class DateRange extends AbstractBase { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for( @@ -178,7 +178,7 @@ class DateRange extends AbstractBase { } /** - * @returns {*} + * @return {*} */ get value() { return this[inputElementSymbol].value; @@ -190,7 +190,7 @@ class DateRange extends AbstractBase { * * The individual configuration values can be found in the table. * - * @returns {Object} + * @return {Object} * * @property {Object} templates * @property {string} templates.main @@ -627,7 +627,7 @@ function clearAndDisableFormGroups() { /** * @private - * @returns {string} + * @return {string} */ function guessRangeTypeFromCurrentValue() { const value = this[inputElementSymbol].value.trim(); @@ -686,7 +686,7 @@ function getRangeTypeFromForm() { * * @param {string} date * @param {string} unit (day, month, year, week) - * @returns {number} range + * @return {number} range */ function calculateDateRangeFromToday(date, unit) { // calculate the date of today -1 diff --git a/source/components/datatable/filter/input.mjs b/source/components/datatable/filter/input.mjs index 32aaaf6dc..a4314d4bb 100644 --- a/source/components/datatable/filter/input.mjs +++ b/source/components/datatable/filter/input.mjs @@ -75,7 +75,7 @@ const inputElementSymbol = Symbol("inputElement"); class Input extends AbstractBase { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/monster/components/filter/input@@instance"); @@ -139,7 +139,7 @@ class Input extends AbstractBase { } /** - * @returns {*} + * @return {*} */ get value() { return this[inputElementSymbol].value; diff --git a/source/components/datatable/filter/range.mjs b/source/components/datatable/filter/range.mjs index c08daa92a..0882bef6d 100644 --- a/source/components/datatable/filter/range.mjs +++ b/source/components/datatable/filter/range.mjs @@ -121,7 +121,7 @@ const arrowElementSymbol = Symbol("arrowElement"); class Range extends AbstractBase { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/monster/components/filter/range@@instance"); @@ -148,7 +148,7 @@ class Range extends AbstractBase { } /** - * @returns {*} + * @return {*} */ get value() { return this[inputElementSymbol].value; @@ -160,7 +160,7 @@ class Range extends AbstractBase { * * The individual configuration values can be found in the table. * - * @returns {Object} + * @return {Object} * * @property {Object} templates * @property {string} templates.main diff --git a/source/components/datatable/filter/settings.mjs b/source/components/datatable/filter/settings.mjs index 270154189..333a71b4a 100644 --- a/source/components/datatable/filter/settings.mjs +++ b/source/components/datatable/filter/settings.mjs @@ -43,7 +43,7 @@ class Settings extends Base { /** * * @param value - * @returns {*} + * @return {*} */ get(value) { return this.getInternal("option." + value); @@ -55,7 +55,7 @@ class Settings extends Base { * @param value * @param label * @param visible - * @returns {Settings} + * @return {Settings} */ set({ value, label, visible = true }) { let d = this.getInternal("option." + value); @@ -81,7 +81,7 @@ class Settings extends Base { /** * - * @returns {Array} + * @return {Array} */ getOptions() { const option = this.getInternal("option"); @@ -101,7 +101,7 @@ class Settings extends Base { /** * * @param options - * @returns {Settings} + * @return {Settings} */ setOptions(options) { for (const key in options) { @@ -112,7 +112,7 @@ class Settings extends Base { /** * - * @returns {Array} + * @return {Array} */ getSelected() { const option = this.getInternal("option"); diff --git a/source/components/datatable/filter/util.mjs b/source/components/datatable/filter/util.mjs index 8ba260fe4..27628d0d6 100644 --- a/source/components/datatable/filter/util.mjs +++ b/source/components/datatable/filter/util.mjs @@ -16,7 +16,7 @@ import { generateUniqueConfigKey } from "../../host/util.mjs"; /** * @private - * @returns {string} + * @return {string} */ export function getFilterConfigKey() { return generateUniqueConfigKey("datatable", this?.id, "filter"); @@ -24,7 +24,7 @@ export function getFilterConfigKey() { /** * @private - * @returns {string} + * @return {string} */ export function getStoredFilterConfigKey() { return generateUniqueConfigKey("datatable", this?.id, "stored-filter"); @@ -34,7 +34,7 @@ export function getStoredFilterConfigKey() { * @private * @param {String} str * @param {String} field - * @returns {String} + * @return {String} * @throws {Error} if no field is defined */ export function parseDateInput(str, field) { diff --git a/source/components/datatable/pagination.mjs b/source/components/datatable/pagination.mjs index 93e5ec67c..a74199b87 100644 --- a/source/components/datatable/pagination.mjs +++ b/source/components/datatable/pagination.mjs @@ -93,7 +93,7 @@ class Pagination extends CustomElement { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/monster/components/pagination"); @@ -207,7 +207,7 @@ class Pagination extends CustomElement { /** * @private - * @returns {CSSStyleSheet} + * @return {CSSStyleSheet} */ static getControlCSSStyleSheet() { return PaginationStyleSheet; @@ -356,7 +356,7 @@ function handleDataSourceChanges() { * * @param current * @param max - * @returns {object} + * @return {object} */ function buildPagination(current, max) { let prev = current === 1 ? null : current - 1; diff --git a/source/components/datatable/save-button.mjs b/source/components/datatable/save-button.mjs index d8ea18701..6220fadf3 100644 --- a/source/components/datatable/save-button.mjs +++ b/source/components/datatable/save-button.mjs @@ -61,7 +61,7 @@ const badgeElementSymbol = Symbol("badgeElement"); class SaveButton extends CustomElement { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for( diff --git a/source/components/datatable/status.mjs b/source/components/datatable/status.mjs index 8fe2b4e4e..b14852b9c 100644 --- a/source/components/datatable/status.mjs +++ b/source/components/datatable/status.mjs @@ -86,7 +86,7 @@ class DatasourceStatus extends CustomElement { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for( diff --git a/source/components/form/action-button.mjs b/source/components/form/action-button.mjs index d40efe53a..1834be3eb 100644 --- a/source/components/form/action-button.mjs +++ b/source/components/form/action-button.mjs @@ -88,7 +88,7 @@ const containerElementSymbol = Symbol("containerElement"); class ActionButton extends PopperButton { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for( diff --git a/source/components/form/api-button.mjs b/source/components/form/api-button.mjs index 47b25c7bd..fd43c8df1 100644 --- a/source/components/form/api-button.mjs +++ b/source/components/form/api-button.mjs @@ -101,7 +101,7 @@ const containerElementSymbol = Symbol("containerElement"); class ApiButton extends ActionButton { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/monster/components/form/api-button@@instance"); diff --git a/source/components/form/button-bar.mjs b/source/components/form/button-bar.mjs index a60675d07..ed795280d 100644 --- a/source/components/form/button-bar.mjs +++ b/source/components/form/button-bar.mjs @@ -173,7 +173,7 @@ const ATTRIBUTE_POPPER_POSITION = "data-monster-popper-position"; class ButtonBar extends CustomElement { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/monster/components/form/button-bar@@instance"); @@ -324,7 +324,7 @@ class ButtonBar extends CustomElement { /** * @private * @param obj - * @returns {*} + * @return {*} */ function initDefaultsFromAttributes(obj) { if (this.hasAttribute(ATTRIBUTE_POPPER_POSITION)) { diff --git a/source/components/form/confirm-button.mjs b/source/components/form/confirm-button.mjs index 6d78c8275..fbbcacd4b 100644 --- a/source/components/form/confirm-button.mjs +++ b/source/components/form/confirm-button.mjs @@ -104,7 +104,7 @@ const cancelButtonElementSymbol = Symbol("cancelButtonElement"); class ConfirmButton extends PopperButton { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 2.1.0 */ static get [instanceSymbol]() { @@ -192,7 +192,7 @@ class ConfirmButton extends PopperButton { /** * - * @returns {Monster.Components.Form.PopperButton} + * @return {Monster.Components.Form.PopperButton} */ showDialog() { const confirmButtonClass = this.getOption("classes.confirmButton"); @@ -219,7 +219,7 @@ class ConfirmButton extends PopperButton { * * @param {string} state * @param {number} timeout - * @returns {Monster.Components.Form.ConfirmButton} + * @return {Monster.Components.Form.ConfirmButton} */ setConfirmButtonState(state, timeout) { this[confirmButtonElementSymbol].setState(state, timeout); @@ -231,7 +231,7 @@ class ConfirmButton extends PopperButton { * * @param {string} message * @param {number} timeout - * @returns {Monster.Components.Form.ConfirmButton} + * @return {Monster.Components.Form.ConfirmButton} */ showConfirmButtonMessage(message, timeout) { this[confirmButtonElementSymbol].setMessage(message); diff --git a/source/components/form/context-error.mjs b/source/components/form/context-error.mjs index 7eff7ae61..debd37855 100644 --- a/source/components/form/context-error.mjs +++ b/source/components/form/context-error.mjs @@ -80,7 +80,7 @@ class ContextError extends Popper { /** * This method is called by the `instanceof` operator. * - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for( @@ -157,7 +157,7 @@ class ContextError extends Popper { * * @param message * @param show {boolean|number|string} - If true the dialog is shown immediately. If false the dialog is hidden by default. If a number is specified the dialog is shown for the specified time in milliseconds. - * @returns {ContextError} + * @return {ContextError} */ setErrorMessage(message, show = false) { message = message.trim(); @@ -191,7 +191,7 @@ class ContextError extends Popper { /** * Reset the error message. - * @returns {ContextError} + * @return {ContextError} */ resetErrorMessage() { this.hideDialog(); @@ -202,7 +202,7 @@ class ContextError extends Popper { /** * Returns true if an error message is set. - * @returns {boolean} + * @return {boolean} */ hasErrorMessage() { const c = this.getOption("content"); diff --git a/source/components/form/context-help.mjs b/source/components/form/context-help.mjs index 7d0ea2842..9aea72cb5 100644 --- a/source/components/form/context-help.mjs +++ b/source/components/form/context-help.mjs @@ -34,7 +34,7 @@ export { ContextHelp }; class ContextHelp extends Popper { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for( diff --git a/source/components/form/field-set.mjs b/source/components/form/field-set.mjs index 265c5ee57..dc74e5344 100644 --- a/source/components/form/field-set.mjs +++ b/source/components/form/field-set.mjs @@ -81,7 +81,7 @@ const extendedSwitchElementSymbol = Symbol("extendedSwitchElement"); class FieldSet extends CustomControl { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/monster/components/form/fieldset@@instance"); diff --git a/source/components/form/form.mjs b/source/components/form/form.mjs index 4eff2928e..06e80fa53 100644 --- a/source/components/form/form.mjs +++ b/source/components/form/form.mjs @@ -130,7 +130,7 @@ class Form extends DataSet { /** * This method is called when the component is created. * @since 3.70.0 - * @returns {DataSet} + * @return {DataSet} */ refresh() { this.write(); @@ -142,7 +142,7 @@ class Form extends DataSet { * Run reportValidation on all child html form controls. * * @since 2.10.0 - * @returns {boolean} + * @return {boolean} */ reportValidity() { let valid = true; @@ -166,7 +166,7 @@ function initDataSourceHandler() {} /** * @private - * @returns {initEventHandler} + * @return {initEventHandler} */ function initEventHandler() { this[debounceBindSymbol] = {}; diff --git a/source/components/form/message-state-button.mjs b/source/components/form/message-state-button.mjs index 4e7dc0903..459487789 100644 --- a/source/components/form/message-state-button.mjs +++ b/source/components/form/message-state-button.mjs @@ -87,7 +87,7 @@ const buttonElementSymbol = Symbol("buttonElement"); class MessageStateButton extends Popper { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for( @@ -193,7 +193,7 @@ class MessageStateButton extends Popper { * @param {string|HTMLElement}message * @param {string} title * @param {string} icon - * @returns {Monster.Components.Form.MessageStateButton} + * @return {Monster.Components.Form.MessageStateButton} */ setMessage(message, title, icon) { if (isString(message)) { @@ -243,7 +243,7 @@ class MessageStateButton extends Popper { /** * @param {number} timeout - * @returns {Monster.Components.Form.MessageStateButton} + * @return {Monster.Components.Form.MessageStateButton} */ showMessage(timeout) { super.showDialog(); @@ -259,7 +259,7 @@ class MessageStateButton extends Popper { /** * - * @returns {Monster.Components.Form.MessageStateButton} + * @return {Monster.Components.Form.MessageStateButton} */ hideMessage() { super.hideDialog(); @@ -268,7 +268,7 @@ class MessageStateButton extends Popper { /** * - * @returns {Monster.Components.Form.MessageStateButton} + * @return {Monster.Components.Form.MessageStateButton} */ toggleMessage() { super.toggleDialog(); @@ -277,7 +277,7 @@ class MessageStateButton extends Popper { /** * - * @returns {Object} + * @return {Object} */ getMessage() { return this.getOption("message"); diff --git a/source/components/form/popper-button.mjs b/source/components/form/popper-button.mjs index a9295cc2e..bde743f2f 100644 --- a/source/components/form/popper-button.mjs +++ b/source/components/form/popper-button.mjs @@ -144,7 +144,7 @@ const arrowElementSymbol = Symbol("arrowElement"); class PopperButton extends Popper { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 2.1.0 */ static get [instanceSymbol]() { diff --git a/source/components/form/reload.mjs b/source/components/form/reload.mjs index 8df27679f..d4acf9792 100644 --- a/source/components/form/reload.mjs +++ b/source/components/form/reload.mjs @@ -103,7 +103,7 @@ const intersectionObserverWasInitialized = Symbol("wasInitialized"); class Reload extends CustomElement { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 2.1.0 */ static get [instanceSymbol]() { diff --git a/source/components/form/select.mjs b/source/components/form/select.mjs index dbed3026e..19c8bc82d 100644 --- a/source/components/form/select.mjs +++ b/source/components/form/select.mjs @@ -274,13 +274,12 @@ const FILTER_POSITION_INLINE = "inline"; * * @fragments /fragments/components/form/select/ * - * @example /examples/components/form/select-simple - * @example /examples/components/form/select-with-options + * @example /examples/components/form/select-with-options Select with options + * @example /examples/components/form/select-multiple Multiple selection + * @example /examples/components/form/select-lazy Lazy load * * @copyright schukai GmbH * @summary A beautiful select control that can make your life easier and also looks good. - * @fires monster-options-set - * @fires monster-selected * @fires monster-change * @fires monster-changed */ @@ -295,7 +294,7 @@ class Select extends CustomControl { /** * This method is called by the `instanceof` operator. - * @returns {Symbol} + * @return {Symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/monster/components/form/select@@instance"); @@ -311,7 +310,7 @@ class Select extends CustomControl { * // ↦ ['1','2'] * ``` * - * @returns {string} + * @return {string} */ get value() { return convertSelectionToValue.call(this, this.getOption("selection")); @@ -335,6 +334,7 @@ class Select extends CustomControl { * * @property {string|array} value * @throws {Error} unsupported type + * @fires monster-selected this event is fired when the selection is set */ set value(value) { const result = convertValueToSelection.call(this, value); @@ -555,7 +555,7 @@ class Select extends CustomControl { /** * - * @returns {*} + * @return {*} * @throws {Error} storeFetchedData is not enabled * @since 3.66.0 */ @@ -745,6 +745,7 @@ class Select extends CustomControl { * @return {Select} * @throws {Error} map is not iterable * @throws {Error} missing label configuration + * @fires monster-options-set this event is fired when the options are set */ importOptions(data) { const mappingOptions = this.getOption("mapping", {}); @@ -1168,7 +1169,7 @@ function getDefaultTranslation() { /** * @private - * @returns {string|*} + * @return {string|*} */ function setSummaryAndControlText() { const translations = getDefaultTranslation.call(this); @@ -1493,7 +1494,7 @@ function handleFilterKeyboardEvents(event) { * @name handleFilterKeyEvents * * @private - * @returns {void} This method does not return anything. + * @return {void} This method does not return anything. */ function handleFilterKeyEvents() { if (this[keyFilterEventSymbol] instanceof DeadMansSwitch) { @@ -1629,7 +1630,7 @@ function handleOptionKeyboardEvents(event) { /** * @private - * @returns {string} + * @return {string} */ function getFilterMode() { switch (this.getOption("filter.mode")) { diff --git a/source/components/form/shadow-reload.mjs b/source/components/form/shadow-reload.mjs index ea105cd17..42d4f80f6 100644 --- a/source/components/form/shadow-reload.mjs +++ b/source/components/form/shadow-reload.mjs @@ -33,7 +33,7 @@ export { ShadowReload }; class ShadowReload extends Reload { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/monster/components/form/shadow-reload"); diff --git a/source/components/form/state-button.mjs b/source/components/form/state-button.mjs index 60d42f74f..7a8b0d813 100644 --- a/source/components/form/state-button.mjs +++ b/source/components/form/state-button.mjs @@ -36,7 +36,7 @@ export { StateButton }; class StateButton extends Button { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 2.1.0 */ static get [instanceSymbol]() { diff --git a/source/components/form/template.mjs b/source/components/form/template.mjs index 7724ab5b6..d5d02790d 100644 --- a/source/components/form/template.mjs +++ b/source/components/form/template.mjs @@ -52,7 +52,7 @@ const intersectionObserverWasInitialized = Symbol("wasInitialized"); class Template extends CustomElement { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 2.1.0 */ static get [instanceSymbol]() { diff --git a/source/components/form/toggle-switch.mjs b/source/components/form/toggle-switch.mjs index 1e3521e07..c00374d9b 100644 --- a/source/components/form/toggle-switch.mjs +++ b/source/components/form/toggle-switch.mjs @@ -295,7 +295,7 @@ class ToggleSwitch extends CustomControl { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for( diff --git a/source/components/form/tree-select.mjs b/source/components/form/tree-select.mjs index 7cfe3dfb2..1dd223cd7 100644 --- a/source/components/form/tree-select.mjs +++ b/source/components/form/tree-select.mjs @@ -70,7 +70,7 @@ const keyEventHandler = Symbol("keyEventHandler"); class TreeSelect extends Select { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 2.1.0 */ static get [instanceSymbol]() { diff --git a/source/components/form/util/floating-ui.mjs b/source/components/form/util/floating-ui.mjs index 0986d1178..446a24d20 100644 --- a/source/components/form/util/floating-ui.mjs +++ b/source/components/form/util/floating-ui.mjs @@ -34,7 +34,7 @@ export { positionPopper }; * @param controlElement * @param popperElement * @param options - * @returns {Promise|*} + * @return {Promise|*} */ function positionPopper(controlElement, popperElement, options) { const body = getDocument().body; diff --git a/source/components/host/call-button.mjs b/source/components/host/call-button.mjs index 746ee0fda..541b97167 100644 --- a/source/components/host/call-button.mjs +++ b/source/components/host/call-button.mjs @@ -88,7 +88,7 @@ const ATTRIBUTE_CALL = `${ATTRIBUTE_PREFIX}call`; class CallButton extends CustomElement { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/component-host/call-button@@instance"); diff --git a/source/components/host/config-manager.mjs b/source/components/host/config-manager.mjs index cdc6aa44d..aab8bebf6 100644 --- a/source/components/host/config-manager.mjs +++ b/source/components/host/config-manager.mjs @@ -90,7 +90,7 @@ const MODE_READ_WRITE = "readwrite"; class ConfigManager extends CustomElement { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/component-host/config-manager@@instance"); @@ -109,7 +109,7 @@ class ConfigManager extends CustomElement { } /** - * @returns {Promise} + * @return {Promise} */ ready() { return Promise.all(this[initializedPromiseSymbol]); @@ -142,7 +142,7 @@ class ConfigManager extends CustomElement { /** * @param {string} key - * @returns {Promise<unknown>} + * @return {Promise<unknown>} */ getConfig(key) { return this.ready().then(() => { @@ -152,7 +152,7 @@ class ConfigManager extends CustomElement { /** * @param {string} key - * @returns {Promise<boolean>} + * @return {Promise<boolean>} */ hasConfig(key) { return this.ready() @@ -170,7 +170,7 @@ class ConfigManager extends CustomElement { /** * @param {string} key * @param {*} value - * @returns {Promise<unknown>} + * @return {Promise<unknown>} */ setConfig(key, value) { return this.ready().then(() => { @@ -266,7 +266,7 @@ function getObjectStore(mode) { } /** - * @returns {Promise<unknown>} + * @return {Promise<unknown>} */ function clearObjectStore() { const store = getObjectStore.call(this, "readwrite"); diff --git a/source/components/host/host.mjs b/source/components/host/host.mjs index 59b953709..9987dd61f 100644 --- a/source/components/host/host.mjs +++ b/source/components/host/host.mjs @@ -113,7 +113,7 @@ const resourceManagerSymbol = Symbol("resourceManager"); class Host extends CustomElement { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/component-host/Host@@instance"); @@ -139,7 +139,7 @@ class Host extends CustomElement { /** * @param key - * @returns {Promise} + * @return {Promise} */ getConfig(key) { if (this[configManagerElementSymbol] instanceof HTMLElement === false) { @@ -166,7 +166,7 @@ class Host extends CustomElement { * * @param {string} key * @param {*} value - * @returns {Promise} + * @return {Promise} */ setConfig(key, value) { if (this[configManagerElementSymbol] instanceof HTMLElement === false) { @@ -287,7 +287,7 @@ class Host extends CustomElement { /** * @see {@link https://monsterjs.org/en/doc/monster/Monster.DOM.FocusManager.html|Monster.DOM.FocusManager} - * @returns {*} + * @return {*} */ get focusManager() { return this[focusManagerSymbol]; @@ -295,7 +295,7 @@ class Host extends CustomElement { /** * @see {@link https://monsterjs.org/en/doc/monster/Monster.DOM.ResourceManager.html|Monster.DOM.ResourceManager} - * @returns {*} + * @return {*} */ get resourceManager() { return this[resourceManagerSymbol]; @@ -303,7 +303,7 @@ class Host extends CustomElement { /** * - * @returns {Monster.Components.Host.Host} + * @return {Monster.Components.Host.Host} * @throws {Error} There is no overlay element defined. */ toggleOverlay() { @@ -358,7 +358,7 @@ class Host extends CustomElement { /** * - * @returns {Monster.I18n.Locale} + * @return {Monster.I18n.Locale} */ get locale() { return getLocaleOfDocument(); @@ -366,7 +366,7 @@ class Host extends CustomElement { /** * - * @returns {Translations} + * @return {Translations} */ get translations() { return getDocumentTranslations(); diff --git a/source/components/host/overlay.mjs b/source/components/host/overlay.mjs index c2f0ee1b0..803740731 100644 --- a/source/components/host/overlay.mjs +++ b/source/components/host/overlay.mjs @@ -112,7 +112,7 @@ const ATTRIBUTE_VALUE_OVERLAY_OPEN = "overlay-open"; class Overlay extends CustomElement { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/monster/components/host/overlay@@instance"); @@ -182,7 +182,7 @@ class Overlay extends CustomElement { /** * - * @returns {Monster.Components.Host.Overlay} + * @return {Monster.Components.Host.Overlay} */ [assembleMethodSymbol]() { super[assembleMethodSymbol](); @@ -193,7 +193,7 @@ class Overlay extends CustomElement { /** * - * @returns {Monster.Components.Host.Overlay} + * @return {Monster.Components.Host.Overlay} */ toggle() { if (this[overlayElementSymbol].classList.contains("open")) { @@ -205,7 +205,7 @@ class Overlay extends CustomElement { } /** - * @returns {Monster.Components.Host.Overlay} + * @return {Monster.Components.Host.Overlay} * @fires monster-overlay-before-open * @fires monster-overlay-open * @fires monster-overlay-before-close @@ -227,7 +227,7 @@ class Overlay extends CustomElement { } /** - * @returns {Monster.Components.Host.Overlay} + * @return {Monster.Components.Host.Overlay} */ close() { fireCustomEvent(this, "monster-overlay-before-close", {}); diff --git a/source/components/host/toggle-button.mjs b/source/components/host/toggle-button.mjs index b370e0f4c..81915dd17 100644 --- a/source/components/host/toggle-button.mjs +++ b/source/components/host/toggle-button.mjs @@ -62,7 +62,7 @@ export { ToggleButton }; class ToggleButton extends CallButton { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/component-host/toggle-button@instance"); diff --git a/source/components/host/util.mjs b/source/components/host/util.mjs index bf56fad58..0529e0609 100644 --- a/source/components/host/util.mjs +++ b/source/components/host/util.mjs @@ -25,7 +25,7 @@ export { generateUniqueConfigKey }; * @param {string} componentName - The name of the component. * @param {string} id - A unique identifier for the component. * @param {string} prefix - A prefix to use in the unique key. - * @returns {string} The generated unique configuration key. + * @return {string} The generated unique configuration key. */ function generateUniqueConfigKey(componentName, id, prefix) { // Get the browser location without parameters diff --git a/source/components/host/viewer.mjs b/source/components/host/viewer.mjs index 0b6724dba..9389edb6c 100644 --- a/source/components/host/viewer.mjs +++ b/source/components/host/viewer.mjs @@ -67,7 +67,7 @@ const viewerElementSymbol = Symbol("viewerElement"); class Viewer extends CustomElement { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/monster/components/host/viewer@@instance"); @@ -209,7 +209,7 @@ class Viewer extends CustomElement { /** * - * @returns {Monster.Components.Host.Viewer} + * @return {Monster.Components.Host.Viewer} */ [assembleMethodSymbol]() { super[assembleMethodSymbol](); @@ -237,7 +237,7 @@ class Viewer extends CustomElement { /** * @private * @param variable - * @returns {boolean} + * @return {boolean} */ function isURL(variable) { try { @@ -251,7 +251,7 @@ function isURL(variable) { /** * @private * @param variable - * @returns {boolean} + * @return {boolean} */ function isBlob(variable) { return variable instanceof Blob; @@ -260,7 +260,7 @@ function isBlob(variable) { /** * @private * @param blob - * @returns {Promise<unknown>} + * @return {Promise<unknown>} */ function blobToText(blob) { return new Promise((resolve, reject) => { diff --git a/source/components/layout/collapse.mjs b/source/components/layout/collapse.mjs index b95117582..c0bfdcb3f 100644 --- a/source/components/layout/collapse.mjs +++ b/source/components/layout/collapse.mjs @@ -93,7 +93,7 @@ const nameSymbol = Symbol("name"); class Collapse extends CustomElement { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/monster/components/layout/collapse@@instance"); @@ -143,7 +143,7 @@ class Collapse extends CustomElement { /** * - * @returns {void} + * @return {void} */ [assembleMethodSymbol]() { super[assembleMethodSymbol](); @@ -158,7 +158,7 @@ class Collapse extends CustomElement { } /** - * @returns {void} + * @return {void} */ connectedCallback() { super.connectedCallback(); @@ -166,14 +166,14 @@ class Collapse extends CustomElement { } /** - * @returns {void} + * @return {void} */ disconnectedCallback() { super.disconnectedCallback(); } /** - * @returns {Collapse} + * @return {Collapse} */ toggle() { if (this[detailsElementSymbol].classList.contains("active")) { @@ -185,14 +185,14 @@ class Collapse extends CustomElement { } /** - * @returns {boolean} + * @return {boolean} */ isClosed() { return !this[detailsElementSymbol].classList.contains("active"); } /** - * @returns {boolean} + * @return {boolean} */ isOpen() { return !this.isClosed(); @@ -200,7 +200,7 @@ class Collapse extends CustomElement { /** * Open the collapse - * @returns {Collapse} + * @return {Collapse} * @fires monster-collapse-before-open This event is fired before the collapse is opened. * @fires monster-collapse-open This event is fired after the collapse is opened. */ @@ -244,7 +244,7 @@ class Collapse extends CustomElement { /** * Close the collapse - * @returns {Collapse} + * @return {Collapse} * @fires monster-collapse-before-close This event is fired before the collapse is closed. * @fires monster-collapse-closed This event is fired after the collapse is closed. */ @@ -294,7 +294,7 @@ class Collapse extends CustomElement { /** * @private - * @returns {void} + * @return {void} */ function adjustHeight() { let height = 0; @@ -400,7 +400,7 @@ function initControlReferences() { /** * @private - * @returns {string} + * @return {string} */ function getConfigKey() { return generateUniqueConfigKey(this[nameSymbol], this.id, "state"); @@ -435,7 +435,7 @@ function updateStateConfig() { /** * @private - * @returns {Promise} + * @return {Promise} */ function initStateFromHostConfig() { if (!this.getOption("features.persistState")) { diff --git a/source/components/layout/details.mjs b/source/components/layout/details.mjs index d1af73b60..ae2e8e8c7 100644 --- a/source/components/layout/details.mjs +++ b/source/components/layout/details.mjs @@ -55,7 +55,7 @@ const buttonEventHandlerSymbol = Symbol("buttonEventHandler"); class Details extends Collapse { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/monster/components/layout/details@@instance"); @@ -93,7 +93,7 @@ class Details extends Collapse { } /** - * @returns {void} + * @return {void} */ [assembleMethodSymbol]() { super[assembleMethodSymbol](); @@ -104,7 +104,7 @@ class Details extends Collapse { } /** - * @returns {void} + * @return {void} */ connectedCallback() { super.connectedCallback(); @@ -127,7 +127,7 @@ class Details extends Collapse { } /** - * @returns {Array<CSSStyleSheet>} + * @return {Array<CSSStyleSheet>} */ static getCSSStyleSheet() { const css = super.getCSSStyleSheet(); @@ -210,7 +210,7 @@ function initButtonLabel() { /** * @private - * @returns {string} + * @return {string} */ function getConfigKey() { return generateUniqueConfigKey("details", this.id, "state"); diff --git a/source/components/layout/iframe.mjs b/source/components/layout/iframe.mjs index 13ad44997..30179966d 100644 --- a/source/components/layout/iframe.mjs +++ b/source/components/layout/iframe.mjs @@ -69,7 +69,7 @@ const timerCallbackSymbol = Symbol("timerCallback"); class Iframe extends CustomElement { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/monster/components/layout/iframe@@instance"); @@ -191,7 +191,7 @@ function calcHeight() { /** * Calculate the maximum height of an element based on the window's inner height * @param element - * @returns {*} + * @return {*} */ function calculateMaximumHeight(element) { let totalBottomBorder = 0; diff --git a/source/components/layout/panel.mjs b/source/components/layout/panel.mjs index bb460eb95..a20340a9d 100644 --- a/source/components/layout/panel.mjs +++ b/source/components/layout/panel.mjs @@ -57,7 +57,7 @@ const timerCallbackSymbol = Symbol("timerCallback"); class Panel extends CustomElement { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/monster/components/layout/panel"); @@ -84,7 +84,7 @@ class Panel extends CustomElement { /** * - * @returns {Monster.Components.Host.Viewer} + * @return {Monster.Components.Host.Viewer} */ [assembleMethodSymbol]() { super[assembleMethodSymbol](); @@ -152,7 +152,7 @@ function calcHeight() { /** * Calculate the maximum height of an element based on the window's inner height * @param element - * @returns {*} + * @return {*} */ function calculateMaximumHeight(element) { let totalBottomBorder = 0; diff --git a/source/components/layout/popper.mjs b/source/components/layout/popper.mjs index cc3ba14f2..657c77adf 100644 --- a/source/components/layout/popper.mjs +++ b/source/components/layout/popper.mjs @@ -98,7 +98,7 @@ const arrowElementSymbol = Symbol("arrowElement"); class Popper extends CustomElement { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/monster/components/layout/popper@@instance"); diff --git a/source/components/layout/slider.mjs b/source/components/layout/slider.mjs index 941de3326..758416092 100644 --- a/source/components/layout/slider.mjs +++ b/source/components/layout/slider.mjs @@ -74,7 +74,7 @@ const ATTRIBUTE_CLONE_FROM = ATTRIBUTE_PREFIX + "clone-from"; class Slider extends CustomElement { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/monster/components/layout/slider@@instance"); @@ -170,7 +170,7 @@ class Slider extends CustomElement { * moves the slider to the given index * * @param index - * @returns {void} + * @return {void} */ moveTo(index) { return moveTo.call(this, index); @@ -366,7 +366,7 @@ function initCarousel() { /** * @private - * @returns {{slides: unknown[], totalSlides: number}} + * @return {{slides: unknown[], totalSlides: number}} */ function getSlidesAndTotal() { const slides = Array.from(getSlottedElements.call(this, ":scope", null)); @@ -376,7 +376,7 @@ function getSlidesAndTotal() { /** * @private - * @returns {number} + * @return {number} */ function next() { const { slides, totalSlides } = getSlidesAndTotal.call(this); @@ -399,7 +399,7 @@ function next() { /** * @private - * @returns {number} + * @return {number} */ function prev() { const prevIndex = this[configSymbol].currentIndex - 1; @@ -584,7 +584,7 @@ function startDragging(e, type) { * @private * @param e * @param type - * @returns {*|number|number} + * @return {*|number|number} */ function getPositionX(e, type) { return type === "mouse" ? e.pageX : e.touches[0].clientX; diff --git a/source/components/layout/split-panel.mjs b/source/components/layout/split-panel.mjs index bcf687e75..e624fd18e 100644 --- a/source/components/layout/split-panel.mjs +++ b/source/components/layout/split-panel.mjs @@ -80,7 +80,7 @@ const TYPE_HORIZONTAL = "horizontal"; class SplitPanel extends CustomElement { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/monster/components/layout/split-panel"); @@ -151,7 +151,7 @@ class SplitPanel extends CustomElement { /** * - * @returns {Monster.Components.Host.Viewer} + * @return {Monster.Components.Host.Viewer} */ [assembleMethodSymbol]() { super[assembleMethodSymbol](); diff --git a/source/components/layout/tabs.mjs b/source/components/layout/tabs.mjs index 160e0e47e..99b441a57 100644 --- a/source/components/layout/tabs.mjs +++ b/source/components/layout/tabs.mjs @@ -154,8 +154,7 @@ const resizeObserverSymbol = Symbol("resizeObserver"); class Tabs extends CustomElement { /** * This method is called by the `instanceof` operator. - * @returns {symbol} - * @since 1.10.0 + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/monster/components/layout/tabs"); @@ -316,7 +315,7 @@ class Tabs extends CustomElement { * * The tabs have to be named with the `data-monster-name` attribute. * - * @returns {string|null} + * @return {string|null} */ getActiveTab() { const nodes = getSlottedElements.call(this); diff --git a/source/components/layout/width-toggle.mjs b/source/components/layout/width-toggle.mjs index 24ed6c8c0..5dd08a0bf 100644 --- a/source/components/layout/width-toggle.mjs +++ b/source/components/layout/width-toggle.mjs @@ -70,7 +70,7 @@ const MODE_WIDE = "wide"; class WidthToggle extends CustomElement { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for( @@ -106,7 +106,7 @@ class WidthToggle extends CustomElement { } /** - * @returns {void} + * @return {void} */ [assembleMethodSymbol]() { super[assembleMethodSymbol](); @@ -126,7 +126,7 @@ class WidthToggle extends CustomElement { /** * @param {string} mode - * @returns {WidthToggle} + * @return {WidthToggle} * @throws {Error} no shadow-root is defined */ setWidth(mode) { @@ -143,7 +143,7 @@ class WidthToggle extends CustomElement { } /** - * @returns {CSSStyleSheet[]} + * @return {CSSStyleSheet[]} */ static getCSSStyleSheet() { return [WidthToggleStyleSheet]; diff --git a/source/components/navigation/table-of-content.mjs b/source/components/navigation/table-of-content.mjs index 39d6dc961..6f44fa43f 100644 --- a/source/components/navigation/table-of-content.mjs +++ b/source/components/navigation/table-of-content.mjs @@ -83,7 +83,7 @@ const scrollableEventHandlerSymbol = Symbol("scrollableEventHandler"); class TableOfContent extends CustomElement { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for( @@ -354,7 +354,7 @@ function initNavigation() { * Recursively creates a nested list (UL) from a list of heading elements. * @param {HTMLElement[]} nodeList - The list of heading elements. * @param {number} currentLevel - The current heading level we are processing. - * @returns {{sublist: HTMLUListElement, lastIndex: number}} An object containing the sublist and the index of the last processed element. + * @return {{sublist: HTMLUListElement, lastIndex: number}} An object containing the sublist and the index of the last processed element. */ function createListFromHeadings(nodeList, currentLevel = 1) { const self = this; @@ -409,7 +409,7 @@ function createListFromHeadings(nodeList, currentLevel = 1) { /** * @private - * @returns {*[]} + * @return {*[]} */ function getHeadings() { const allHeadings = []; diff --git a/source/components/state/log.mjs b/source/components/state/log.mjs index 23e819551..cae22b4ca 100644 --- a/source/components/state/log.mjs +++ b/source/components/state/log.mjs @@ -96,7 +96,7 @@ class Log extends CustomElement { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/monster/components/state/log@@instance"); @@ -153,7 +153,7 @@ class Log extends CustomElement { /** * Add an entry to the log * @param entry - * @returns {Log} + * @return {Log} */ addEntry(entry) { validateInstance(entry, Entry); @@ -171,7 +171,7 @@ class Log extends CustomElement { * Add a log message * @param message * @param date - * @returns {Log} + * @return {Log} */ addMessage(message, date) { if (!date) { diff --git a/source/components/state/log/entry.mjs b/source/components/state/log/entry.mjs index fb70caddb..925edee9e 100644 --- a/source/components/state/log/entry.mjs +++ b/source/components/state/log/entry.mjs @@ -55,7 +55,7 @@ class Entry extends Base { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/component-state/log/entry"); @@ -63,7 +63,7 @@ class Entry extends Base { /** * - * @returns {object} + * @return {object} */ get internalDefaults() { return { @@ -75,7 +75,7 @@ class Entry extends Base { } /** - * @returns {string} + * @return {string} */ get title() { return this.getInternal("title"); @@ -89,7 +89,7 @@ class Entry extends Base { } /** - * @returns {string} + * @return {string} */ get message() { return this.getInternal("message"); @@ -103,7 +103,7 @@ class Entry extends Base { } /** - * @returns {string} + * @return {string} */ get user() { return this.getInternal("user"); @@ -117,7 +117,7 @@ class Entry extends Base { } /** - * @returns {Date} + * @return {Date} */ get date() { return this.getInternal("date"); diff --git a/source/components/state/state.mjs b/source/components/state/state.mjs index 3a6c43d1d..18639e9dd 100644 --- a/source/components/state/state.mjs +++ b/source/components/state/state.mjs @@ -50,7 +50,7 @@ class State extends CustomControl { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/monster/components/state/state@@instance"); diff --git a/source/components/tree-menu/tree-menu.mjs b/source/components/tree-menu/tree-menu.mjs index dabf74c3a..2024058c3 100644 --- a/source/components/tree-menu/tree-menu.mjs +++ b/source/components/tree-menu/tree-menu.mjs @@ -80,7 +80,7 @@ const openEntryEventHandlerSymbol = Symbol("openEntryEventHandler"); class TreeMenu extends CustomElement { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/monster/components/tree-menu@@instance"); diff --git a/source/constraints/abstract.mjs b/source/constraints/abstract.mjs index fd093c362..8d23b69eb 100644 --- a/source/constraints/abstract.mjs +++ b/source/constraints/abstract.mjs @@ -37,7 +37,7 @@ class AbstractConstraint extends Base { * this method must return a promise containing the result of the check. * * @param {*} value - * @returns {Promise} + * @return {Promise} */ isValid(value) { return Promise.reject(value); @@ -45,7 +45,7 @@ class AbstractConstraint extends Base { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 2.1.0 */ static get [instanceSymbol]() { diff --git a/source/constraints/abstractoperator.mjs b/source/constraints/abstractoperator.mjs index a2b62af6c..0aeba69b0 100644 --- a/source/constraints/abstractoperator.mjs +++ b/source/constraints/abstractoperator.mjs @@ -55,7 +55,7 @@ class AbstractOperator extends AbstractConstraint { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 2.1.0 */ static get [instanceSymbol]() { diff --git a/source/constraints/andoperator.mjs b/source/constraints/andoperator.mjs index d62f211d3..5c6d584b2 100644 --- a/source/constraints/andoperator.mjs +++ b/source/constraints/andoperator.mjs @@ -35,7 +35,7 @@ class AndOperator extends AbstractOperator { * this method return a promise containing the result of the check. * * @param {*} value - * @returns {Promise} + * @return {Promise} */ isValid(value) { return Promise.all([ @@ -46,7 +46,7 @@ class AndOperator extends AbstractOperator { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 2.1.0 */ static get [instanceSymbol]() { diff --git a/source/constraints/invalid.mjs b/source/constraints/invalid.mjs index 24dbfd11e..d48adecef 100644 --- a/source/constraints/invalid.mjs +++ b/source/constraints/invalid.mjs @@ -35,7 +35,7 @@ class Invalid extends AbstractConstraint { * this method return a rejected promise * * @param {*} value - * @returns {Promise} + * @return {Promise} */ isValid(value) { return Promise.reject(value); @@ -43,7 +43,7 @@ class Invalid extends AbstractConstraint { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 2.1.0 */ static get [instanceSymbol]() { diff --git a/source/constraints/isarray.mjs b/source/constraints/isarray.mjs index 7a60ad94c..6230a55cb 100644 --- a/source/constraints/isarray.mjs +++ b/source/constraints/isarray.mjs @@ -34,7 +34,7 @@ class IsArray extends AbstractConstraint { * this method return a promise containing the result of the check. * * @param {*} value - * @returns {Promise} + * @return {Promise} */ isValid(value) { if (isArray(value)) { @@ -46,7 +46,7 @@ class IsArray extends AbstractConstraint { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 2.1.0 */ static get [instanceSymbol]() { diff --git a/source/constraints/isobject.mjs b/source/constraints/isobject.mjs index 7ed4e0f1d..6cca890a4 100644 --- a/source/constraints/isobject.mjs +++ b/source/constraints/isobject.mjs @@ -34,7 +34,7 @@ class IsObject extends AbstractConstraint { * this method return a promise containing the result of the check. * * @param {*} value - * @returns {Promise} + * @return {Promise} */ isValid(value) { if (isObject(value)) { @@ -46,7 +46,7 @@ class IsObject extends AbstractConstraint { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 2.1.0 */ static get [instanceSymbol]() { diff --git a/source/constraints/oroperator.mjs b/source/constraints/oroperator.mjs index bd646f05e..d92e65ef5 100644 --- a/source/constraints/oroperator.mjs +++ b/source/constraints/oroperator.mjs @@ -35,7 +35,7 @@ class OrOperator extends AbstractOperator { * this method return a promise containing the result of the check. * * @param {*} value - * @returns {Promise} + * @return {Promise} */ isValid(value) { var self = this; @@ -74,7 +74,7 @@ class OrOperator extends AbstractOperator { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 2.1.0 */ static get [instanceSymbol]() { diff --git a/source/constraints/valid.mjs b/source/constraints/valid.mjs index ca35035d3..2dd5cac4b 100644 --- a/source/constraints/valid.mjs +++ b/source/constraints/valid.mjs @@ -35,7 +35,7 @@ class Valid extends AbstractConstraint { * this method return a promise containing the result of the check. * * @param {*} value - * @returns {Promise} + * @return {Promise} */ isValid(value) { return Promise.resolve(value); @@ -43,7 +43,7 @@ class Valid extends AbstractConstraint { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 2.1.0 */ static get [instanceSymbol]() { diff --git a/source/data/datasource.mjs b/source/data/datasource.mjs index cce4b0eeb..776f52e8e 100644 --- a/source/data/datasource.mjs +++ b/source/data/datasource.mjs @@ -52,7 +52,6 @@ const internalDataSymbol = Symbol.for( * @license AGPLv3 * @since 1.22.0 * @copyright schukai GmbH - * @memberOf Monster.Data * @summary The datasource class encapsulates the access to data objects. */ class Datasource extends Base { @@ -74,7 +73,7 @@ class Datasource extends Base { * attach a new observer * * @param {Observer} observer - * @returns {Datasource} + * @return {Datasource} */ attachObserver(observer) { this[internalDataSymbol].attachObserver(observer); @@ -85,7 +84,7 @@ class Datasource extends Base { * detach a observer * * @param {Observer} observer - * @returns {Datasource} + * @return {Datasource} */ detachObserver(observer) { this[internalDataSymbol].detachObserver(observer); @@ -94,7 +93,7 @@ class Datasource extends Base { /** * @param {Observer} observer - * @returns {boolean} + * @return {boolean} */ containsObserver(observer) { return this[internalDataSymbol].containsObserver(observer); @@ -204,7 +203,7 @@ class Datasource extends Base { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 2.1.0 */ static get [instanceSymbol]() { diff --git a/source/data/datasource/dom.mjs b/source/data/datasource/dom.mjs index 262c03a13..c6b7588e3 100644 --- a/source/data/datasource/dom.mjs +++ b/source/data/datasource/dom.mjs @@ -40,7 +40,7 @@ class DomStorage extends Datasource { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/monster/data/datasource/storage/dom-storage"); diff --git a/source/data/datasource/server.mjs b/source/data/datasource/server.mjs index d0cfe053b..ae81ba1a8 100644 --- a/source/data/datasource/server.mjs +++ b/source/data/datasource/server.mjs @@ -39,7 +39,7 @@ const serverVersionSymbol = Symbol("serverVersion"); class Server extends Datasource { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/monster/data/datasource/server"); @@ -51,7 +51,7 @@ class Server extends Datasource { * * @private * @param {Object} payload - * @returns {Object} + * @return {Object} */ transformServerPayload(payload) { payload = doTransform.call(this, "read", payload); @@ -70,7 +70,7 @@ class Server extends Datasource { * * @private * @param {Object} payload - * @returns {Object} + * @return {Object} */ prepareServerPayload(payload) { payload = doTransform.call(this, "write", payload); @@ -92,7 +92,7 @@ class Server extends Datasource { /** * * @param obj - * @returns {*} + * @return {*} */ function doDiff(obj) { if ( @@ -122,7 +122,7 @@ function doDiff(obj) { * @private * @param {string} type * @param {Object} obj - * @returns {Object} + * @return {Object} */ function doTransform(type, obj) { const transformation = this.getOption(`${type}.mapping.transformer`); diff --git a/source/data/datasource/server/restapi.mjs b/source/data/datasource/server/restapi.mjs index 2ef7c9464..dabfab585 100644 --- a/source/data/datasource/server/restapi.mjs +++ b/source/data/datasource/server/restapi.mjs @@ -56,7 +56,7 @@ class RestAPI extends Server { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 2.1.0 */ static get [instanceSymbol]() { @@ -189,7 +189,7 @@ class RestAPI extends Server { * @param init * @param key * @param callback - * @returns {Promise<string>} + * @return {Promise<string>} */ function fetchData(init, key, callback) { let response; diff --git a/source/data/datasource/server/restapi/data-fetch-error.mjs b/source/data/datasource/server/restapi/data-fetch-error.mjs index d27fe0ca1..b30d16382 100644 --- a/source/data/datasource/server/restapi/data-fetch-error.mjs +++ b/source/data/datasource/server/restapi/data-fetch-error.mjs @@ -40,7 +40,7 @@ class DataFetchError extends Error { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for( diff --git a/source/data/datasource/server/restapi/writeerror.mjs b/source/data/datasource/server/restapi/writeerror.mjs index c14e799f5..7fdfa63a1 100644 --- a/source/data/datasource/server/restapi/writeerror.mjs +++ b/source/data/datasource/server/restapi/writeerror.mjs @@ -42,7 +42,7 @@ class WriteError extends Error { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 2.1.0 */ static get [instanceSymbol]() { diff --git a/source/data/datasource/server/webconnect.mjs b/source/data/datasource/server/webconnect.mjs index 56490fe6d..8691c95df 100644 --- a/source/data/datasource/server/webconnect.mjs +++ b/source/data/datasource/server/webconnect.mjs @@ -67,14 +67,14 @@ class WebConnect extends Server { /** * - * @returns {Promise} + * @return {Promise} */ connect() { return this[webConnectSymbol].connect(); } /** - * @returns {boolean} + * @return {boolean} */ isConnected() { return this[webConnectSymbol].isConnected(); @@ -82,7 +82,7 @@ class WebConnect extends Server { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/monster/data/datasource/server/webconnect"); @@ -142,7 +142,7 @@ class WebConnect extends Server { /** * This method closes the connection. * - * @returns {Promise} + * @return {Promise} */ close() { return this[webConnectSymbol].close(); diff --git a/source/data/datasource/storage.mjs b/source/data/datasource/storage.mjs index 0352fefe2..de225ee57 100644 --- a/source/data/datasource/storage.mjs +++ b/source/data/datasource/storage.mjs @@ -48,7 +48,7 @@ class Storage extends Datasource { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 2.1.0 */ static get [instanceSymbol]() { diff --git a/source/data/datasource/storage/localstorage.mjs b/source/data/datasource/storage/localstorage.mjs index 0217bdda3..e77b16c25 100644 --- a/source/data/datasource/storage/localstorage.mjs +++ b/source/data/datasource/storage/localstorage.mjs @@ -40,7 +40,7 @@ class LocalStorage extends Storage { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 2.1.0 */ static get [instanceSymbol]() { diff --git a/source/data/datasource/storage/sessionstorage.mjs b/source/data/datasource/storage/sessionstorage.mjs index 09e2c079f..c933fbcf8 100644 --- a/source/data/datasource/storage/sessionstorage.mjs +++ b/source/data/datasource/storage/sessionstorage.mjs @@ -40,7 +40,7 @@ class SessionStorage extends Storage { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 2.1.0 */ static get [instanceSymbol]() { diff --git a/source/data/pathfinder.mjs b/source/data/pathfinder.mjs index c0fd5f10d..7b96b5bf9 100644 --- a/source/data/pathfinder.mjs +++ b/source/data/pathfinder.mjs @@ -81,12 +81,13 @@ const WILDCARD = "*"; * new Pathfinder(obj).setVia('a.b.0.c', true); // ↦ {a:{b:[{c:true}]}} * ``` * - * @externalExample ../../example/data/pathfinder-1.mjs - * @externalExample ../../example/data/pathfinder-2.mjs + * @example /examples/libraries/pathfinder/example-1/ Example 1 + * @example /examples/libraries/pathfinder/example-2/ Example 2 + * * @license AGPLv3 * @since 1.4.0 * @copyright schukai GmbH - * @memberOf Monster.Data + * @summary Pathfinder is a class to find a path to an object. */ class Pathfinder extends Base { /** @@ -124,7 +125,7 @@ class Pathfinder extends Base { * * @param {string|array} path * @since 1.4.0 - * @returns {*} + * @return {*} * @throws {TypeError} unsupported type * @throws {Error} the journey is not at its end * @throws {TypeError} value is not a string @@ -139,7 +140,7 @@ class Pathfinder extends Base { * * @param {string|array} path * @param {*} value - * @returns {Pathfinder} + * @return {Pathfinder} * @since 1.4.0 * @throws {TypeError} unsupported type * @throws {TypeError} value is not a string @@ -155,7 +156,7 @@ class Pathfinder extends Base { * Delete Via Path * * @param {string|array} path - * @returns {Pathfinder} + * @return {Pathfinder} * @since 1.6.0 * @throws {TypeError} unsupported type * @throws {TypeError} value is not a string @@ -226,7 +227,7 @@ function iterate(subject, path, check) { * @param subject * @param path * @param check - * @returns {V|*|Map} + * @return {V|*|Map} * @throws {TypeError} unsupported type * @throws {Error} the journey is not at its end * @throws {Error} unsupported action for this data type @@ -306,7 +307,7 @@ function getValueViaPath(subject, path, check) { * @param {object} subject * @param {string|array} path * @param {*} value - * @returns {void} + * @return {void} * @throws {TypeError} unsupported type * @throws {TypeError} unsupported type * @throws {Error} the journey is not at its end @@ -405,7 +406,7 @@ function assignProperty(object, key, value) { * * @param {object} subject * @param {string} path - * @returns {void} + * @return {void} * @throws {TypeError} unsupported type * @throws {TypeError} unsupported type * @throws {Error} the journey is not at its end diff --git a/source/data/pipe.mjs b/source/data/pipe.mjs index bb959c67f..a381ce46f 100644 --- a/source/data/pipe.mjs +++ b/source/data/pipe.mjs @@ -32,11 +32,12 @@ const DELIMITER = "|"; * With the Pipe, processing steps can be combined. Here, the value of an object is accessed via the pathfinder (path command). * the word is then converted to uppercase letters and a prefix Hello is added. the two backslash safe the space char. * - * @externalExample ../../example/data/pipe.mjs + * @example /examples/libraries/pipe/example-1/ + * * @license AGPLv3 * @since 1.5.0 * @copyright schukai GmbH - * @memberOf Monster.Data + * @summary The pipe class makes it possible to combine several processing steps. */ class Pipe extends Base { /** @@ -56,7 +57,7 @@ class Pipe extends Base { * @param {string} name * @param {function} callback * @param {object} context - * @returns {Transformer} + * @return {Transformer} * @throws {TypeError} value is not a string * @throws {TypeError} value is not a function */ @@ -72,7 +73,7 @@ class Pipe extends Base { * run a pipe * * @param {*} value - * @returns {*} + * @return {*} */ run(value) { return this.pipe.reduce((accumulator, transformer, currentIndex, array) => { diff --git a/source/data/transformer.mjs b/source/data/transformer.mjs index 89f16eaa2..ff4f31c45 100644 --- a/source/data/transformer.mjs +++ b/source/data/transformer.mjs @@ -35,21 +35,21 @@ import { Pathfinder } from "./pathfinder.mjs"; export { Transformer }; /** - * The transformer class is a swiss army knife for manipulating values. especially in combination with the pipe, processing chains can be built up. + * The transformer class is a swiss army knife for manipulating values. * * A simple example is the conversion of all characters to lowercase. for this purpose the command `tolower` must be used. * - * ``` + * ```js * let t = new Transformer('tolower').run('ABC'); // ↦ abc * ``` * - * @see {@link https://monsterjs.org/en/doc/#transformer|Monster Docs} + * @fragments /fragments/libraries/transformer + * + * @example /examples/libraries/transformer/simple * - * @externalExample ../../example/data/transformer.mjs - * @license AGPLv3 * @since 1.5.0 * @copyright schukai GmbH - * @memberOf Monster.Data + * @summary The transformer class is a swiss army knife for manipulating values. especially in combination with the pipe, processing chains can be built up. */ class Transformer extends Base { /** @@ -68,7 +68,7 @@ class Transformer extends Base { * @param {string} name * @param {function} callback * @param {object} context - * @returns {Transformer} + * @return {Transformer} * @throws {TypeError} value is not a string * @throws {TypeError} value is not a function */ @@ -91,7 +91,7 @@ class Transformer extends Base { /** * * @param {*} value - * @returns {*} + * @return {*} * @throws {Error} unknown command * @throws {TypeError} unsupported type * @throws {Error} type not supported @@ -104,7 +104,7 @@ class Transformer extends Base { /** * * @param {string} command - * @returns {array} + * @return {array} * @private */ function disassemble(command) { @@ -149,7 +149,7 @@ function disassemble(command) { * tries to make a string out of value and if this succeeds to return it back * * @param {*} value - * @returns {string} + * @return {string} * @private */ function convertToString(value) { @@ -164,7 +164,7 @@ function convertToString(value) { /** * * @param {*} value - * @returns {*} + * @return {*} * @private * @throws {Error} unknown command * @throws {TypeError} unsupported type @@ -835,6 +835,13 @@ function transform(value) { } } +/** + * converts special strings to their values + * @private + * @param input + * @param value + * @return {undefined|*|null|string} + */ function convertSpecialStrings(input, value) { switch (input) { case "value": @@ -850,6 +857,11 @@ function convertSpecialStrings(input, value) { } } +/** + * checks if a value is true or not + * @param value + * @return {boolean} + */ function evaluateCondition(value) { const lowerValue = typeof value === "string" ? value.toLowerCase() : value; diff --git a/source/dom/assembler.mjs b/source/dom/assembler.mjs index d908915b2..f4b93cc40 100644 --- a/source/dom/assembler.mjs +++ b/source/dom/assembler.mjs @@ -53,7 +53,7 @@ class Assembler extends Base { /** * * @param {string} prefix - * @returns {Assembler} + * @return {Assembler} * @throws {TypeError} value is not a string */ setAttributePrefix(prefix) { @@ -64,7 +64,7 @@ class Assembler extends Base { /** * - * @returns {string} + * @return {string} */ getAttributePrefix() { return this.attributePrefix; diff --git a/source/dom/attributes.mjs b/source/dom/attributes.mjs index b0989ec7b..da4b2a8be 100644 --- a/source/dom/attributes.mjs +++ b/source/dom/attributes.mjs @@ -65,7 +65,7 @@ function findClosestObjectLink(element) { * @param element * @param symbol * @param object - * @returns {*} + * @return {*} */ function addToObjectLink(element, symbol, object) { validateInstance(element, HTMLElement); @@ -89,7 +89,7 @@ function addToObjectLink(element, symbol, object) { * @memberOf Monster.DOM * @param {HTMLElement} element * @param {Symbol} symbol - * @returns {*} + * @return {*} */ function removeObjectLink(element, symbol) { validateInstance(element, HTMLElement); diff --git a/source/dom/customcontrol.mjs b/source/dom/customcontrol.mjs index 4169dfcb7..fc68feb3c 100644 --- a/source/dom/customcontrol.mjs +++ b/source/dom/customcontrol.mjs @@ -83,7 +83,7 @@ class CustomControl extends CustomElement { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 2.1.0 */ static get [instanceSymbol]() { diff --git a/source/dom/customelement.mjs b/source/dom/customelement.mjs index fd614b4a0..af5163ea8 100644 --- a/source/dom/customelement.mjs +++ b/source/dom/customelement.mjs @@ -119,49 +119,6 @@ const updateCloneDataSymbol = Symbol("@schukai/monster/dom/@@updateCloneData"); */ const scriptHostElementSymbol = Symbol("scriptHostElement"); -/** - * HTMLElement - * @external HTMLElement - * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement - * - * @startuml customelement-sequencediagram.png - * skinparam monochrome true - * skinparam shadowing false - * - * autonumber - * - * Script -> DOM: element = document.createElement('my-element') - * DOM -> CustomElement: constructor() - * CustomElement -> CustomElement: [initMethodSymbol]() - * - * CustomElement --> DOM: Element - * DOM --> Script : element - * - * - * Script -> DOM: document.querySelector('body').append(element) - * - * DOM -> CustomElement : connectedCallback() - * - * note right CustomElement: is only called at\nthe first connection - * CustomElement -> CustomElement : [assembleMethodSymbol]() - * - * ... ... - * - * autonumber - * - * Script -> DOM: document.querySelector('monster-confirm-button').parentNode.removeChild(element) - * DOM -> CustomElement: disconnectedCallback() - * - * - * @enduml - * - * @startuml customelement-class.png - * skinparam monochrome true - * skinparam shadowing false - * HTMLElement <|-- CustomElement - * @enduml - */ - /** * The `CustomElement` class provides a way to define a new HTML element using the power of Custom Elements. * @@ -237,12 +194,12 @@ const scriptHostElementSymbol = Symbol("scriptHostElement"); */ class CustomElement extends HTMLElement { /** - * A new object is created. First the `initOptions` method is called. Here the + * A new object is created. First, the `initOptions` method is called. Here the * options can be defined in derived classes. Subsequently, the shadowRoot is initialized. * * IMPORTANT: CustomControls instances are not created via the constructor, but either via a tag in the HTML or via <code>document.createElement()</code>. * - * @throws {Error} the options attribute does not contain a valid json definition. + * @throws {Error} the option attribute does not contain a valid JSON definition. */ constructor() { super(); @@ -258,7 +215,8 @@ class CustomElement extends HTMLElement { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * + * @return {symbol} * @since 2.1.0 */ static get [instanceSymbol]() { @@ -281,7 +239,7 @@ class CustomElement extends HTMLElement { * * @param attribute * @param callback - * @returns {Monster.DOM.CustomElement} + * @return {Monster.DOM.CustomElement} */ addAttributeObserver(attribute, callback) { validateFunction(callback); @@ -292,7 +250,7 @@ class CustomElement extends HTMLElement { /** * * @param attribute - * @returns {Monster.DOM.CustomElement} + * @return {Monster.DOM.CustomElement} */ removeAttributeObserver(attribute) { delete this[attributeObserverSymbol][attribute]; @@ -354,7 +312,7 @@ class CustomElement extends HTMLElement { * * Before you can use this method, you must have loaded the translations. * - * @returns {Monster.DOM.CustomElement} + * @return {Monster.DOM.CustomElement} * @throws {Error} Cannot find an element with translations. Add a translation object to the document. */ updateI18n() { @@ -433,10 +391,12 @@ class CustomElement extends HTMLElement { * Example usage: * * ```js - * static getCSSStyleSheet() { - * const sheet = new CSSStyleSheet(); - * sheet.replaceSync("p { color: red; }"); - * return sheet; + * class MyElement extends CustomElement { + * static getCSSStyleSheet() { + * const sheet = new CSSStyleSheet(); + * sheet.replaceSync("p { color: red; }"); + * return sheet; + * } * } * ``` * @@ -462,7 +422,7 @@ class CustomElement extends HTMLElement { * attach a new observer * * @param {Observer} observer - * @returns {CustomElement} + * @return {CustomElement} */ attachObserver(observer) { this[internalSymbol].attachObserver(observer); @@ -473,7 +433,7 @@ class CustomElement extends HTMLElement { * detach a observer * * @param {Observer} observer - * @returns {CustomElement} + * @return {CustomElement} */ detachObserver(observer) { this[internalSymbol].detachObserver(observer); @@ -482,7 +442,7 @@ class CustomElement extends HTMLElement { /** * @param {Observer} observer - * @returns {ProxyObserver} + * @return {ProxyObserver} */ containsObserver(observer) { return this[internalSymbol].containsObserver(observer); @@ -556,13 +516,18 @@ class CustomElement extends HTMLElement { * This method is called once when the object is equipped with update for the dynamic change of the dom. * The functions returned here can be used as pipe functions in the template. * - * In the example, the function `my-transformer` is defined. In the template you can use it as follows: + * In the example, the function `my-transformer` is defined. In the template, you can use it as follows: * * ```html - * <my-element data-monster-option-transformer="path:my-value | call:my-transformer"></my-element> + * <my-element + * data-monster-option-transformer="path:my-value | call:my-transformer"> + * </my-element> * ``` * - * @example + * The function `my-transformer` is called with the value of `my-value` as a parameter. + * + * ```js + * class MyElement extends CustomElement { * [updaterTransformerMethodsSymbol]() { * return { * "my-transformer": (value) => { @@ -577,6 +542,8 @@ class CustomElement extends HTMLElement { * } * }; * }; + * } + * ``` * * @return {object} * @since 2.43.0 @@ -587,11 +554,13 @@ class CustomElement extends HTMLElement { /** * This method is called once when the object is included in the DOM for the first time. It performs the following actions: - * 1. Extracts the options from the attributes and the script tag of the element and sets them. - * 2. Initializes the shadow root and its CSS stylesheet (if specified). - * 3. Initializes the HTML content of the element. - * 4. Initializes the custom elements inside the shadow root and the slotted elements. - * 5. Attaches a mutation observer to observe changes to the attributes of the element. + * + * <ol> + * <li>Extracts the options from the attributes and the script tag of the element and sets them.</li> + * <li>Initializes the shadow root and its CSS stylesheet (if specified).</li> + * <li>Initializes the HTML content of the element.</li> + * <li>Initializes the custom elements inside the shadow root and the slotted elements.</li> + * <li>Attaches a mutation observer to observe changes to the attributes of the element.</li> * * @return {CustomElement} - The updated custom element. * @since 1.8.0 @@ -672,7 +641,7 @@ class CustomElement extends HTMLElement { * You know what you are doing? This function is only for advanced users. * The result is a clone of the internal data. * - * @returns {*} + * @return {*} */ getInternalUpdateCloneData() { return clone(this[updateCloneDataSymbol]); @@ -764,7 +733,7 @@ class CustomElement extends HTMLElement { * * @param {string} name * @param {*} args - * @returns {*} + * @return {*} */ callCallback(name, args) { return callControlCallback.call(this, name, ...args); @@ -1066,7 +1035,7 @@ function getOptionsFromAttributes() { * * @private * @param {string} data The JSON data to be parsed. - * @returns {Object} The parsed object. + * @return {Object} The parsed object. * @throws {error} Throws an error if the JSON data is not valid. */ function parseOptionsJSON(data) { diff --git a/source/dom/dimension.mjs b/source/dom/dimension.mjs index 171286d24..376f35766 100644 --- a/source/dom/dimension.mjs +++ b/source/dom/dimension.mjs @@ -21,7 +21,7 @@ export { convertToPixels, getDeviceDPI }; * Stores the DPI of the device. * * @private - * @returns {number} + * @return {number} * @since 3.34.0 * @type {number|function} */ @@ -40,7 +40,7 @@ let CURRENT_DEVICE_DPI = function () { * * @since 3.34.0 * @memberOf Monster.DOM - * @returns {number} + * @return {number} */ function getDeviceDPI() { // only call the function once @@ -72,7 +72,7 @@ function getDeviceDPI() { * @param {string} value * @param {HTMLElement} [parentElement=document.documentElement] * @param {HTMLElement} [fontSizeElement=document.documentElement] - * @returns {number} + * @return {number} * @license AGPLv3 * @since 3.34.0 * @copyright schukai GmbH diff --git a/source/dom/focusmanager.mjs b/source/dom/focusmanager.mjs index 3f8e36725..9356de8ba 100644 --- a/source/dom/focusmanager.mjs +++ b/source/dom/focusmanager.mjs @@ -63,7 +63,7 @@ class FocusManager extends BaseWithOptions { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 2.1.0 */ static get [instanceSymbol]() { diff --git a/source/dom/locale.mjs b/source/dom/locale.mjs index 5b6c8a003..d3ff7af08 100644 --- a/source/dom/locale.mjs +++ b/source/dom/locale.mjs @@ -64,7 +64,7 @@ function getLocaleOfDocument() { /** * @private - * @returns {string|undefined|*} + * @return {string|undefined|*} * @see https://developer.mozilla.org/en-US/docs/Web/API/Navigator/language * @see https://developer.mozilla.org/en-US/docs/Web/API/Navigator/languages */ diff --git a/source/dom/resource/data.mjs b/source/dom/resource/data.mjs index b698a9edd..63db71632 100644 --- a/source/dom/resource/data.mjs +++ b/source/dom/resource/data.mjs @@ -85,7 +85,7 @@ class Data extends Resource { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 2.1.0 */ static get [instanceSymbol]() { diff --git a/source/dom/resource/link.mjs b/source/dom/resource/link.mjs index e2b6e588a..db41c8c72 100644 --- a/source/dom/resource/link.mjs +++ b/source/dom/resource/link.mjs @@ -77,7 +77,7 @@ class Link extends Resource { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 2.1.0 */ static get [instanceSymbol]() { diff --git a/source/dom/resource/link/stylesheet.mjs b/source/dom/resource/link/stylesheet.mjs index 26b841ca4..f22240cf1 100644 --- a/source/dom/resource/link/stylesheet.mjs +++ b/source/dom/resource/link/stylesheet.mjs @@ -39,7 +39,7 @@ class Stylesheet extends Link { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 2.1.0 */ static get [instanceSymbol]() { diff --git a/source/dom/resource/script.mjs b/source/dom/resource/script.mjs index dbcb43051..3408833c7 100644 --- a/source/dom/resource/script.mjs +++ b/source/dom/resource/script.mjs @@ -61,7 +61,7 @@ class Script extends Resource { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 2.1.0 */ static get [instanceSymbol]() { diff --git a/source/dom/template.mjs b/source/dom/template.mjs index 10fc5a052..99aa7f5d4 100644 --- a/source/dom/template.mjs +++ b/source/dom/template.mjs @@ -48,7 +48,7 @@ class Template extends Base { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 2.1.0 */ static get [instanceSymbol]() { @@ -57,7 +57,7 @@ class Template extends Base { /** * - * @returns {HTMLTemplateElement} + * @return {HTMLTemplateElement} */ getTemplateElement() { return this.template; diff --git a/source/dom/theme.mjs b/source/dom/theme.mjs index 126aa5942..75a2d473e 100644 --- a/source/dom/theme.mjs +++ b/source/dom/theme.mjs @@ -43,7 +43,7 @@ class Theme extends Base { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 2.1.0 */ static get [instanceSymbol]() { @@ -52,7 +52,7 @@ class Theme extends Base { /** * - * @returns {string} + * @return {string} */ getName() { return this.name; diff --git a/source/dom/updater.mjs b/source/dom/updater.mjs index 5c42adc70..350d5e4bc 100644 --- a/source/dom/updater.mjs +++ b/source/dom/updater.mjs @@ -244,7 +244,7 @@ class Updater extends Base { * * @param {string} name * @param {function} callback - * @returns {Transformer} + * @return {Transformer} * @throws {TypeError} value is not a string * @throws {TypeError} value is not a function */ diff --git a/source/dom/util.mjs b/source/dom/util.mjs index bda75c8f4..aae4a3048 100644 --- a/source/dom/util.mjs +++ b/source/dom/util.mjs @@ -55,7 +55,7 @@ export { * } * ``` * - * @returns {object} + * @return {object} * @license AGPLv3 * @since 1.6.0 * @copyright schukai GmbH @@ -103,7 +103,7 @@ function getDocument() { * } * ``` * - * @returns {object} + * @return {object} * @license AGPLv3 * @since 1.6.0 * @copyright schukai GmbH @@ -149,7 +149,7 @@ function getWindow() { * } * ``` * - * @returns {DocumentFragment} + * @return {DocumentFragment} * @license AGPLv3 * @since 1.6.0 * @copyright schukai GmbH @@ -173,7 +173,7 @@ function getDocumentFragmentFromString(html) { * * @param {HTMLElement|ShadowRoot} element - The starting element or shadow root to search from. * @param {string} targetId - The ID of the target element to find. - * @returns {HTMLElement|null} - The ancestor element with the specified ID, or null if not found. + * @return {HTMLElement|null} - The ancestor element with the specified ID, or null if not found. * @memberOf Monster.DOM * @since 3.29.0 * @license AGPLv3 @@ -222,7 +222,7 @@ function findElementWithIdUpwards(element, targetId) { * * @param {HTMLElement|ShadowRoot} element - The starting element or shadow root to search from. * @param {string} selector - The selector of the target element to find. - * @returns {HTMLElement|null} - The ancestor element with the specified selector, or null if not found. + * @return {HTMLElement|null} - The ancestor element with the specified selector, or null if not found. * @memberOf Monster.DOM * @since 3.55.0 */ @@ -259,7 +259,7 @@ function findElementWithSelectorUpwards(element, selector) { /** * @private * @param {HTMLElement} element - * @returns {HTMLElement|null} + * @return {HTMLElement|null} */ function traverseShadowRoots(element) { let currentRoot = element.shadowRoot; @@ -296,7 +296,7 @@ function traverseShadowRoots(element) { * Recursively searches upwards from a given element to find an ancestor element * * @param {HTMLElement} element - * @returns {*} + * @return {*} * @throws {Error} Invalid argument. Expected an HTMLElement. * @memberOf Monster.DOM * @since 3.36.0 @@ -318,10 +318,10 @@ function getContainingDocument(element) { /** * Returns a list of all registered custom elements in the current document. * - * @returns {string[]} + * @return {string[]} * @since 4.0.0 * @memberOf Monster.DOM - * @returns {string[]} + * @return {string[]} */ function getRegisteredCustomElements() { const customElementTags = Array.from(document.querySelectorAll("*")) diff --git a/source/dom/util/extract-keys.mjs b/source/dom/util/extract-keys.mjs index 6e388af4b..1e306b75b 100644 --- a/source/dom/util/extract-keys.mjs +++ b/source/dom/util/extract-keys.mjs @@ -22,7 +22,7 @@ export { extractKeys }; * @param {string} keyPrefix * @param {string} keySeparator * @param {string} valueSeparator - * @returns {Map<any, any>} + * @return {Map<any, any>} */ function extractKeys( obj, diff --git a/source/dom/util/init-options-from-attributes.mjs b/source/dom/util/init-options-from-attributes.mjs index 75232d5bc..aa38cc831 100644 --- a/source/dom/util/init-options-from-attributes.mjs +++ b/source/dom/util/init-options-from-attributes.mjs @@ -54,7 +54,7 @@ export { initOptionsFromAttributes }; * @param {Object} options - The options object to be initialized. * @param {Object} mapping - A mapping between the attribute value and the property value. * @param {string} prefix - The prefix of the attributes to be considered. - * @returns {Object} - The initialized options object. + * @return {Object} - The initialized options object. * @this HTMLElement - The context of the DOM element. */ function initOptionsFromAttributes( diff --git a/source/dom/util/set-option-from-attribute.mjs b/source/dom/util/set-option-from-attribute.mjs index 34f92b498..412f2b85f 100644 --- a/source/dom/util/set-option-from-attribute.mjs +++ b/source/dom/util/set-option-from-attribute.mjs @@ -46,7 +46,7 @@ export { setOptionFromAttribute }; * @param {Object} options - The options object to be initialized. * @param {Object} mapping - A mapping between the attribute value and the property value. * @param {string} prefix - The prefix of the attributes to be considered. - * @returns {Object} - The initialized options object. + * @return {Object} - The initialized options object. * @this HTMLElement - The context of the DOM element. */ function setOptionFromAttribute( diff --git a/source/i18n/formatter.mjs b/source/i18n/formatter.mjs index f2b40f1fc..8fc0b523f 100644 --- a/source/i18n/formatter.mjs +++ b/source/i18n/formatter.mjs @@ -51,7 +51,7 @@ class Formatter extends TextFormatter { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 3.27.0 */ static get [instanceSymbol]() { diff --git a/source/i18n/locale.mjs b/source/i18n/locale.mjs index c67b95ee6..45099b305 100644 --- a/source/i18n/locale.mjs +++ b/source/i18n/locale.mjs @@ -109,7 +109,7 @@ class Locale extends Base { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 3.27.0 */ static get [instanceSymbol]() { @@ -254,7 +254,7 @@ class Locale extends Base { * ``` * * @param {string} locale - * @returns {Locale} + * @return {Locale} * @license AGPLv3 * @since 1.14.0 * @copyright schukai GmbH diff --git a/source/i18n/provider.mjs b/source/i18n/provider.mjs index c7b87a381..6cb4a3c5d 100644 --- a/source/i18n/provider.mjs +++ b/source/i18n/provider.mjs @@ -46,7 +46,7 @@ const translationsLinkSymbol = Symbol.for( class Provider extends BaseWithOptions { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 3.27.0 */ static get [instanceSymbol]() { diff --git a/source/i18n/providers/embed.mjs b/source/i18n/providers/embed.mjs index 34dea76ea..b08f1dfae 100644 --- a/source/i18n/providers/embed.mjs +++ b/source/i18n/providers/embed.mjs @@ -148,7 +148,7 @@ class Embed extends Provider { * `script[data-monster-role=translations]` is searched for and the translations are assigned to the element. * * @param element - * @returns {Promise<Awaited<unknown>[]>} + * @return {Promise<Awaited<unknown>[]>} */ static assignTranslationsToElement(element) { const d = getDocument(); diff --git a/source/i18n/translations.mjs b/source/i18n/translations.mjs index c5db03b25..cf25b86f4 100644 --- a/source/i18n/translations.mjs +++ b/source/i18n/translations.mjs @@ -56,7 +56,7 @@ class Translations extends Base { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 3.27.0 */ static get [instanceSymbol]() { @@ -214,7 +214,7 @@ class Translations extends Base { * Returns the translations for the current document. * * @param {HTMLElement|undefined} [element] - Element to search for translations. Default: element with objectlink @schukai/monster/i18n/translations@@link. - * @returns {Translations} + * @return {Translations} * @throws {Error} Element is not an HTMLElement. * @throws {Error} Cannot find the element with translations. Add the translation object to the document. * @throws {Error} This element has no translations. diff --git a/source/logging/handler.mjs b/source/logging/handler.mjs index abd00ec16..aa1eff9c2 100644 --- a/source/logging/handler.mjs +++ b/source/logging/handler.mjs @@ -45,7 +45,7 @@ class Handler extends Base { * ALL > TRACE > DEBUG > INFO > WARN > ERROR > FATAL > OFF (ALL = 0xff;OFF = 0x00; * * @param {LogEntry} entry - * @returns {boolean} + * @return {boolean} */ log(entry) { validateInstance(entry, LogEntry); @@ -61,7 +61,7 @@ class Handler extends Base { * set loglevel * * @param {integer} loglevel - * @returns {Handler} + * @return {Handler} * @since 1.5.0 */ setLogLevel(loglevel) { @@ -73,7 +73,7 @@ class Handler extends Base { /** * get loglevel * - * @returns {integer} + * @return {integer} * @since 1.5.0 */ getLogLevel() { @@ -83,7 +83,7 @@ class Handler extends Base { /** * Set log level to All * - * @returns {Handler} + * @return {Handler} * @since 1.5.0 */ setAll() { @@ -94,7 +94,7 @@ class Handler extends Base { /** * Set log level to Trace * - * @returns {Handler} + * @return {Handler} * @since 1.5.0 */ setTrace() { @@ -105,7 +105,7 @@ class Handler extends Base { /** * Set log level to Debug * - * @returns {Handler} + * @return {Handler} * @since 1.5.0 */ setDebug() { @@ -116,7 +116,7 @@ class Handler extends Base { /** * Set log level to Info * - * @returns {Handler} + * @return {Handler} * @since 1.5.0 */ setInfo() { @@ -127,7 +127,7 @@ class Handler extends Base { /** * Set log level to Warn * - * @returns {undefined} + * @return {undefined} * @since 1.5.0 */ setWarn() { @@ -138,7 +138,7 @@ class Handler extends Base { /** * Set log level to Error * - * @returns {Handler} + * @return {Handler} * @since 1.5.0 */ setError() { @@ -149,7 +149,7 @@ class Handler extends Base { /** * Set log level to Fatal * - * @returns {Handler} + * @return {Handler} * @since 1.5.0 */ setFatal() { @@ -160,7 +160,7 @@ class Handler extends Base { /** * Set log level to Off * - * @returns {Handler} + * @return {Handler} * @since 1.5.0 */ setOff() { diff --git a/source/logging/handler/console.mjs b/source/logging/handler/console.mjs index c7b830e6b..3e52bf39b 100644 --- a/source/logging/handler/console.mjs +++ b/source/logging/handler/console.mjs @@ -34,7 +34,7 @@ class ConsoleHandler extends Handler { * ALL > TRACE > DEBUG > INFO > WARN > ERROR > FATAL > OFF (ALL = 0xff;OFF = 0x00; * * @param {LogEntry} entry - * @returns {boolean} + * @return {boolean} */ log(entry) { if (super.log(entry)) { diff --git a/source/logging/logentry.mjs b/source/logging/logentry.mjs index 63d1d6caa..93d6039c4 100644 --- a/source/logging/logentry.mjs +++ b/source/logging/logentry.mjs @@ -41,7 +41,7 @@ class LogEntry extends Base { /** * - * @returns {integerr} + * @return {integerr} */ getLogLevel() { return this.loglevel; @@ -49,7 +49,7 @@ class LogEntry extends Base { /** * - * @returns {array} + * @return {array} */ getArguments() { return this.arguments; diff --git a/source/logging/logger.mjs b/source/logging/logger.mjs index 0b6e1e090..856322f51 100644 --- a/source/logging/logger.mjs +++ b/source/logging/logger.mjs @@ -84,7 +84,7 @@ class Logger extends Base { /** * * @param {Handler} handler - * @returns {Logger} + * @return {Logger} * @throws {Error} the handler must be an instance of Handler */ addHandler(handler) { @@ -100,7 +100,7 @@ class Logger extends Base { /** * * @param {Handler} handler - * @returns {Logger} + * @return {Logger} * @throws {Error} the handler must be an instance of Handler */ removeHandler(handler) { @@ -119,7 +119,7 @@ class Logger extends Base { * ALL > TRACE > DEBUG > INFO > WARN > ERROR > FATAL > OFF (ALL = 0xff;OFF = 0x00; * * @param {*} arguments - * @returns {Logger} + * @return {Logger} * @since 1.5.0 */ logTrace(...args) { @@ -137,7 +137,7 @@ class Logger extends Base { * ALL > TRACE > DEBUG > INFO > WARN > ERROR > FATAL > OFF (ALL = 0xff;OFF = 0x00; * * @param {*} arguments - * @returns {Logger} + * @return {Logger} * @since 1.5.0 */ logDebug(...args) { @@ -156,7 +156,7 @@ class Logger extends Base { * * * @param {*} arguments - * @returns {Logger} + * @return {Logger} * @since 1.5.0 */ logInfo(...args) { @@ -174,7 +174,7 @@ class Logger extends Base { * ALL > TRACE > DEBUG > INFO > WARN > ERROR > FATAL > OFF (ALL = 0xff;OFF = 0x00; * * @param {*} arguments - * @returns {Logger} + * @return {Logger} * @since 1.5.0 */ logWarn(...args) { @@ -192,7 +192,7 @@ class Logger extends Base { * ALL > TRACE > DEBUG > INFO > WARN > ERROR > FATAL > OFF (ALL = 0xff;OFF = 0x00; * * @param {*} arguments - * @returns {Logger} + * @return {Logger} * @since 1.5.0 */ logError(...args) { @@ -210,7 +210,7 @@ class Logger extends Base { * ALL > TRACE > DEBUG > INFO > WARN > ERROR > FATAL > OFF (ALL = 0xff;OFF = 0x00; * * @param {*} arguments - * @returns {Logger} + * @return {Logger} * @since 1.5.0 */ logFatal(...args) { @@ -226,7 +226,7 @@ class Logger extends Base { * Labels * * @param {integer} level - * @returns {string} + * @return {string} */ getLabel(level) { validateInteger(level); @@ -247,7 +247,7 @@ class Logger extends Base { * Level * * @param {string} label - * @returns {integer} + * @return {integer} */ getLevel(label) { validateString(label); @@ -270,7 +270,7 @@ class Logger extends Base { * * @param {integer} loglevel * @param {*} args - * @returns {Logger} + * @return {Logger} * @private */ function triggerLog(loglevel, ...args) { diff --git a/source/math/random.mjs b/source/math/random.mjs index 021e6154c..199a744be 100644 --- a/source/math/random.mjs +++ b/source/math/random.mjs @@ -21,7 +21,7 @@ export { random }; * * @param {number} min starting value of the definition set (default is 0) * @param {number} max end value of the definition set (default is 1000000000) - * @returns {number} + * @return {number} * @memberOf Monster.Math * @throws {Error} missing crypt * @throws {Error} we cannot generate numbers larger than 53 bits. @@ -62,7 +62,7 @@ Math.log2 = * * @param {number} min * @param {number} max - * @returns {number} + * @return {number} * @private * @throws {Error} missing crypt * @throws {Error} we cannot generate numbers larger than 53 bits. diff --git a/source/net/webconnect.mjs b/source/net/webconnect.mjs index 686b538e3..93f1f2fb9 100644 --- a/source/net/webconnect.mjs +++ b/source/net/webconnect.mjs @@ -209,7 +209,7 @@ class WebConnect extends BaseWithOptions { /** * - * @returns {Promise} + * @return {Promise} */ connect() { return new Promise((resolve, reject) => { @@ -218,7 +218,7 @@ class WebConnect extends BaseWithOptions { } /** - * @returns {boolean} + * @return {boolean} */ isConnected() { return this[connectionSymbol]?.socket?.readyState === 1; @@ -226,7 +226,7 @@ class WebConnect extends BaseWithOptions { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/monster/net/webconnect"); @@ -259,7 +259,7 @@ class WebConnect extends BaseWithOptions { * * @param {Number} [code=1000] The close code. * @param {String} [reason=""] The close reason. - * @returns {Promise} + * @return {Promise} * @see https://www.rfc-editor.org/rfc/rfc6455.html#section-7.4.1 */ close(statusCode, reason) { @@ -286,7 +286,7 @@ class WebConnect extends BaseWithOptions { /** * Polls the receive queue for new messages. * - * @returns {Message} + * @return {Message} */ poll() { return this[receiveQueueSymbol].poll(); @@ -295,7 +295,7 @@ class WebConnect extends BaseWithOptions { /** * Are there any messages in the receive queue? * - * @returns {boolean} + * @return {boolean} */ dataReceived() { return !this[receiveQueueSymbol].isEmpty(); @@ -304,7 +304,7 @@ class WebConnect extends BaseWithOptions { /** * Get Message from the receive queue, but do not remove it. * - * @returns {Object} + * @return {Object} */ peek() { return this[receiveQueueSymbol].peek(); @@ -314,7 +314,7 @@ class WebConnect extends BaseWithOptions { * Attach a new observer * * @param {Observer} observer - * @returns {ProxyObserver} + * @return {ProxyObserver} */ attachObserver(observer) { this[receiveQueueSymbol].attachObserver(observer); @@ -325,7 +325,7 @@ class WebConnect extends BaseWithOptions { * Detach a observer * * @param {Observer} observer - * @returns {ProxyObserver} + * @return {ProxyObserver} */ detachObserver(observer) { this[receiveQueueSymbol].detachObserver(observer); @@ -334,7 +334,7 @@ class WebConnect extends BaseWithOptions { /** * @param {Observer} observer - * @returns {boolean} + * @return {boolean} */ containsObserver(observer) { return this[receiveQueueSymbol].containsObserver(observer); diff --git a/source/net/webconnect/message.mjs b/source/net/webconnect/message.mjs index 3d860755d..d2deb48bc 100644 --- a/source/net/webconnect/message.mjs +++ b/source/net/webconnect/message.mjs @@ -40,14 +40,14 @@ class Message extends Base { /** * Returns the raw message. * - * @returns {object} + * @return {object} */ getData() { return this[dataSymbol]; } /** - * @returns {*} + * @return {*} */ toJSON() { return this[dataSymbol]; @@ -55,7 +55,7 @@ class Message extends Base { /** * @param {string} json - * @returns {Message} + * @return {Message} * @throws {TypeError} value is not a string */ static fromJSON(json) { diff --git a/source/text/bracketed-key-value-hash.mjs b/source/text/bracketed-key-value-hash.mjs index 64032dd3c..f44f7618a 100644 --- a/source/text/bracketed-key-value-hash.mjs +++ b/source/text/bracketed-key-value-hash.mjs @@ -48,7 +48,7 @@ export { parseBracketedKeyValueHash, createBracketedKeyValueHash }; * * @since 3.37.0 * @param {string} hashString - The string to parse, containing bracketed key-value pairs. - * @returns {Object} - An object representing the parsed result, with keys representing the selectors and values representing the key-value pairs associated with each selector. + * @return {Object} - An object representing the parsed result, with keys representing the selectors and values representing the key-value pairs associated with each selector. * - Returns an empty object if there was an error during parsing. */ function parseBracketedKeyValueHash(hashString) { const selectors = {}; @@ -207,7 +207,7 @@ function parseBracketedKeyValueHash(hashString) { * * @param {Object} object - The object containing selectors and key-value pairs. * @param {boolean} addHashPrefix - Whether to add the hash prefix # to the beginning of the string. - * @returns {string} The hash selector string. + * @return {string} The hash selector string. * @since 3.37.0 */ function createBracketedKeyValueHash(object, addHashPrefix = true) { diff --git a/source/text/generate-range-comparison-expression.mjs b/source/text/generate-range-comparison-expression.mjs index ea9a197cc..05d6edb1a 100644 --- a/source/text/generate-range-comparison-expression.mjs +++ b/source/text/generate-range-comparison-expression.mjs @@ -58,7 +58,7 @@ export { generateRangeComparisonExpression }; * @param {string} [options.eqOp='=='] - The comparison operator for equality to use. * @param {string} [options.geOp='>='] - The comparison operator for greater than or equal to to use. * @param {string} [options.leOp='<='] - The comparison operator for less than or equal to to use. - * @returns {string} The generated comparison expression. + * @return {string} The generated comparison expression. * @throws {Error} If the input is invalid. * @memberOf Monster.Text * @summary Generates a comparison expression based on a range of values. diff --git a/source/types/base.mjs b/source/types/base.mjs index c0fabff3e..dd2bb81ed 100644 --- a/source/types/base.mjs +++ b/source/types/base.mjs @@ -43,7 +43,7 @@ export { Base }; */ class Base extends Object { /** - * @returns {string} + * @return {string} */ toString() { return JSON.stringify(this); @@ -51,7 +51,7 @@ class Base extends Object { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 2.1.0 */ static get [instanceSymbol]() { @@ -61,7 +61,7 @@ class Base extends Object { /** * This method is called by the `instanceof` operator. * @param that - * @returns {boolean} + * @return {boolean} * @since 2.1.0 */ static [Symbol.hasInstance](that) { @@ -96,7 +96,7 @@ class Base extends Object { * * @private * @param obj - * @returns {boolean|any|boolean} + * @return {boolean|any|boolean} * @since 2.1.0 */ function checkInstanceSymbol(obj) { diff --git a/source/types/dataurl.mjs b/source/types/dataurl.mjs index 9f1e1626d..7507444ef 100644 --- a/source/types/dataurl.mjs +++ b/source/types/dataurl.mjs @@ -30,12 +30,11 @@ export { DataUrl, parseDataURL }; const internal = Symbol("internal"); /** - * You can create an object via the monster namespace `new Monster.Types.DataUrl()`. + * You can create an object via the monster namespace `new DataUrl()`. * * @license AGPLv3 * @since 1.8.0 * @copyright schukai GmbH - * @memberOf Monster.Types * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs * @see https://datatracker.ietf.org/doc/html/rfc2397 */ @@ -43,7 +42,7 @@ class DataUrl extends Base { /** * * @param {String} content - * @param {String|Monster.Types.MediaType} mediatype + * @param {String|MediaType} mediatype * @param {boolean} base64=true */ constructor(content, mediatype, base64) { @@ -62,7 +61,7 @@ class DataUrl extends Base { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 2.1.0 */ static get [instanceSymbol]() { @@ -98,7 +97,7 @@ class DataUrl extends Base { } /** - * You can call the function via the monster namespace `Monster.Types.parseDataURL()`. + * You can call the function via the monster namespace `parseDataURL()`. * * Specification: * @@ -109,13 +108,12 @@ class DataUrl extends Base { * parameter := attribute "=" value * ``` * - * @param {String} dataurl - * @return {Monster.Types.DataUrl} * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs * @see https://datatracker.ietf.org/doc/html/rfc2397 * @throws {TypeError} incorrect or missing data protocol * @throws {TypeError} malformed data url - * @memberOf Monster.Types + * @param {string} dataurl + * @return {DataUrl} */ function parseDataURL(dataurl) { validateString(dataurl); diff --git a/source/types/global.mjs b/source/types/global.mjs index e6933cd1e..00197a5fa 100644 --- a/source/types/global.mjs +++ b/source/types/global.mjs @@ -74,7 +74,7 @@ let globalReference; * @license AGPLv3 * @since 1.6.0 * @memberOf Monster.Types - * @returns {object} globalThis + * @return {object} globalThis */ function getGlobal() { return globalReference; @@ -107,7 +107,7 @@ function getGlobal() { * @since 1.6.0 * @memberOf Monster.Types * @param {string} name - * @returns {object} + * @return {object} * @throws {Error} the object is not defined * @throws {TypeError} value is not a object * @throws {TypeError} value is not a string diff --git a/source/types/internal.mjs b/source/types/internal.mjs index 700182432..e2cbe6e90 100644 --- a/source/types/internal.mjs +++ b/source/types/internal.mjs @@ -63,7 +63,7 @@ function equipWithInternal() { * Attach a new observer * * @param {Observer} observer - * @returns {ProxyObserver} + * @return {ProxyObserver} */ this["attachInternalObserver"] = (observer) => { this[internalSymbol].attachObserver(observer); @@ -74,7 +74,7 @@ function equipWithInternal() { * Detach a observer * * @param {Observer} observer - * @returns {ProxyObserver} + * @return {ProxyObserver} */ this["detachInternalObserver"] = (observer) => { this[internalSymbol].detachObserver(observer); @@ -85,7 +85,7 @@ function equipWithInternal() { * Check if a observer is attached * * @param {Observer} observer - * @returns {boolean} + * @return {boolean} */ this["containsInternalObserver"] = (observer) => { return this[internalSymbol].containsObserver(observer); diff --git a/source/types/is.mjs b/source/types/is.mjs index 22ea464c4..0b91dab05 100644 --- a/source/types/is.mjs +++ b/source/types/is.mjs @@ -34,7 +34,7 @@ export { * * @externalExample ../../example/types/is-1.mjs * @param {*} value - * @returns {boolean} + * @return {boolean} * @license AGPLv3 * @since 1.2.0 * @copyright schukai GmbH @@ -53,7 +53,7 @@ function isIterable(value) { * * @externalExample ../../example/types/is-2.mjs * @param {*} value - * @returns {boolean} + * @return {boolean} * @license AGPLv3 * @since 1.0.0 * @copyright schukai GmbH @@ -87,7 +87,7 @@ function isPrimitive(value) { * * @externalExample ../../example/types/is-3.mjs * @param {*} value - * @returns {boolean} + * @return {boolean} * @license AGPLv3 * @since 1.9.0 * @copyright schukai GmbH @@ -104,7 +104,7 @@ function isSymbol(value) { * * @externalExample ../../example/types/is-4.mjs * @param {*} value - * @returns {boolean} + * @return {boolean} * @license AGPLv3 * @since 1.0.0 * @copyright schukai GmbH @@ -125,7 +125,7 @@ function isBoolean(value) { * * @externalExample ../../example/types/is-5.mjs * @param {*} value - * @returns {boolean} + * @return {boolean} * @license AGPLv3 * @since 1.0.0 * @copyright schukai GmbH @@ -145,7 +145,7 @@ function isString(value) { * * @externalExample ../../example/types/is-6.mjs * @param {*} value - * @returns {boolean} + * @return {boolean} * @license AGPLv3 * @since 1.0.0 * @copyright schukai GmbH @@ -170,7 +170,7 @@ function isObject(value) { * @externalExample ../../example/types/is-7.mjs * @param {*} value * @param {*} instance - * @returns {boolean} + * @return {boolean} * @license AGPLv3 * @since 1.5.0 * @copyright schukai GmbH @@ -190,7 +190,7 @@ function isInstance(value, instance) { * * @externalExample ../../example/types/is-8.mjs * @param {*} value - * @returns {boolean} + * @return {boolean} * @license AGPLv3 * @since 1.0.0 * @copyright schukai GmbH @@ -208,7 +208,7 @@ function isArray(value) { * * @externalExample ../../example/types/is-9.mjs * @param {*} value - * @returns {boolean} + * @return {boolean} * @license AGPLv3 * @since 1.0.0 * @copyright schukai GmbH @@ -232,7 +232,7 @@ function isFunction(value) { * * @externalExample ../../example/types/is-10.mjs * @param {*} value - * @returns {boolean} + * @return {boolean} * @license AGPLv3 * @since 1.4.0 * @copyright schukai GmbH diff --git a/source/types/mediatype.mjs b/source/types/mediatype.mjs index e76edf29d..0773ad287 100644 --- a/source/types/mediatype.mjs +++ b/source/types/mediatype.mjs @@ -62,7 +62,7 @@ class MediaType extends Base { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 2.1.0 */ static get [instanceSymbol]() { diff --git a/source/types/node.mjs b/source/types/node.mjs index ddf45d142..82ea597f8 100644 --- a/source/types/node.mjs +++ b/source/types/node.mjs @@ -59,7 +59,7 @@ class Node extends Base { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 2.1.0 */ static get [instanceSymbol]() { diff --git a/source/types/nodelist.mjs b/source/types/nodelist.mjs index 02224e282..47c08705b 100644 --- a/source/types/nodelist.mjs +++ b/source/types/nodelist.mjs @@ -49,7 +49,7 @@ class NodeList extends Set { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 2.1.0 */ static get [instanceSymbol]() { @@ -68,7 +68,7 @@ class NodeList extends Set { /** * @param {Node} node - * @returns {NodeList} + * @return {NodeList} */ remove(node) { super.delete(validateInstance(node, Node)); @@ -77,14 +77,14 @@ class NodeList extends Set { /** * @param {Node} node - * @returns {boolean} + * @return {boolean} */ has(node) { return super.has(validateInstance(node, Node)); } /** - * @returns {NodeList} + * @return {NodeList} */ clear() { super.clear(); @@ -92,21 +92,21 @@ class NodeList extends Set { } /** - * @returns {NodeList} + * @return {NodeList} */ toArray() { return Array.from(this); } /** - * @returns {NodeList} + * @return {NodeList} */ toJSON() { return this.toArray(); } /** - * @returns {NodeList} + * @return {NodeList} */ toString() { const parts = []; diff --git a/source/types/observablequeue.mjs b/source/types/observablequeue.mjs index a57249515..caf775500 100644 --- a/source/types/observablequeue.mjs +++ b/source/types/observablequeue.mjs @@ -40,7 +40,7 @@ class ObservableQueue extends Queue { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} */ static get [instanceSymbol]() { return Symbol.for("@schukai/monster/types/observablequeue"); @@ -50,7 +50,7 @@ class ObservableQueue extends Queue { * Add a new element to the end of the queue. * * @param {*} value - * @returns {Queue} + * @return {Queue} */ add(value) { super.add(value); @@ -61,7 +61,7 @@ class ObservableQueue extends Queue { /** * remove all entries * - * @returns {Queue} + * @return {Queue} */ clear() { super.clear(); @@ -73,7 +73,7 @@ class ObservableQueue extends Queue { * Attach a new observer * * @param {Observer} observer - * @returns {ProxyObserver} + * @return {ProxyObserver} */ attachObserver(observer) { this[internalSymbol].observers.attach(observer); @@ -84,7 +84,7 @@ class ObservableQueue extends Queue { * Detach a observer * * @param {Observer} observer - * @returns {ProxyObserver} + * @return {ProxyObserver} */ detachObserver(observer) { this[internalSymbol].observers.detach(observer); @@ -94,7 +94,7 @@ class ObservableQueue extends Queue { /** * Notify all observer * - * @returns {Promise} + * @return {Promise} */ notifyObservers() { return this[internalSymbol].observers.notify(this); @@ -102,7 +102,7 @@ class ObservableQueue extends Queue { /** * @param {Observer} observer - * @returns {boolean} + * @return {boolean} */ containsObserver(observer) { return this[internalSymbol].observers.contains(observer); diff --git a/source/types/observer.mjs b/source/types/observer.mjs index 2970d71f3..4f486bfe6 100644 --- a/source/types/observer.mjs +++ b/source/types/observer.mjs @@ -77,7 +77,7 @@ class Observer extends Base { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 2.1.0 */ static get [instanceSymbol]() { @@ -87,7 +87,7 @@ class Observer extends Base { /** * * @param {string} tag - * @returns {Observer} + * @return {Observer} */ addTag(tag) { this.tags.add(tag); @@ -97,7 +97,7 @@ class Observer extends Base { /** * * @param {string} tag - * @returns {Observer} + * @return {Observer} */ removeTag(tag) { this.tags.remove(tag); @@ -106,7 +106,7 @@ class Observer extends Base { /** * - * @returns {Array} + * @return {Array} */ getTags() { return this.tags.entries(); @@ -115,7 +115,7 @@ class Observer extends Base { /** * * @param {string} tag - * @returns {boolean} + * @return {boolean} */ hasTag(tag) { return this.tags.contains(tag); @@ -124,7 +124,7 @@ class Observer extends Base { /** * * @param {object} subject - * @returns {Promise} + * @return {Promise} */ update(subject) { const self = this; diff --git a/source/types/proxyobserver.mjs b/source/types/proxyobserver.mjs index 8af7d89b2..c94843413 100644 --- a/source/types/proxyobserver.mjs +++ b/source/types/proxyobserver.mjs @@ -57,7 +57,7 @@ class ProxyObserver extends Base { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 2.1.0 */ static get [instanceSymbol]() { @@ -65,7 +65,7 @@ class ProxyObserver extends Base { } /** - * @returns {object} + * @return {object} */ getSubject() { return this.subject; @@ -93,7 +93,7 @@ class ProxyObserver extends Base { * * Changes to this object are not noticed by the observers, so you can make a large number of changes and inform the observers later. * - * @returns {object} + * @return {object} */ getRealSubject() { return this.realSubject; @@ -103,7 +103,7 @@ class ProxyObserver extends Base { * attach a new observer * * @param {Observer} observer - * @returns {ProxyObserver} + * @return {ProxyObserver} */ attachObserver(observer) { this.observers.attach(observer); @@ -114,7 +114,7 @@ class ProxyObserver extends Base { * detach a observer * * @param {Observer} observer - * @returns {ProxyObserver} + * @return {ProxyObserver} */ detachObserver(observer) { this.observers.detach(observer); @@ -124,7 +124,7 @@ class ProxyObserver extends Base { /** * notify all observer * - * @returns {Promise} + * @return {Promise} */ notifyObservers() { return this.observers.notify(this); @@ -132,7 +132,7 @@ class ProxyObserver extends Base { /** * @param {Observer} observer - * @returns {boolean} + * @return {boolean} */ containsObserver(observer) { return this.observers.contains(observer); @@ -141,7 +141,7 @@ class ProxyObserver extends Base { /** * - * @returns {{defineProperty: (function(*=, *=, *=): *), setPrototypeOf: (function(*, *=): boolean), set: (function(*, *, *, *): boolean), get: ((function(*=, *=, *=): (undefined))|*), deleteProperty: ((function(*, *): (boolean))|*)}} + * @return {{defineProperty: (function(*=, *=, *=): *), setPrototypeOf: (function(*, *=): boolean), set: (function(*, *, *, *): boolean), get: ((function(*=, *=, *=): (undefined))|*), deleteProperty: ((function(*, *): (boolean))|*)}} * @private * @see {@link https://gitlab.schukai.com/-/snippets/49} */ diff --git a/source/types/queue.mjs b/source/types/queue.mjs index 7ea7a449e..1386c7d92 100644 --- a/source/types/queue.mjs +++ b/source/types/queue.mjs @@ -41,7 +41,7 @@ class Queue extends Base { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 2.1.0 */ static get [instanceSymbol]() { @@ -72,7 +72,7 @@ class Queue extends Base { * Add a new element to the end of the queue. * * @param {*} value - * @returns {Queue} + * @return {Queue} */ add(value) { this.data.push(value); @@ -82,7 +82,7 @@ class Queue extends Base { /** * remove all entries * - * @returns {Queue} + * @return {Queue} */ clear() { this.data = []; diff --git a/source/types/stack.mjs b/source/types/stack.mjs index bd8e08d0a..5384cbb13 100644 --- a/source/types/stack.mjs +++ b/source/types/stack.mjs @@ -34,7 +34,7 @@ class Stack extends Base { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 2.1.0 */ static get [instanceSymbol]() { @@ -65,7 +65,7 @@ class Stack extends Base { * pushes an item onto the top of this stack. * * @param {*} value - * @returns {Queue} + * @return {Queue} */ push(value) { this.data.push(value); @@ -75,7 +75,7 @@ class Stack extends Base { /** * remove all entries * - * @returns {Queue} + * @return {Queue} */ clear() { this.data = []; diff --git a/source/types/tokenlist.mjs b/source/types/tokenlist.mjs index c8f2f24d4..7fc012437 100644 --- a/source/types/tokenlist.mjs +++ b/source/types/tokenlist.mjs @@ -46,7 +46,7 @@ class TokenList extends Base { /** * Iterator protocol * - * @returns {Symbol.iterator} + * @return {Symbol.iterator} */ getIterator() { return this[Symbol.iterator](); @@ -55,7 +55,7 @@ class TokenList extends Base { /** * Iterator * - * @returns {{next: ((function(): ({value: *, done: boolean}))|*)}} + * @return {{next: ((function(): ({value: *, done: boolean}))|*)}} */ [Symbol.iterator]() { // Use a new index for each iterator. This makes multiple @@ -80,7 +80,7 @@ class TokenList extends Base { * * @externalExample ../../example/types/tokenlist-2.mjs * @param {array|string|iteratable} value - * @returns {boolean} + * @return {boolean} */ contains(value) { if (isString(value)) { @@ -111,7 +111,7 @@ class TokenList extends Base { * * @externalExample ../../example/types/tokenlist-3.mjs * @param {array|string|iteratable} value - * @returns {TokenList} + * @return {TokenList} * @throws {TypeError} unsupported value */ add(value) { @@ -134,7 +134,7 @@ class TokenList extends Base { /** * remove all tokens * - * @returns {TokenList} + * @return {TokenList} */ clear() { this.tokens.clear(); @@ -146,7 +146,7 @@ class TokenList extends Base { * * @externalExample ../../example/types/tokenlist-4.mjs * @param {array|string|iteratable} value - * @returns {TokenList} + * @return {TokenList} * @throws {TypeError} unsupported value */ remove(value) { @@ -174,7 +174,7 @@ class TokenList extends Base { * * @param {string} token * @param {string} newToken - * @returns {TokenList} + * @return {TokenList} */ replace(token, newToken) { validateString(token); @@ -199,7 +199,7 @@ class TokenList extends Base { * * @externalExample ../../example/types/tokenlist-5.mjs * @param {array|string|iteratable} value - * @returns {boolean} + * @return {boolean} * @throws {TypeError} unsupported value */ toggle(value) { @@ -221,7 +221,7 @@ class TokenList extends Base { /** * returns an array with all tokens * - * @returns {array} + * @return {array} */ entries() { return Array.from(this.tokens); @@ -231,7 +231,7 @@ class TokenList extends Base { * executes the provided function with each value of the set * * @param {function} callback - * @returns {TokenList} + * @return {TokenList} */ forEach(callback) { validateFunction(callback); @@ -242,7 +242,7 @@ class TokenList extends Base { /** * returns the individual tokens separated by a blank character * - * @returns {string} + * @return {string} */ toString() { return this.entries().join(" "); @@ -252,7 +252,7 @@ class TokenList extends Base { /** * @private * @param token - * @returns {toggleValue} + * @return {toggleValue} * @throws {Error} must be called with TokenList.call */ function toggleValue(token) { diff --git a/source/types/uniquequeue.mjs b/source/types/uniquequeue.mjs index 16eda2533..a10c1ba79 100644 --- a/source/types/uniquequeue.mjs +++ b/source/types/uniquequeue.mjs @@ -41,7 +41,7 @@ class UniqueQueue extends Queue { * Add a new element to the end of the queue. * * @param {object} value - * @returns {Queue} + * @return {Queue} * @throws {TypeError} value is not a object */ add(value) { @@ -58,7 +58,7 @@ class UniqueQueue extends Queue { /** * remove all entries * - * @returns {Queue} + * @return {Queue} */ clear() { super.clear(); diff --git a/source/types/version.mjs b/source/types/version.mjs index 13d0bb1d2..635740c69 100644 --- a/source/types/version.mjs +++ b/source/types/version.mjs @@ -82,7 +82,7 @@ class Version extends Base { /** * This method is called by the `instanceof` operator. - * @returns {symbol} + * @return {symbol} * @since 2.1.0 */ static get [instanceSymbol]() { @@ -91,7 +91,7 @@ class Version extends Base { /** * - * @returns {string} + * @return {string} */ toString() { return `${this.major}.${this.minor}.${this.patch}`; @@ -102,7 +102,7 @@ class Version extends Base { * than the compared version * * @param {string|Version} version Version to compare - * @returns {number} + * @return {number} */ compareTo(version) { if (version instanceof Version) { @@ -144,7 +144,7 @@ let monsterVersion; /** * Version of monster * - * @returns {Version} + * @return {Version} * @license AGPLv3 * @since 1.0.0 * @copyright schukai GmbH diff --git a/source/util/clone.mjs b/source/util/clone.mjs index 81ce44e04..a85d9dac8 100644 --- a/source/util/clone.mjs +++ b/source/util/clone.mjs @@ -29,7 +29,7 @@ export { clone }; * If an object has a method `getClone()`, this method is used to create the clone. * * @param {*} obj object to be cloned - * @returns {*} + * @return {*} * @license AGPLv3 * @since 1.0.0 * @memberOf Monster.Util @@ -106,7 +106,7 @@ function clone(obj) { /** * * @param {object} obj - * @returns {object} + * @return {object} * @private */ function cloneObject(obj) { diff --git a/source/util/freeze.mjs b/source/util/freeze.mjs index e1572e0cb..f12ce1d60 100644 --- a/source/util/freeze.mjs +++ b/source/util/freeze.mjs @@ -22,7 +22,7 @@ export { deepFreeze }; * @param {object} object object to be freeze * @license AGPLv3 * @since 1.0.0 - * @returns {object} + * @return {object} * @memberOf Monster.Util * @copyright schukai GmbH * @throws {TypeError} value is not a object diff --git a/source/util/runtime.mjs b/source/util/runtime.mjs index d4b3592e1..f24be3ab0 100644 --- a/source/util/runtime.mjs +++ b/source/util/runtime.mjs @@ -64,7 +64,7 @@ const ENV_UNKNOWN = "unknown"; * * @since 3.34.0 * @memberOf Monster.Util - * @returns {string} The detected runtime environment. Possible values are: + * @return {string} The detected runtime environment. Possible values are: */ function detectRuntimeEnvironment() { // AWS Lambda environment -- GitLab