Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • 1.31
  • master
  • 1.10.0
  • 1.30.1
  • 1.31.0
  • 1.8.0
  • 1.9.0
  • 3.100.0
  • 3.100.1
  • 3.100.10
  • 3.100.11
  • 3.100.12
  • 3.100.13
  • 3.100.14
  • 3.100.15
  • 3.100.16
  • 3.100.17
  • 3.100.18
  • 3.100.19
  • 3.100.2
  • 3.100.20
  • 3.100.3
  • 3.100.4
  • 3.100.5
  • 3.100.6
  • 3.100.7
  • 3.100.8
  • 3.100.9
  • 3.101.0
  • 3.101.1
  • 3.101.2
  • 3.101.3
  • 3.102.0
  • 3.102.1
  • 3.102.2
  • 3.102.3
  • 3.102.4
  • 3.102.5
  • 3.102.6
  • 3.103.0
  • 3.103.1
  • 3.104.0
  • 3.104.1
  • 3.105.0
  • 3.105.1
  • 3.105.2
  • 3.106.0
  • 3.106.1
  • 3.107.0
  • 3.108.0
  • 3.108.1
  • 3.108.2
  • 3.108.3
  • 3.108.4
  • 3.108.5
  • 3.109.0
  • 3.110.0
  • 3.110.1
  • 3.110.2
  • 3.110.3
  • 3.110.4
  • 3.111.0
  • 3.112.0
  • 3.112.1
  • 3.112.2
  • 3.112.3
  • 3.112.4
  • 3.113.0
  • 3.114.0
  • 3.114.1
  • 3.114.2
  • 3.114.3
  • 3.114.4
  • 3.114.5
  • 3.114.6
  • 3.114.7
  • 3.115.0
  • 3.115.1
  • 3.115.2
  • 3.115.3
  • 3.115.4
  • 3.116.0
  • 3.116.1
  • 3.117.0
  • 3.117.1
  • 3.117.2
  • 3.117.3
  • 3.118.0
  • 3.118.1
  • 3.119.0
  • 3.120.0
  • 3.121.0
  • 3.51.5
  • 3.52.0
  • 3.52.1
  • 3.53.0
  • 3.54.0
  • 3.55.0
  • 3.55.1
  • 3.55.2
  • 3.55.3
  • 3.55.4
102 results

Target

Select target project
  • oss/libraries/javascript/monster
1 result
Select Git revision
  • 1.31
  • master
  • 1.10.0
  • 1.30.1
  • 1.31.0
  • 1.8.0
  • 1.9.0
  • 3.100.0
  • 3.100.1
  • 3.100.10
  • 3.100.11
  • 3.100.12
  • 3.100.13
  • 3.100.14
  • 3.100.15
  • 3.100.16
  • 3.100.17
  • 3.100.18
  • 3.100.19
  • 3.100.2
  • 3.100.20
  • 3.100.3
  • 3.100.4
  • 3.100.5
  • 3.100.6
  • 3.100.7
  • 3.100.8
  • 3.100.9
  • 3.101.0
  • 3.101.1
  • 3.101.2
  • 3.101.3
  • 3.102.0
  • 3.102.1
  • 3.102.2
  • 3.102.3
  • 3.102.4
  • 3.102.5
  • 3.102.6
  • 3.103.0
  • 3.103.1
  • 3.104.0
  • 3.104.1
  • 3.105.0
  • 3.105.1
  • 3.105.2
  • 3.106.0
  • 3.106.1
  • 3.107.0
  • 3.108.0
  • 3.108.1
  • 3.108.2
  • 3.108.3
  • 3.108.4
  • 3.108.5
  • 3.109.0
  • 3.110.0
  • 3.110.1
  • 3.110.2
  • 3.110.3
  • 3.110.4
  • 3.111.0
  • 3.112.0
  • 3.112.1
  • 3.112.2
  • 3.112.3
  • 3.112.4
  • 3.113.0
  • 3.114.0
  • 3.114.1
  • 3.114.2
  • 3.114.3
  • 3.114.4
  • 3.114.5
  • 3.114.6
  • 3.114.7
  • 3.115.0
  • 3.115.1
  • 3.115.2
  • 3.115.3
  • 3.115.4
  • 3.116.0
  • 3.116.1
  • 3.117.0
  • 3.117.1
  • 3.117.2
  • 3.117.3
  • 3.118.0
  • 3.118.1
  • 3.119.0
  • 3.120.0
  • 3.121.0
  • 3.51.5
  • 3.52.0
  • 3.52.1
  • 3.53.0
  • 3.54.0
  • 3.55.0
  • 3.55.1
  • 3.55.2
  • 3.55.3
  • 3.55.4
102 results
Show changes
Showing
with 473 additions and 865 deletions
/**
* Copyright 2022 schukai GmbH
* SPDX-License-Identifier: AGPL-3.0
*/
/**
* Namespace for storages
*
* @namespace Monster.Data.Datasource.RestAPI
* @memberOf Monster.Data.Datasource
* @author schukai GmbH
*/
const ns = {};
'use strict';
/** /**
* @author schukai GmbH * Copyright schukai GmbH and contributors 2022. All Rights Reserved.
* Node module: @schukai/monster
* This file is licensed under the AGPLv3 License.
* License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
*/ */
import {internalSymbol} from "../../../constants.js"; import {internalSymbol} from "../../../constants.mjs";
import {assignToNamespace, Monster} from '../../../namespace.js';
export {WriteError}
/** /**
* Error message for API requests with extension of request and validation. * Error message for API requests with extension of request and validation.
* *
* @license AGPLv3
* @since 1.24.0 * @since 1.24.0
* @copyright schukai GmbH * @copyright schukai GmbH
* @memberOf Monster.Data.Datasource.RestAPI * @memberOf Monster.Data.Datasource.RestAPI
...@@ -43,7 +46,3 @@ class WriteError extends Error { ...@@ -43,7 +46,3 @@ class WriteError extends Error {
return this[internalSymbol]['validation'] return this[internalSymbol]['validation']
} }
} }
assignToNamespace('Monster.Data.Datasource.RestAPI', WriteError);
export {Monster, WriteError}
\ No newline at end of file
'use strict';
/** /**
* @author schukai GmbH * Copyright schukai GmbH and contributors 2022. All Rights Reserved.
* Node module: @schukai/monster
* This file is licensed under the AGPLv3 License.
* License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
*/ */
import {internalSymbol} from "../../constants.js"; import {internalSymbol} from "../../constants.mjs";
import {assignToNamespace, Monster} from '../../namespace.js'; import {validateString} from "../../types/validate.mjs";
import {validateString} from "../../types/validate.js"; import {Datasource} from "../datasource.mjs";
import {Datasource} from "../datasource.js";
export {Storage, storageObjectSymbol}
/** /**
* @private * @private
...@@ -16,30 +18,9 @@ import {Datasource} from "../datasource.js"; ...@@ -16,30 +18,9 @@ import {Datasource} from "../datasource.js";
const storageObjectSymbol = Symbol('storageObject'); const storageObjectSymbol = Symbol('storageObject');
/** /**
* You can create an object of this class using the monster namespace `Monster.Data.Datasource.Storage()`. * The class represents a record.
*
* ```
* <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.0/dist/monster.js';
* Monster.Data.Datasource.Storage()
* </script>
* ```
*
* Alternatively you can import the class directly
*
* ```
* <script type="module">
* import {Storage} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.0/dist/modules/data/datasource/storage.js';
* new Storage()
* </script>
* ```
*
* @example
*
* import {Storage} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.0/dist/modules/data/datasource/storage.js';
*
* new Datasource();
* *
* @license AGPLv3
* @since 1.22.0 * @since 1.22.0
* @copyright schukai GmbH * @copyright schukai GmbH
* @memberOf Monster.Data.Datasource * @memberOf Monster.Data.Datasource
...@@ -125,7 +106,3 @@ class Storage extends Datasource { ...@@ -125,7 +106,3 @@ class Storage extends Datasource {
} }
} }
assignToNamespace('Monster.Data.Datasource', Storage);
export {Monster, Storage, storageObjectSymbol}
'use strict';
/** /**
* @author schukai GmbH * Copyright schukai GmbH and contributors 2022. All Rights Reserved.
* Node module: @schukai/monster
* This file is licensed under the AGPLv3 License.
* License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
*/ */
import {internalSymbol} from "../../../constants.js"; import {internalSymbol} from "../../../constants.mjs";
import {assignToNamespace, Monster} from '../../../namespace.js'; import {getGlobalObject} from "../../../types/global.mjs";
import {getGlobalObject} from "../../../types/global.js"; import {Datasource} from "../../datasource.mjs";
import {Datasource} from "../../datasource.js"; import {Storage, storageObjectSymbol} from "../storage.mjs";
import {Storage, storageObjectSymbol} from "../storage.js";
export {LocalStorage}
/** /**
* The LocalStorage Datasource provides a data store in the browser localStorage.
* *
* * @license AGPLv3
* You can create an object of this class using the monster namespace `Monster.Data.Datasource.Storage.LocalStorage()`.
*
* ```
* <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.0/dist/monster.js';
* Monster.Data.Datasource.Storage.LocalStorage()
* </script>
* ```
*
* Alternatively you can import the class directly
*
* ```
* <script type="module">
* import {LocalStorage} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.0/dist/modules/data/datasource/storage/localstorage.js';
* new LocalStorage()
* </script>
* ```
*
* @since 1.22.0 * @since 1.22.0
* @copyright schukai GmbH * @copyright schukai GmbH
* @memberOf Monster.Data.Datasource.Storage * @memberOf Monster.Data.Datasource.Storage
...@@ -59,6 +43,3 @@ class LocalStorage extends Storage { ...@@ -59,6 +43,3 @@ class LocalStorage extends Storage {
} }
assignToNamespace('Monster.Data.Datasource.Storage', LocalStorage);
export {Monster, LocalStorage}
'use strict'; /**
* Copyright 2022 schukai GmbH
* SPDX-License-Identifier: AGPL-3.0
*/
/** /**
* Namespace for storages * Namespace for storages
...@@ -7,10 +10,4 @@ ...@@ -7,10 +10,4 @@
* @memberOf Monster.Data.Datasource * @memberOf Monster.Data.Datasource
* @author schukai GmbH * @author schukai GmbH
*/ */
const ns = {};
/**
* @private
* @type {string}
*/
export const namespace = "Monster.Data.Datasource.Storage";
\ No newline at end of file
'use strict';
/** /**
* @author schukai GmbH * Copyright schukai GmbH and contributors 2022. All Rights Reserved.
* Node module: @schukai/monster
* This file is licensed under the AGPLv3 License.
* License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
*/ */
import {internalSymbol} from "../../../constants.js"; import {internalSymbol} from "../../../constants.mjs";
import {assignToNamespace, Monster} from '../../../namespace.js'; import {getGlobalObject} from "../../../types/global.mjs";
import {getGlobalObject} from "../../../types/global.js"; import {Datasource} from "../../datasource.mjs";
import {Datasource} from "../../datasource.js"; import {Storage, storageObjectSymbol} from "../storage.mjs";
import {Storage, storageObjectSymbol} from "../storage.js";
export {SessionStorage}
/** /**
* You can create an object of this class using the monster namespace `Monster.Data.Datasource.Storage.SessionStorage()`. * The SessionStorage class provides a data source that uses the SessionStorage API on the client.
*
* ```
* <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.0/dist/monster.js';
* Monster.Data.Datasource.Storage.SessionStorage()
* </script>
* ```
*
* Alternatively you can import the class directly
*
* ```
* <script type="module">
* import {SessionStorage} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.0/dist/modules/data/datasource/storage/sessionstorage.js';
* new SessionStorage()
* </script>
* ```
* *
* @license AGPLv3
* @since 1.22.0 * @since 1.22.0
* @copyright schukai GmbH * @copyright schukai GmbH
* @memberOf Monster.Data.Datasource.Storage * @memberOf Monster.Data.Datasource.Storage
...@@ -56,6 +43,3 @@ class SessionStorage extends Storage { ...@@ -56,6 +43,3 @@ class SessionStorage extends Storage {
} }
} }
assignToNamespace('Monster.Data.Datasource.Storage', SessionStorage);
export {Monster, SessionStorage}
'use strict';
/** /**
* @author schukai GmbH * Copyright schukai GmbH and contributors 2022. All Rights Reserved.
* Node module: @schukai/monster
* This file is licensed under the AGPLv3 License.
* License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
*/ */
import {assignToNamespace, Monster} from '../namespace.js'; import {isArray, isObject} from "../types/is.mjs";
import {isArray, isObject} from "../types/is.js"; import {typeOf} from "../types/typeof.mjs";
import {typeOf} from "../types/typeof.js";
export {diff}
/** /**
* With the diff function you can perform the change of one object to another. The result shows the changes of the second object to the first object. * With the diff function you can perform the change of one object to another. The result shows the changes of the second object to the first object.
* *
* The operator `add` means that something has been added to the second object. `delete` means that something has been deleted from the second object compared to the first object. * The operator `add` means that something has been added to the second object. `delete` means that something has been deleted from the second object compared to the first object.
* *
* You can call the method via the monster namespace `Monster.Data.Diff()`. * @externalExample ../../example/data/diff.mjs
*
* ```
* <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.0/dist/monster.js';
* Monster.Data.Diff(a, b)
* </script>
* ```
*
* Alternatively, you can also integrate this function individually.
*
* ```
* <script type="module">
* import {Diff} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.0/dist/modules/data/diff.js';
* Diff(a, b)
* </script>
* ```
*
* @example
*
* import {Diff} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.0/dist/modules/data/diff.js';
*
* // given are two objects x and y.
*
* let x = {
* a: 1,
* b: "Hello!"
* }
*
* let y = {
* a: 2,
* c: true
* }
*
* // These two objects can be compared with each other.
*
* console.log(Diff(x, y));
*
* // the result is then the following
*
* //
* // [
* // {
* // operator: 'update',
* // path: [ 'a' ],
* // first: { value: 1, type: 'number' },
* // second: { value: 2, type: 'number' }
* // },
* // {
* // operator: 'delete',
* // path: [ 'b' ],
* // first: { value: 'Hello!', type: 'string' }
* // },
* // {
* // operator: 'add',
* // path: [ 'c' ],
* // second: { value: true, type: 'boolean' }
* // }
* // ]
*
* @param {*} first * @param {*} first
* @param {*} second * @param {*} second
* @return {array} * @return {array}
* @license AGPLv3
* @since 1.6.0 * @since 1.6.0
* @copyright schukai GmbH * @copyright schukai GmbH
* @memberOf Monster.Data * @memberOf Monster.Data
...@@ -244,6 +188,3 @@ function getOperator(a, b) { ...@@ -244,6 +188,3 @@ function getOperator(a, b) {
return operator; return operator;
} }
assignToNamespace('Monster.Data', diff);
export {Monster, diff}
'use strict';
/** /**
* @author schukai GmbH * Copyright schukai GmbH and contributors 2022. All Rights Reserved.
* Node module: @schukai/monster
* This file is licensed under the AGPLv3 License.
* License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
*/ */
import {assignToNamespace, Monster} from '../namespace.js';
import {isArray, isObject} from "../types/is.js"; import {isArray, isObject} from "../types/is.mjs";
import {typeOf} from "../types/typeof.js"; import {typeOf} from "../types/typeof.mjs";
export {extend}
/** /**
* Extend copies all enumerable own properties from one or * Extend copies all enumerable own properties from one or
* more source objects to a target object. It returns the modified target object. * more source objects to a target object. It returns the modified target object.
* *
* You can call the method via the monster namespace `Monster.Data.extend()`.
*
* ```
* <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.0/dist/monster.js';
* Monster.Data.extend(a, b)
* </script>
* ```
*
* Alternatively, you can also integrate this function individually.
*
* ```
* <script type="module">
* import {extend} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.0/dist/modules/data/extend.js';
* extend(a, b)
* </script>
* ```
*
* @param {object} target * @param {object} target
* @param {object} * @param {object}
* @return {object} * @return {object}
* @license AGPLv3
* @since 1.10.0 * @since 1.10.0
* @copyright schukai GmbH * @copyright schukai GmbH
* @memberOf Monster.Data * @memberOf Monster.Data
...@@ -86,7 +72,3 @@ function extend() { ...@@ -86,7 +72,3 @@ function extend() {
return o; return o;
} }
assignToNamespace('Monster.Data', extend);
export {Monster, extend}
'use strict'; /**
* Copyright 2022 schukai GmbH
* SPDX-License-Identifier: AGPL-3.0
*/
/** /**
* In this namespace you will find classes and methods for handling data. * In this namespace you will find classes and methods for handling data.
...@@ -7,10 +12,4 @@ ...@@ -7,10 +12,4 @@
* @memberOf Monster * @memberOf Monster
* @author schukai GmbH * @author schukai GmbH
*/ */
const ns = {};
\ No newline at end of file
/**
* @private
* @type {string}
*/
export const namespace = "Monster.Data";
\ No newline at end of file
'use strict';
/** /**
* @author schukai GmbH * Copyright schukai GmbH and contributors 2022. All Rights Reserved.
* Node module: @schukai/monster
* This file is licensed under the AGPLv3 License.
* License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
*/ */
import {assignToNamespace, Monster} from '../namespace.js';
import {Base} from '../types/base.js'; import {Base} from '../types/base.mjs';
import {isArray, isInteger, isObject, isPrimitive} from '../types/is.js'; import {isArray, isInteger, isObject, isPrimitive} from '../types/is.mjs';
import {Stack} from "../types/stack.js"; import {Stack} from "../types/stack.mjs";
import {validateInteger, validateString} from '../types/validate.js'; import {validateInteger, validateString} from '../types/validate.mjs';
export {Pathfinder, DELIMITER, WILDCARD}
/** /**
* path separator * path separator
...@@ -15,32 +18,16 @@ import {validateInteger, validateString} from '../types/validate.js'; ...@@ -15,32 +18,16 @@ import {validateInteger, validateString} from '../types/validate.js';
* @private * @private
* @type {string} * @type {string}
*/ */
export const DELIMITER = '.'; const DELIMITER = '.';
/** /**
* @private * @private
* @type {string} * @type {string}
*/ */
export const WILDCARD = '*'; const WILDCARD = '*';
/** /**
* You can call the method via the monster namespace `new Monster.Data.Pathfinder()`. * Pathfinder is a class to find a path to an object.
*
* ```
* <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.0/dist/monster.js';
* console.log(new Monster.Data.Pathfinder())
* </script>
* ```
*
* Alternatively, you can also integrate this function individually.
*
* ```
* <script type="module">
* import {Pathfinder} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.0/dist/modules/data/pathfinder.js';
* console.log(new Pathfinder())
* </script>
* ```
* *
* With the help of the pathfinder, values can be read and written from an object construct. * With the help of the pathfinder, values can be read and written from an object construct.
* *
...@@ -77,54 +64,9 @@ export const WILDCARD = '*'; ...@@ -77,54 +64,9 @@ export const WILDCARD = '*';
* new Pathfinder(obj).setVia('a.b.0.c', true); // ↦ {a:{b:[{c:true}]}} * new Pathfinder(obj).setVia('a.b.0.c', true); // ↦ {a:{b:[{c:true}]}}
* ``` * ```
* *
* @example * @externalExample ../../example/data/pathfinder-1.mjs
* * @externalExample ../../example/data/pathfinder-2.mjs
* import {Pathfinder} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.0/dist/modules/data/pathfinder.js'; * @license AGPLv3
*
* 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)
* }
*
* @example
*
* import {Pathfinder} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.0/dist/modules/data/pathfinder.js';
*
* 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);
*
* @since 1.4.0 * @since 1.4.0
* @copyright schukai GmbH * @copyright schukai GmbH
* @memberOf Monster.Data * @memberOf Monster.Data
...@@ -232,8 +174,6 @@ class Pathfinder extends Base { ...@@ -232,8 +174,6 @@ class Pathfinder extends Base {
} }
assignToNamespace('Monster.Data', Pathfinder);
export {Monster, Pathfinder}
/** /**
* *
...@@ -444,6 +384,7 @@ function assignProperty(object, key, value) { ...@@ -444,6 +384,7 @@ function assignProperty(object, key, value) {
* @throws {TypeError} unsupported type * @throws {TypeError} unsupported type
* @throws {Error} the journey is not at its end * @throws {Error} the journey is not at its end
* @throws {Error} unsupported action for this data type * @throws {Error} unsupported action for this data type
* @license AGPLv3
* @since 1.6.0 * @since 1.6.0
* @private * @private
*/ */
......
'use strict';
/** /**
* @author schukai GmbH * Copyright schukai GmbH and contributors 2022. All Rights Reserved.
* Node module: @schukai/monster
* This file is licensed under the AGPLv3 License.
* License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
*/ */
import {assignToNamespace, Monster} from '../namespace.js'; import {Base} from '../types/base.mjs';
import {Base} from '../types/base.js'; import {validateString} from '../types/validate.mjs';
import {validateString} from '../types/validate.js'; import {Transformer} from './transformer.mjs';
import {Transformer} from './transformer.js';
export {Pipe}
/**
* @private
* @type {string}
*/
const DELIMITER = '|'; const DELIMITER = '|';
/** /**
* The pipe class makes it possible to combine several processing steps. * The pipe class makes it possible to combine several processing steps.
* *
* You can call the method via the monster namespace `new Monster.Data.Pipe()`.
*
* ```
* <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.0/dist/monster.js';
* new Monster.Data.Pipe()
* </script>
* ```
*
* Alternatively, you can also integrate this function individually.
*
* ```
* <script type="module">
* import {Pipe} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.0/dist/modules/data/pipe.js';
* new Pipe()
* </script>
* ```
*
* A pipe consists of commands whose input and output are connected with the pipe symbol `|`. * A pipe consists of commands whose input and output are connected with the pipe symbol `|`.
* *
* With the Pipe, processing steps can be combined. Here, the value of an object is accessed via the pathfinder (path command). * 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. * the word is then converted to uppercase letters and a prefix Hello is added. the two backslash safe the space char.
* *
* @example * @externalExample ../../example/data/pipe.mjs
* import {Pipe} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.0/dist/modules/data/pipe.js'; * @license AGPLv3
*
* let obj = {
* a: {
* b: {
* c: {
* d: "world"
* }
* }
* }
* }
*
* console.log(new Pipe('path:a.b.c.d | toupper | prefix:Hello\\ ').run(obj));
* // ↦ Hello WORLD
*
* @since 1.5.0 * @since 1.5.0
* @copyright schukai GmbH * @copyright schukai GmbH
* @memberOf Monster.Data * @memberOf Monster.Data
...@@ -61,7 +34,6 @@ const DELIMITER = '|'; ...@@ -61,7 +34,6 @@ const DELIMITER = '|';
class Pipe extends Base { class Pipe extends Base {
/** /**
*
* @param {string} pipe a pipe consists of commands whose input and output are connected with the pipe symbol `|`. * @param {string} pipe a pipe consists of commands whose input and output are connected with the pipe symbol `|`.
* @throws {TypeError} * @throws {TypeError}
*/ */
...@@ -77,7 +49,6 @@ class Pipe extends Base { ...@@ -77,7 +49,6 @@ class Pipe extends Base {
} }
/** /**
*
* @param {string} name * @param {string} name
* @param {function} callback * @param {function} callback
* @param {object} context * @param {object} context
...@@ -106,6 +77,3 @@ class Pipe extends Base { ...@@ -106,6 +77,3 @@ class Pipe extends Base {
}, value); }, value);
} }
} }
assignToNamespace('Monster.Data', Pipe);
export {Monster, Pipe}
'use strict';
/** /**
* @author schukai GmbH * Copyright schukai GmbH and contributors 2022. All Rights Reserved.
* Node module: @schukai/monster
* This file is licensed under the AGPLv3 License.
* License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
*/ */
import {assignToNamespace, Monster} from '../namespace.js';
import {Base} from '../types/base.js';
import {getGlobal, getGlobalObject} from "../types/global.js"; import {Base} from '../types/base.mjs';
import {ID} from '../types/id.js'; import {getGlobal, getGlobalObject} from "../types/global.mjs";
import {isArray, isObject, isString} from '../types/is.js'; import {ID} from '../types/id.mjs';
import {isArray, isObject, isString} from '../types/is.mjs';
import { import {
validateFunction, validateFunction,
validateInteger, validateInteger,
validateObject, validateObject,
validatePrimitive, validatePrimitive,
validateString validateString
} from '../types/validate.js'; } from '../types/validate.mjs';
import {clone} from "../util/clone.js"; import {clone} from "../util/clone.mjs";
import {Pathfinder} from "./pathfinder.js"; 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. especially in combination with the pipe, processing chains can be built up.
* *
* You can call the method via the monster namespace `new Monster.Data.Transformer()`.
*
* ```
* <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.0/dist/monster.js';
* new Monster.Data.Transformer()
* </script>
* ```
*
* Alternatively, you can also integrate this function individually.
*
* ```
* <script type="module">
* import {Transformer} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.0/dist/modules/data/transformer.js';
* new Transformer()
* </script>
* ```
*
* A simple example is the conversion of all characters to lowercase. for this purpose the command `tolower` must be used. * A simple example is the conversion of all characters to lowercase. for this purpose the command `tolower` must be used.
* *
* ``` * ```
...@@ -118,18 +106,8 @@ import {Pathfinder} from "./pathfinder.js"; ...@@ -118,18 +106,8 @@ import {Pathfinder} from "./pathfinder.js";
* global['crypto'] = new Crypto.Crypto(); * global['crypto'] = new Crypto.Crypto();
* ``` * ```
* *
* @example * @externalExample ../../example/data/transformer.mjs
* * @license AGPLv3
* import {Transformer} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.0/dist/modules/data/transformer.js';
*
* const transformer = new Transformer("tolower")
*
* console.log(transformer.run("HELLO"))
* // ↦ hello
*
* console.log(transformer.run("WORLD"))
* // ↦ world
*
* @since 1.5.0 * @since 1.5.0
* @copyright schukai GmbH * @copyright schukai GmbH
* @memberOf Monster.Data * @memberOf Monster.Data
...@@ -185,9 +163,6 @@ class Transformer extends Base { ...@@ -185,9 +163,6 @@ class Transformer extends Base {
} }
} }
assignToNamespace('Monster.Data', Transformer);
export {Monster, Transformer}
/** /**
* *
* @param {string} command * @param {string} command
......
'use strict';
/** /**
* @author schukai GmbH * Copyright schukai GmbH and contributors 2022. All Rights Reserved.
* Node module: @schukai/monster
* This file is licensed under the AGPLv3 License.
* License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
*/ */
import {assignToNamespace, Monster} from '../namespace.js';
import {Base} from '../types/base.js';
import {getGlobalFunction} from "../types/global.js";
import {ProxyObserver} from "../types/proxyobserver.js";
import {validateInstance, validateString} from "../types/validate.js";
import {Base} from '../types/base.mjs';
import {getGlobalFunction} from "../types/global.mjs";
import {ProxyObserver} from "../types/proxyobserver.mjs";
import {validateInstance, validateString} from "../types/validate.mjs";
export {ATTRIBUTEPREFIX,Assembler}
/** /**
* attribute prefix * attribute prefix
...@@ -19,24 +21,9 @@ import {validateInstance, validateString} from "../types/validate.js"; ...@@ -19,24 +21,9 @@ import {validateInstance, validateString} from "../types/validate.js";
const ATTRIBUTEPREFIX = "data-monster-"; const ATTRIBUTEPREFIX = "data-monster-";
/** /**
* you can call the method via the monster namespace `new Monster.DOM.Assembler()`. * Assembler class
*
* ```
* <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.0/dist/monster.js';
* console.log(new Monster.DOM.Assembler())
* </script>
* ```
*
* Alternatively, you can also integrate this function individually.
*
* ```
* <script type="module">
* import {Assembler} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.0/dist/modules/dom/assembler.js';
* console.log(new Assembler())
* </script>
* ```
* *
* @license AGPLv3
* @since 1.6.0 * @since 1.6.0
* @copyright schukai GmbH * @copyright schukai GmbH
* @memberOf Monster.DOM * @memberOf Monster.DOM
...@@ -95,6 +82,3 @@ class Assembler extends Base { ...@@ -95,6 +82,3 @@ class Assembler extends Base {
} }
} }
assignToNamespace('Monster.DOM', Assembler);
export {Monster, ATTRIBUTEPREFIX, Assembler}
'use strict';
import {extend} from "../data/extend.js";
/** /**
* @author schukai GmbH * Copyright schukai GmbH and contributors 2022. All Rights Reserved.
* Node module: @schukai/monster
* This file is licensed under the AGPLv3 License.
* License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
*/ */
import {assignToNamespace, Monster} from '../namespace.js';
import {ATTRIBUTE_VALUE} from "./constants.js";
import {CustomElement, attributeObserverSymbol} from "./customelement.js";
import {extend} from "../data/extend.mjs";
import {ATTRIBUTE_VALUE} from "./constants.mjs";
import {CustomElement, attributeObserverSymbol} from "./customelement.mjs";
export {CustomControl}
/** /**
* @private * @private
...@@ -28,13 +30,6 @@ const attachedInternalSymbol = Symbol('attachedInternal'); ...@@ -28,13 +30,6 @@ const attachedInternalSymbol = Symbol('attachedInternal');
* *
* You can create the object via the function `document.createElement()`. * You can create the object via the function `document.createElement()`.
* *
* ```
* <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.0/dist/monster.js';
* document.createElement('monster-')
* </script>
* ```
*
* @startuml customcontrol-class.png * @startuml customcontrol-class.png
* skinparam monochrome true * skinparam monochrome true
* skinparam shadowing false * skinparam shadowing false
...@@ -46,6 +41,7 @@ const attachedInternalSymbol = Symbol('attachedInternal'); ...@@ -46,6 +41,7 @@ const attachedInternalSymbol = Symbol('attachedInternal');
* @see {@link https://www.npmjs.com/package/element-internals-polyfill} * @see {@link https://www.npmjs.com/package/element-internals-polyfill}
* @see {@link https://github.com/WICG/webcomponents} * @see {@link https://github.com/WICG/webcomponents}
* @see {@link https://html.spec.whatwg.org/multipage/custom-elements.html#custom-elements} * @see {@link https://html.spec.whatwg.org/multipage/custom-elements.html#custom-elements}
* @license AGPLv3
* @since 1.14.0 * @since 1.14.0
* @copyright schukai GmbH * @copyright schukai GmbH
* @memberOf Monster.DOM * @memberOf Monster.DOM
...@@ -328,6 +324,3 @@ function initObserver() { ...@@ -328,6 +324,3 @@ function initObserver() {
} }
} }
assignToNamespace('Monster.DOM', CustomControl);
export {Monster, CustomControl}
'use strict';
/** /**
* @author schukai GmbH * Copyright schukai GmbH and contributors 2022. All Rights Reserved.
* Node module: @schukai/monster
* This file is licensed under the AGPLv3 License.
* License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
*/ */
import {internalSymbol} from "../constants.js"; import {internalSymbol} from "../constants.mjs";
import {extend} from "../data/extend.js"; import {extend} from "../data/extend.mjs";
import {Pathfinder} from "../data/pathfinder.js"; import {Pathfinder} from "../data/pathfinder.mjs";
import {assignToNamespace, Monster} from '../namespace.js';
import {parseDataURL} from "../types/dataurl.js"; import {parseDataURL} from "../types/dataurl.mjs";
import {getGlobalObject} from "../types/global.js"; import {getGlobalObject} from "../types/global.mjs";
import {isArray, isFunction, isObject, isString} from "../types/is.js"; import {isArray, isFunction, isObject, isString} from "../types/is.mjs";
import {Observer} from "../types/observer.js"; import {Observer} from "../types/observer.mjs";
import {ProxyObserver} from "../types/proxyobserver.js"; import {ProxyObserver} from "../types/proxyobserver.mjs";
import {validateFunction, validateInstance, validateObject, validateString} from "../types/validate.js"; import {validateFunction, validateInstance, validateObject, validateString} from "../types/validate.mjs";
import {clone} from "../util/clone.js"; import {clone} from "../util/clone.mjs";
import {addAttributeToken, addToObjectLink, getLinkedObjects, hasObjectLink} from "./attributes.js"; import {addAttributeToken, addToObjectLink, getLinkedObjects, hasObjectLink} from "./attributes.mjs";
import { import {
ATTRIBUTE_DISABLED, ATTRIBUTE_DISABLED,
ATTRIBUTE_ERRORMESSAGE, ATTRIBUTE_ERRORMESSAGE,
ATTRIBUTE_OPTIONS, ATTRIBUTE_OPTIONS,
ATTRIBUTE_OPTIONS_SELECTOR, ATTRIBUTE_OPTIONS_SELECTOR,
objectUpdaterLinkSymbol objectUpdaterLinkSymbol
} from "./constants.js"; } from "./constants.mjs";
import {findDocumentTemplate, Template} from "./template.js"; import {findDocumentTemplate, Template} from "./template.mjs";
import {Updater} from "./updater.js"; import {Updater} from "./updater.mjs";
export {CustomElement, initMethodSymbol, assembleMethodSymbol, attributeObserverSymbol, registerCustomElement, assignUpdaterToElement, getSlottedElements}
/** /**
* @memberOf Monster.DOM * @memberOf Monster.DOM
...@@ -101,12 +103,6 @@ const attributeObserverSymbol = Symbol('attributeObserver'); ...@@ -101,12 +103,6 @@ const attributeObserverSymbol = Symbol('attributeObserver');
* *
* You can create the object via the function `document.createElement()`. * You can create the object via the function `document.createElement()`.
* *
* ```
* <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.0/dist/monster.js';
* document.createElement('monster-')
* </script>
* ```
* *
* ## Interaction * ## Interaction
* *
...@@ -172,24 +168,10 @@ const attributeObserverSymbol = Symbol('attributeObserver'); ...@@ -172,24 +168,10 @@ const attributeObserverSymbol = Symbol('attributeObserver');
* } * }
* ``` * ```
* *
* @example * @externalExample ../../example/dom/theme.mjs
*
* // In the example the the user can use his own template by creating a template in the DOM with the ID `my-custom-element`.
* // You can also specify a theme (for example `mytheme`), then it will search for the ID `my-custom-element-mytheme` and
* // if not available for the ID `my-custom-element`.
*
* class MyCustomElement extends CustomElement {
*
* static getTag() {
* return "my-custom-element"
* }
*
* }
*
* // ↦ <my-custom-element></my-custom-element>
*
* @see https://github.com/WICG/webcomponents * @see https://github.com/WICG/webcomponents
* @see https://html.spec.whatwg.org/multipage/custom-elements.html#custom-elements * @see https://html.spec.whatwg.org/multipage/custom-elements.html#custom-elements
* @license AGPLv3
* @since 1.7.0 * @since 1.7.0
* @copyright schukai GmbH * @copyright schukai GmbH
* @memberOf Monster.DOM * @memberOf Monster.DOM
...@@ -207,7 +189,7 @@ class CustomElement extends HTMLElement { ...@@ -207,7 +189,7 @@ class CustomElement extends HTMLElement {
*/ */
constructor() { constructor() {
super(); super();
this[internalSymbol] = new ProxyObserver({'options': extend({}, this.defaults, getOptionsFromAttributes.call(this), getOptionsFromScriptTag.call(this))}); this[internalSymbol] = new ProxyObserver({'options': extend({}, this.defaults)});
this[attributeObserverSymbol] = {}; this[attributeObserverSymbol] = {};
initOptionObserver.call(this); initOptionObserver.call(this);
this[initMethodSymbol](); this[initMethodSymbol]();
...@@ -234,7 +216,7 @@ class CustomElement extends HTMLElement { ...@@ -234,7 +216,7 @@ class CustomElement extends HTMLElement {
* } * }
* ``` * ```
* *
* to set the options via the html tag the attribute data-monster-options must be set. * To set the options via the html tag the attribute data-monster-options must be set.
* As value a JSON object with the desired values must be defined. * As value a JSON object with the desired values must be defined.
* *
* Since 1.18.0 the JSON can be specified as a DataURI. * Since 1.18.0 the JSON can be specified as a DataURI.
...@@ -261,6 +243,7 @@ class CustomElement extends HTMLElement { ...@@ -261,6 +243,7 @@ class CustomElement extends HTMLElement {
* </script> * </script>
* ``` * ```
* *
* The individual configuration values can be found in the table.
* *
* @property {boolean} disabled=false Object The Boolean disabled attribute, when present, makes the element not mutable, focusable, or even submitted with the form. * @property {boolean} disabled=false Object The Boolean disabled attribute, when present, makes the element not mutable, focusable, or even submitted with the form.
* @property {string} shadowMode=open `open` Elements of the shadow root are accessible from JavaScript outside the root, for example using. `close` Denies access to the node(s) of a closed shadow root from JavaScript outside it * @property {string} shadowMode=open `open` Elements of the shadow root are accessible from JavaScript outside the root, for example using. `close` Denies access to the node(s) of a closed shadow root from JavaScript outside it
...@@ -423,6 +406,17 @@ class CustomElement extends HTMLElement { ...@@ -423,6 +406,17 @@ class CustomElement extends HTMLElement {
const self = this; const self = this;
let elements, nodeList; let elements, nodeList;
const AttributeOptions = getOptionsFromAttributes.call(self);
if (isObject(AttributeOptions) && Object.keys(AttributeOptions).length > 0) {
self.setOptions(AttributeOptions);
}
const ScriptOptions = getOptionsFromScriptTag.call(self);
if (isObject(ScriptOptions) && Object.keys(ScriptOptions).length > 0) {
self.setOptions(ScriptOptions);
}
if (self.getOption('shadowMode', false) !== false) { if (self.getOption('shadowMode', false) !== false) {
try { try {
initShadowRoot.call(self); initShadowRoot.call(self);
...@@ -545,6 +539,7 @@ class CustomElement extends HTMLElement { ...@@ -545,6 +539,7 @@ class CustomElement extends HTMLElement {
* @param {String|undefined|null} name name of the slot (if the parameter is undefined, all slots are searched, if the parameter has the value null, all slots without a name are searched. if a string is specified, the slots with this name are searched.) * @param {String|undefined|null} name name of the slot (if the parameter is undefined, all slots are searched, if the parameter has the value null, all slots without a name are searched. if a string is specified, the slots with this name are searched.)
* @return {*} * @return {*}
* @this CustomElement * @this CustomElement
* @license AGPLv3
* @since 1.23.0 * @since 1.23.0
* @throws {Error} query must be a string * @throws {Error} query must be a string
*/ */
...@@ -619,6 +614,7 @@ function containChildNode(node) { ...@@ -619,6 +614,7 @@ function containChildNode(node) {
} }
/** /**
* @license AGPLv3
* @since 1.15.0 * @since 1.15.0
* @private * @private
* @this CustomElement * @this CustomElement
...@@ -693,7 +689,15 @@ function initOptionObserver() { ...@@ -693,7 +689,15 @@ function initOptionObserver() {
// data-monster-options // data-monster-options
self[attributeObserverSymbol][ATTRIBUTE_OPTIONS] = () => { self[attributeObserverSymbol][ATTRIBUTE_OPTIONS] = () => {
const options = getOptionsFromAttributes.call(self); const options = getOptionsFromAttributes.call(self);
if (isObject(options)) { if (isObject(options) && Object.keys(options).length > 0) {
self.setOptions(options);
}
}
// data-monster-options-selector
self[attributeObserverSymbol][ATTRIBUTE_OPTIONS_SELECTOR] = () => {
const options = getOptionsFromScriptTag.call(self);
if (isObject(options) && Object.keys(options).length > 0) {
self.setOptions(options); self.setOptions(options);
} }
} }
...@@ -808,6 +812,7 @@ function initHtmlContent() { ...@@ -808,6 +812,7 @@ function initHtmlContent() {
* @return {CustomElement} * @return {CustomElement}
* @memberOf Monster.DOM * @memberOf Monster.DOM
* @this CustomElement * @this CustomElement
* @license AGPLv3
* @since 1.16.0 * @since 1.16.0
* @throws {TypeError} value is not an instance of * @throws {TypeError} value is not an instance of
*/ */
...@@ -871,6 +876,7 @@ function initCSSStylesheet() { ...@@ -871,6 +876,7 @@ function initCSSStylesheet() {
* @throws {Error} html is not set. * @throws {Error} html is not set.
* @see https://developer.mozilla.org/en-US/docs/Web/API/Element/attachShadow * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/attachShadow
* @memberOf Monster.DOM * @memberOf Monster.DOM
* @license AGPLv3
* @since 1.8.0 * @since 1.8.0
*/ */
function initShadowRoot() { function initShadowRoot() {
...@@ -907,6 +913,7 @@ function initShadowRoot() { ...@@ -907,6 +913,7 @@ function initShadowRoot() {
* *
* @param {CustomElement} element * @param {CustomElement} element
* @return {void} * @return {void}
* @license AGPLv3
* @since 1.7.0 * @since 1.7.0
* @copyright schukai GmbH * @copyright schukai GmbH
* @memberOf Monster.DOM * @memberOf Monster.DOM
...@@ -923,6 +930,7 @@ function registerCustomElement(element) { ...@@ -923,6 +930,7 @@ function registerCustomElement(element) {
* @param element * @param element
* @param object * @param object
* @return {Promise[]} * @return {Promise[]}
* @license AGPLv3
* @since 1.23.0 * @since 1.23.0
* @memberOf Monster.DOM * @memberOf Monster.DOM
*/ */
...@@ -957,15 +965,3 @@ function assignUpdaterToElement(elements, object) { ...@@ -957,15 +965,3 @@ function assignUpdaterToElement(elements, object) {
return result; return result;
} }
assignToNamespace('Monster.DOM', CustomElement, registerCustomElement, assignUpdaterToElement);
export {
Monster,
registerCustomElement,
CustomElement,
initMethodSymbol,
assembleMethodSymbol,
assignUpdaterToElement,
attributeObserverSymbol,
getSlottedElements
}
'use strict';
/** /**
* @author schukai GmbH * Copyright schukai GmbH and contributors 2022. All Rights Reserved.
* Node module: @schukai/monster
* This file is licensed under the AGPLv3 License.
* License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
*/ */
import {assignToNamespace, Monster} from '../namespace.js';
import {isArray,isObject} from "../types/is.js"; import {isArray, isObject} from "../types/is.mjs";
import {validateInstance, validateString} from "../types/validate.js"; import {validateInstance, validateString} from "../types/validate.mjs";
import {getDocument} from "./util.js"; import {getDocument} from "./util.mjs";
export {fireEvent, fireCustomEvent, findTargetElementFromEvent}
/** /**
* You can call the function via the monster namespace `new Monster.DOM.fireEvent()`. * The function sends an event
*
* ```
* <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.0/dist/monster.js';
* new Monster.DOM.fireEvent()
* </script>
* ```
*
* Alternatively, you can also integrate this function individually.
*
* ```
* <script type="module">
* import {fireEvent} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.0/dist/modules/dom/events.js';
* fireEvent()
* </script>
* ```
* *
* @param {HTMLElement|HTMLCollection|NodeList} element * @param {HTMLElement|HTMLCollection|NodeList} element
* @param {string} type * @param {string} type
* @return {void} * @return {void}
* @license AGPLv3
* @since 1.10.0 * @since 1.10.0
* @copyright schukai GmbH * @copyright schukai GmbH
* @memberOf Monster.DOM * @memberOf Monster.DOM
...@@ -68,25 +55,10 @@ function fireEvent(element, type) { ...@@ -68,25 +55,10 @@ function fireEvent(element, type) {
/** /**
* You can call the function via the monster namespace `new Monster.DOM.fireCustomEvent()`. * You can call the function via the monster namespace `new Monster.DOM.fireCustomEvent()`.
* *
* ```
* <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.0/dist/monster.js';
* new Monster.DOM.fireCustomEvent()
* </script>
* ```
*
* Alternatively, you can also integrate this function individually.
*
* ```
* <script type="module">
* import {fireCustomEvent} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.0/dist/modules/dom/events.js';
* fireCustomEvent()
* </script>
* ```
*
* @param {HTMLElement|HTMLCollection|NodeList} element * @param {HTMLElement|HTMLCollection|NodeList} element
* @param {string} type * @param {string} type
* @return {void} * @return {void}
* @license AGPLv3
* @since 1.29.0 * @since 1.29.0
* @copyright schukai GmbH * @copyright schukai GmbH
* @memberOf Monster.DOM * @memberOf Monster.DOM
...@@ -126,24 +98,7 @@ function fireCustomEvent(element, type, detail) { ...@@ -126,24 +98,7 @@ function fireCustomEvent(element, type, detail) {
* up the tree `element.closest()` with the attribute and value. If no value, or a value that is undefined or null, * up the tree `element.closest()` with the attribute and value. If no value, or a value that is undefined or null,
* is specified, only the attribute is searched. * is specified, only the attribute is searched.
* *
* You can call the function via the monster namespace `new Monster.DOM.findTargetElementFromEvent()`. * @license AGPLv3
*
* ```
* <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.0/dist/monster.js';
* new Monster.DOM.findTargetElementFromEvent()
* </script>
* ```
*
* Alternatively, you can also integrate this function individually.
*
* ```
* <script type="module">
* import {findTargetElementFromEvent} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.0/dist/modules/dom/events.js';
* findTargetElementFromEvent()
* </script>
* ```
*
* @since 1.14.0 * @since 1.14.0
* @param {Event} event * @param {Event} event
* @param {string} attributeName * @param {string} attributeName
...@@ -179,7 +134,3 @@ function findTargetElementFromEvent(event, attributeName, attributeValue) { ...@@ -179,7 +134,3 @@ function findTargetElementFromEvent(event, attributeName, attributeValue) {
return undefined; return undefined;
} }
assignToNamespace('Monster.DOM', findTargetElementFromEvent, fireEvent, fireCustomEvent);
export {Monster, findTargetElementFromEvent, fireEvent, fireCustomEvent}