@schukai/monster 1.15.5 → 1.17.1
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG +25 -0
- package/README.md +4 -4
- package/dist/modules/constants.js +1 -1
- package/dist/modules/constraints/abstract.js +1 -1
- package/dist/modules/constraints/abstractoperator.js +1 -1
- package/dist/modules/constraints/andoperator.js +1 -1
- package/dist/modules/constraints/invalid.js +1 -1
- package/dist/modules/constraints/isarray.js +1 -1
- package/dist/modules/constraints/isobject.js +1 -1
- package/dist/modules/constraints/namespace.js +2 -2
- package/dist/modules/constraints/oroperator.js +1 -1
- package/dist/modules/constraints/valid.js +1 -1
- package/dist/modules/data/buildmap.js +2 -2
- package/dist/modules/data/diff.js +2 -2
- package/dist/modules/data/extend.js +1 -1
- package/dist/modules/data/namespace.js +2 -2
- package/dist/modules/data/pathfinder.js +2 -2
- package/dist/modules/data/pipe.js +1 -1
- package/dist/modules/data/transformer.js +1 -1
- package/dist/modules/dom/assembler.js +1 -1
- package/dist/modules/dom/attributes.js +1 -1
- package/dist/modules/dom/constants.js +1 -1
- package/dist/modules/dom/customcontrol.js +1 -1
- package/dist/modules/dom/customelement.js +1 -1
- package/dist/modules/dom/events.js +1 -1
- package/dist/modules/dom/locale.js +1 -1
- package/dist/modules/dom/namespace.js +2 -2
- package/dist/modules/dom/template.js +1 -1
- package/dist/modules/dom/theme.js +1 -1
- package/dist/modules/dom/updater.js +1 -1
- package/dist/modules/dom/util.js +1 -1
- package/dist/modules/i18n/locale.js +1 -1
- package/dist/modules/i18n/namespace.js +2 -2
- package/dist/modules/i18n/provider.js +1 -1
- package/dist/modules/i18n/providers/fetch.js +1 -1
- package/dist/modules/i18n/providers/namespace.js +2 -2
- package/dist/modules/i18n/translations.js +1 -1
- package/dist/modules/logging/handler/console.js +2 -2
- package/dist/modules/logging/handler/namespace.js +2 -2
- package/dist/modules/logging/handler.js +1 -1
- package/dist/modules/logging/logentry.js +1 -1
- package/dist/modules/logging/logger.js +1 -1
- package/dist/modules/logging/namespace.js +2 -2
- package/dist/modules/math/namespace.js +2 -2
- package/dist/modules/math/random.js +1 -1
- package/dist/modules/monster.js +1 -1
- package/dist/modules/namespace.js +1 -1
- package/dist/modules/text/formatter.js +1 -1
- package/dist/modules/text/namespace.js +2 -2
- package/dist/modules/types/base.js +1 -1
- package/dist/modules/types/basewithoptions.js +1 -1
- package/dist/modules/types/global.js +1 -1
- package/dist/modules/types/id.js +1 -1
- package/dist/modules/types/is.js +1 -1
- package/dist/modules/types/namespace.js +2 -2
- package/dist/modules/types/observer.js +1 -1
- package/dist/modules/types/observerlist.js +1 -1
- package/dist/modules/types/proxyobserver.js +1 -1
- package/dist/modules/types/queue.js +1 -1
- package/dist/modules/types/randomid.js +1 -1
- package/dist/modules/types/stack.js +1 -1
- package/dist/modules/types/tokenlist.js +1 -1
- package/dist/modules/types/typeof.js +1 -1
- package/dist/modules/types/uniquequeue.js +1 -1
- package/dist/modules/types/validate.js +1 -1
- package/dist/modules/types/version.js +2 -2
- package/dist/modules/util/clone.js +1 -1
- package/dist/modules/util/comparator.js +1 -1
- package/dist/modules/util/freeze.js +1 -1
- package/dist/modules/util/namespace.js +2 -2
- package/dist/monster.dev.js +1293 -943
- package/dist/monster.dev.js.map +1 -1
- package/dist/monster.js +2 -2
- package/package.json +1 -1
- package/source/constraints/abstract.js +1 -1
- package/source/constraints/abstractoperator.js +1 -1
- package/source/constraints/andoperator.js +6 -6
- package/source/constraints/invalid.js +4 -4
- package/source/constraints/isarray.js +4 -4
- package/source/constraints/isobject.js +4 -4
- package/source/constraints/namespace.js +3 -2
- package/source/constraints/oroperator.js +6 -6
- package/source/constraints/valid.js +4 -4
- package/source/data/buildmap.js +245 -12
- package/source/data/diff.js +7 -6
- package/source/data/extend.js +3 -3
- package/source/data/namespace.js +3 -2
- package/source/data/pathfinder.js +15 -11
- package/source/data/pipe.js +4 -4
- package/source/data/transformer.js +4 -4
- package/source/dom/assembler.js +4 -4
- package/source/dom/attributes.js +36 -46
- package/source/dom/constants.js +16 -14
- package/source/dom/customcontrol.js +12 -8
- package/source/dom/customelement.js +24 -11
- package/source/dom/events.js +6 -6
- package/source/dom/locale.js +5 -4
- package/source/dom/namespace.js +3 -2
- package/source/dom/template.js +6 -6
- package/source/dom/theme.js +5 -4
- package/source/dom/updater.js +11 -5
- package/source/dom/util.js +9 -9
- package/source/i18n/locale.js +27 -15
- package/source/i18n/namespace.js +3 -2
- package/source/i18n/provider.js +3 -3
- package/source/i18n/providers/fetch.js +22 -6
- package/source/i18n/providers/namespace.js +3 -2
- package/source/i18n/translations.js +3 -3
- package/source/logging/handler/console.js +34 -10
- package/source/logging/handler/namespace.js +3 -2
- package/source/logging/handler.js +4 -4
- package/source/logging/logentry.js +5 -5
- package/source/logging/logger.js +13 -13
- package/source/logging/namespace.js +3 -2
- package/source/math/namespace.js +3 -2
- package/source/math/random.js +3 -3
- package/source/namespace.js +1 -1
- package/source/text/formatter.js +3 -3
- package/source/text/namespace.js +3 -2
- package/source/types/base.js +3 -3
- package/source/types/basewithoptions.js +3 -3
- package/source/types/global.js +7 -7
- package/source/types/id.js +3 -3
- package/source/types/is.js +30 -30
- package/source/types/namespace.js +3 -2
- package/source/types/observer.js +4 -4
- package/source/types/observerlist.js +3 -3
- package/source/types/proxyobserver.js +6 -6
- package/source/types/queue.js +4 -4
- package/source/types/randomid.js +3 -3
- package/source/types/stack.js +3 -3
- package/source/types/tokenlist.js +3 -3
- package/source/types/typeof.js +4 -4
- package/source/types/uniquequeue.js +3 -3
- package/source/types/validate.js +34 -34
- package/source/types/version.js +7 -7
- package/source/util/clone.js +3 -3
- package/source/util/comparator.js +37 -7
- package/source/util/freeze.js +4 -4
- package/source/util/namespace.js +3 -2
- package/test/cases/data/buildmap.js +242 -16
- package/test/cases/data/diff.js +36 -3
- package/test/cases/data/pathfinder.js +298 -196
- package/test/cases/logging/handler/console.js +20 -0
- package/test/cases/monster.js +1 -1
- package/test/web/import.js +1 -0
- package/test/web/monster-dev.html +3 -3
- package/test/web/monster.html +2 -2
- package/test/web/test.html +2 -2
- package/test/web/tests.js +3 -3
package/source/data/namespace.js
CHANGED
@@ -3,7 +3,8 @@
|
|
3
3
|
/**
|
4
4
|
* In this namespace you will find classes and methods for handling data.
|
5
5
|
*
|
6
|
-
* @namespace Monster
|
6
|
+
* @namespace Monster.Data
|
7
|
+
* @memberOf Monster
|
7
8
|
* @author schukai GmbH
|
8
9
|
*/
|
9
10
|
|
@@ -12,4 +13,4 @@
|
|
12
13
|
* @private
|
13
14
|
* @type {string}
|
14
15
|
*/
|
15
|
-
const namespace = "Monster.Data";
|
16
|
+
export const namespace = "Monster.Data";
|
@@ -5,7 +5,7 @@
|
|
5
5
|
*/
|
6
6
|
import {assignToNamespace, Monster} from '../namespace.js';
|
7
7
|
import {Base} from '../types/base.js';
|
8
|
-
import {isArray, isInteger, isObject} from '../types/is.js';
|
8
|
+
import {isArray, isInteger, isObject, isPrimitive} from '../types/is.js';
|
9
9
|
import {Stack} from "../types/stack.js";
|
10
10
|
import {validateInteger, validateString} from '../types/validate.js';
|
11
11
|
|
@@ -15,19 +15,19 @@ import {validateInteger, validateString} from '../types/validate.js';
|
|
15
15
|
* @private
|
16
16
|
* @type {string}
|
17
17
|
*/
|
18
|
-
const DELIMITER = '.';
|
18
|
+
export const DELIMITER = '.';
|
19
19
|
/**
|
20
20
|
* @private
|
21
21
|
* @type {string}
|
22
22
|
*/
|
23
|
-
const WILDCARD = '*';
|
23
|
+
export const WILDCARD = '*';
|
24
24
|
|
25
25
|
/**
|
26
26
|
* You can call the method via the monster namespace `new Monster.Data.Pathfinder()`.
|
27
27
|
*
|
28
28
|
* ```
|
29
29
|
* <script type="module">
|
30
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
30
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.17.1/dist/modules/data/pathfinder.js';
|
31
31
|
* console.log(new Monster.Data.Pathfinder())
|
32
32
|
* </script>
|
33
33
|
* ```
|
@@ -36,7 +36,7 @@ const WILDCARD = '*';
|
|
36
36
|
*
|
37
37
|
* ```
|
38
38
|
* <script type="module">
|
39
|
-
* import {Pathfinder} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
39
|
+
* import {Pathfinder} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.17.1/dist/modules/data/pathfinder.js';
|
40
40
|
* console.log(new Pathfinder())
|
41
41
|
* </script>
|
42
42
|
* ```
|
@@ -78,7 +78,7 @@ const WILDCARD = '*';
|
|
78
78
|
*
|
79
79
|
* @example
|
80
80
|
*
|
81
|
-
* import {Pathfinder} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
81
|
+
* import {Pathfinder} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.17.1/dist/modules/data/pathfinder.js';
|
82
82
|
*
|
83
83
|
* let value = new Pathfinder({
|
84
84
|
* a: {
|
@@ -104,7 +104,7 @@ const WILDCARD = '*';
|
|
104
104
|
*
|
105
105
|
* @example
|
106
106
|
*
|
107
|
-
* import {Pathfinder} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
107
|
+
* import {Pathfinder} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.17.1/dist/modules/data/pathfinder.js';
|
108
108
|
*
|
109
109
|
* let p = new Pathfinder({
|
110
110
|
* a: {
|
@@ -126,16 +126,22 @@ const WILDCARD = '*';
|
|
126
126
|
*
|
127
127
|
* @since 1.4.0
|
128
128
|
* @copyright schukai GmbH
|
129
|
-
* @memberOf Monster
|
129
|
+
* @memberOf Monster.Data
|
130
130
|
*/
|
131
131
|
class Pathfinder extends Base {
|
132
132
|
|
133
133
|
/**
|
134
134
|
* @param {array|object|Map|Set} value
|
135
135
|
* @since 1.4.0
|
136
|
+
* @throws {Error} the parameter must not be a simple type
|
136
137
|
**/
|
137
138
|
constructor(object) {
|
138
139
|
super();
|
140
|
+
|
141
|
+
if (isPrimitive(object)) {
|
142
|
+
throw new Error('the parameter must not be a simple type');
|
143
|
+
}
|
144
|
+
|
139
145
|
this.object = object;
|
140
146
|
this.wildCard = WILDCARD;
|
141
147
|
}
|
@@ -398,7 +404,6 @@ function setValueViaPath(object, path, value) {
|
|
398
404
|
assignProperty(anchor, last, value);
|
399
405
|
}
|
400
406
|
|
401
|
-
|
402
407
|
|
403
408
|
}
|
404
409
|
|
@@ -420,7 +425,7 @@ function assignProperty(object, key, value) {
|
|
420
425
|
}
|
421
426
|
|
422
427
|
object[key] = value;
|
423
|
-
|
428
|
+
|
424
429
|
}
|
425
430
|
|
426
431
|
/**
|
@@ -456,6 +461,5 @@ function deleteValueViaPath(object, path) {
|
|
456
461
|
delete anchor[last];
|
457
462
|
}
|
458
463
|
|
459
|
-
|
460
464
|
|
461
465
|
}
|
package/source/data/pipe.js
CHANGED
@@ -19,7 +19,7 @@ const DELIMITER = '|';
|
|
19
19
|
*
|
20
20
|
* ```
|
21
21
|
* <script type="module">
|
22
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
22
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.17.1/dist/modules/data/pipe.js';
|
23
23
|
* console.log(new Monster.Data.Pipe())
|
24
24
|
* </script>
|
25
25
|
* ```
|
@@ -28,7 +28,7 @@ const DELIMITER = '|';
|
|
28
28
|
*
|
29
29
|
* ```
|
30
30
|
* <script type="module">
|
31
|
-
* import {Pipe} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
31
|
+
* import {Pipe} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.17.1/dist/modules/data/pipe.js';
|
32
32
|
* console.log(new Pipe())
|
33
33
|
* </script>
|
34
34
|
* ```
|
@@ -39,7 +39,7 @@ const DELIMITER = '|';
|
|
39
39
|
* the word is then converted to uppercase letters and a prefix Hello is added. the two backslash safe the space char.
|
40
40
|
*
|
41
41
|
* @example
|
42
|
-
* import {Pipe} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
42
|
+
* import {Pipe} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.17.1/dist/modules/data/pipe.js';
|
43
43
|
*
|
44
44
|
* let obj = {
|
45
45
|
* a: {
|
@@ -56,7 +56,7 @@ const DELIMITER = '|';
|
|
56
56
|
*
|
57
57
|
* @since 1.5.0
|
58
58
|
* @copyright schukai GmbH
|
59
|
-
* @memberOf Monster
|
59
|
+
* @memberOf Monster.Data
|
60
60
|
*/
|
61
61
|
class Pipe extends Base {
|
62
62
|
|
@@ -25,7 +25,7 @@ import {Pathfinder} from "./pathfinder.js";
|
|
25
25
|
*
|
26
26
|
* ```
|
27
27
|
* <script type="module">
|
28
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
28
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.17.1/dist/modules/data/transformer.js';
|
29
29
|
* console.log(new Monster.Data.Transformer())
|
30
30
|
* </script>
|
31
31
|
* ```
|
@@ -34,7 +34,7 @@ import {Pathfinder} from "./pathfinder.js";
|
|
34
34
|
*
|
35
35
|
* ```
|
36
36
|
* <script type="module">
|
37
|
-
* import {Transformer} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
37
|
+
* import {Transformer} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.17.1/dist/modules/data/transformer.js';
|
38
38
|
* console.log(new Transformer())
|
39
39
|
* </script>
|
40
40
|
* ```
|
@@ -113,7 +113,7 @@ import {Pathfinder} from "./pathfinder.js";
|
|
113
113
|
*
|
114
114
|
* @example
|
115
115
|
*
|
116
|
-
* import {Transformer} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
116
|
+
* import {Transformer} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.17.1/dist/modules/data/transformer.js';
|
117
117
|
*
|
118
118
|
* const transformer = new Transformer("tolower")
|
119
119
|
*
|
@@ -125,7 +125,7 @@ import {Pathfinder} from "./pathfinder.js";
|
|
125
125
|
*
|
126
126
|
* @since 1.5.0
|
127
127
|
* @copyright schukai GmbH
|
128
|
-
* @memberOf Monster
|
128
|
+
* @memberOf Monster.Data
|
129
129
|
*/
|
130
130
|
class Transformer extends Base {
|
131
131
|
/**
|
package/source/dom/assembler.js
CHANGED
@@ -14,7 +14,7 @@ import {validateInstance, validateString} from "../types/validate.js";
|
|
14
14
|
* attribute prefix
|
15
15
|
*
|
16
16
|
* @type {string}
|
17
|
-
* @memberOf Monster
|
17
|
+
* @memberOf Monster.DOM
|
18
18
|
*/
|
19
19
|
const ATTRIBUTEPREFIX = "data-monster-";
|
20
20
|
|
@@ -23,7 +23,7 @@ const ATTRIBUTEPREFIX = "data-monster-";
|
|
23
23
|
*
|
24
24
|
* ```
|
25
25
|
* <script type="module">
|
26
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
26
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.17.1/dist/modules/dom/assembler.js';
|
27
27
|
* console.log(new Monster.DOM.Assembler())
|
28
28
|
* </script>
|
29
29
|
* ```
|
@@ -32,14 +32,14 @@ const ATTRIBUTEPREFIX = "data-monster-";
|
|
32
32
|
*
|
33
33
|
* ```
|
34
34
|
* <script type="module">
|
35
|
-
* import {Assembler} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
35
|
+
* import {Assembler} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.17.1/dist/modules/dom/assembler.js';
|
36
36
|
* console.log(new Assembler())
|
37
37
|
* </script>
|
38
38
|
* ```
|
39
39
|
*
|
40
40
|
* @since 1.6.0
|
41
41
|
* @copyright schukai GmbH
|
42
|
-
* @memberOf Monster
|
42
|
+
* @memberOf Monster.DOM
|
43
43
|
*/
|
44
44
|
class Assembler extends Base {
|
45
45
|
|
package/source/dom/attributes.js
CHANGED
@@ -20,7 +20,7 @@ import {ATTRIBUTE_OBJECTLINK} from "./constants.js";
|
|
20
20
|
*
|
21
21
|
* ```
|
22
22
|
* <script type="module">
|
23
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
23
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.17.1/dist/modules/dom/updater.js';
|
24
24
|
* console.log(Monster.DOM.findClosestObjectLink())
|
25
25
|
* </script>
|
26
26
|
* ```
|
@@ -29,7 +29,7 @@ import {ATTRIBUTE_OBJECTLINK} from "./constants.js";
|
|
29
29
|
*
|
30
30
|
* ```
|
31
31
|
* <script type="module">
|
32
|
-
* import {getUpdaterFromNode} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
32
|
+
* import {getUpdaterFromNode} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.17.1/dist/modules/dom/updater.js';
|
33
33
|
* console.log(findClosestObjectLink())
|
34
34
|
* </script>
|
35
35
|
* ```
|
@@ -38,7 +38,7 @@ import {ATTRIBUTE_OBJECTLINK} from "./constants.js";
|
|
38
38
|
* @return {HTMLElement|undefined}
|
39
39
|
* @since 1.10.0
|
40
40
|
* @copyright schukai GmbH
|
41
|
-
* @memberOf Monster
|
41
|
+
* @memberOf Monster.DOM
|
42
42
|
* @throws {TypeError} value is not an instance of HTMLElement
|
43
43
|
*/
|
44
44
|
function findClosestObjectLink(element) {
|
@@ -50,7 +50,7 @@ function findClosestObjectLink(element) {
|
|
50
50
|
*
|
51
51
|
* ```
|
52
52
|
* <script type="module">
|
53
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
53
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.17.1/dist/modules/dom/attributes.js';
|
54
54
|
* Monster.DOM.addToObjectLink();
|
55
55
|
* </script>
|
56
56
|
* ```
|
@@ -59,14 +59,14 @@ function findClosestObjectLink(element) {
|
|
59
59
|
*
|
60
60
|
* ```
|
61
61
|
* <script type="module">
|
62
|
-
* import {addToObjectLink} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
62
|
+
* import {addToObjectLink} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.17.1/dist/modules/dom/attributes.js';
|
63
63
|
* addToObjectLink();
|
64
64
|
* </script>
|
65
65
|
* ```
|
66
66
|
*
|
67
67
|
* @since 1.9.0
|
68
68
|
* @copyright schukai GmbH
|
69
|
-
* @memberOf Monster
|
69
|
+
* @memberOf Monster.DOM
|
70
70
|
* @param {HTMLElement} element
|
71
71
|
* @param {Symbol} symbol
|
72
72
|
* @param {Object} object
|
@@ -92,7 +92,7 @@ function addToObjectLink(element, symbol, object) {
|
|
92
92
|
*
|
93
93
|
* ```
|
94
94
|
* <script type="module">
|
95
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
95
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.17.1/dist/modules/dom/attributes.js';
|
96
96
|
* Monster.DOM.removeObjectLink();
|
97
97
|
* </script>
|
98
98
|
* ```
|
@@ -101,14 +101,14 @@ function addToObjectLink(element, symbol, object) {
|
|
101
101
|
*
|
102
102
|
* ```
|
103
103
|
* <script type="module">
|
104
|
-
* import {removeObjectLink} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
104
|
+
* import {removeObjectLink} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.17.1/dist/modules/dom/attributes.js';
|
105
105
|
* removeObjectLink();
|
106
106
|
* </script>
|
107
107
|
* ```
|
108
108
|
*
|
109
109
|
* @since 1.9.0
|
110
110
|
* @copyright schukai GmbH
|
111
|
-
* @memberOf Monster
|
111
|
+
* @memberOf Monster.DOM
|
112
112
|
* @param {HTMLElement} element
|
113
113
|
* @param {Symbol} symbol
|
114
114
|
* @return {boolean}
|
@@ -134,7 +134,7 @@ function removeObjectLink(element, symbol) {
|
|
134
134
|
*
|
135
135
|
* ```
|
136
136
|
* <script type="module">
|
137
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
137
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.17.1/dist/modules/dom/attributes.js';
|
138
138
|
* Monster.DOM.hasObjectLink();
|
139
139
|
* </script>
|
140
140
|
* ```
|
@@ -143,14 +143,14 @@ function removeObjectLink(element, symbol) {
|
|
143
143
|
*
|
144
144
|
* ```
|
145
145
|
* <script type="module">
|
146
|
-
* import {hasObjectLink} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
146
|
+
* import {hasObjectLink} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.17.1/dist/modules/dom/attributes.js';
|
147
147
|
* hasObjectLink();
|
148
148
|
* </script>
|
149
149
|
* ```
|
150
150
|
*
|
151
151
|
* @since 1.9.0
|
152
152
|
* @copyright schukai GmbH
|
153
|
-
* @memberOf Monster
|
153
|
+
* @memberOf Monster.DOM
|
154
154
|
* @param {HTMLElement} element
|
155
155
|
* @param {Symbol} symbol
|
156
156
|
* @return {boolean}
|
@@ -180,7 +180,7 @@ function hasObjectLink(element, symbol) {
|
|
180
180
|
*
|
181
181
|
* ```
|
182
182
|
* <script type="module">
|
183
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
183
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.17.1/dist/modules/dom/attributes.js';
|
184
184
|
* Monster.DOM.getLinkedObjects();
|
185
185
|
* </script>
|
186
186
|
* ```
|
@@ -189,14 +189,14 @@ function hasObjectLink(element, symbol) {
|
|
189
189
|
*
|
190
190
|
* ```
|
191
191
|
* <script type="module">
|
192
|
-
* import {getLinkedObjects} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
192
|
+
* import {getLinkedObjects} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.17.1/dist/modules/dom/attributes.js';
|
193
193
|
* getLinkedObjects();
|
194
194
|
* </script>
|
195
195
|
* ```
|
196
196
|
*
|
197
197
|
* @since 1.9.0
|
198
198
|
* @copyright schukai GmbH
|
199
|
-
* @memberOf Monster
|
199
|
+
* @memberOf Monster.DOM
|
200
200
|
* @param {HTMLElement} element
|
201
201
|
* @param {Symbol} symbol
|
202
202
|
* @return {Iterator}
|
@@ -225,7 +225,7 @@ function getLinkedObjects(element, symbol) {
|
|
225
225
|
*
|
226
226
|
* ```
|
227
227
|
* <script type="module">
|
228
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
228
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.17.1/dist/modules/dom/attributes.js';
|
229
229
|
* Monster.DOM.toggleAttributeToken();
|
230
230
|
* </script>
|
231
231
|
* ```
|
@@ -234,14 +234,14 @@ function getLinkedObjects(element, symbol) {
|
|
234
234
|
*
|
235
235
|
* ```
|
236
236
|
* <script type="module">
|
237
|
-
* import {toggleAttributeToken} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
237
|
+
* import {toggleAttributeToken} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.17.1/dist/modules/dom/attributes.js';
|
238
238
|
* toggleAttributeToken();
|
239
239
|
* </script>
|
240
240
|
* ```
|
241
241
|
*
|
242
242
|
* @since 1.9.0
|
243
243
|
* @copyright schukai GmbH
|
244
|
-
* @memberOf Monster
|
244
|
+
* @memberOf Monster.DOM
|
245
245
|
* @param {HTMLElement} element
|
246
246
|
* @param {string} key
|
247
247
|
* @param {string} token
|
@@ -269,7 +269,7 @@ function toggleAttributeToken(element, key, token) {
|
|
269
269
|
*
|
270
270
|
* ```
|
271
271
|
* <script type="module">
|
272
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
272
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.17.1/dist/modules/dom/attributes.js';
|
273
273
|
* Monster.DOM.addAttributeToken();
|
274
274
|
* </script>
|
275
275
|
* ```
|
@@ -278,14 +278,14 @@ function toggleAttributeToken(element, key, token) {
|
|
278
278
|
*
|
279
279
|
* ```
|
280
280
|
* <script type="module">
|
281
|
-
* import {addAttributeToken} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
281
|
+
* import {addAttributeToken} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.17.1/dist/modules/dom/attributes.js';
|
282
282
|
* addAttributeToken();
|
283
283
|
* </script>
|
284
284
|
* ```
|
285
285
|
*
|
286
286
|
* @since 1.9.0
|
287
287
|
* @copyright schukai GmbH
|
288
|
-
* @memberOf Monster
|
288
|
+
* @memberOf Monster.DOM
|
289
289
|
* @param {HTMLElement} element
|
290
290
|
* @param {string} key
|
291
291
|
* @param {string} token
|
@@ -315,7 +315,7 @@ function addAttributeToken(element, key, token) {
|
|
315
315
|
*
|
316
316
|
* ```
|
317
317
|
* <script type="module">
|
318
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
318
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.17.1/dist/modules/dom/attributes.js';
|
319
319
|
* Monster.DOM.removeAttributeToken();
|
320
320
|
* </script>
|
321
321
|
* ```
|
@@ -324,14 +324,14 @@ function addAttributeToken(element, key, token) {
|
|
324
324
|
*
|
325
325
|
* ```
|
326
326
|
* <script type="module">
|
327
|
-
* import {removeAttributeToken} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
327
|
+
* import {removeAttributeToken} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.17.1/dist/modules/dom/attributes.js';
|
328
328
|
* removeAttributeToken();
|
329
329
|
* </script>
|
330
330
|
* ```
|
331
331
|
*
|
332
332
|
* @since 1.9.0
|
333
333
|
* @copyright schukai GmbH
|
334
|
-
* @memberOf Monster
|
334
|
+
* @memberOf Monster.DOM
|
335
335
|
* @param {HTMLElement} element
|
336
336
|
* @param {string} key
|
337
337
|
* @param {string} token
|
@@ -360,7 +360,7 @@ function removeAttributeToken(element, key, token) {
|
|
360
360
|
*
|
361
361
|
* ```
|
362
362
|
* <script type="module">
|
363
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
363
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.17.1/dist/modules/dom/attributes.js';
|
364
364
|
* Monster.DOM.containsAttributeToken();
|
365
365
|
* </script>
|
366
366
|
* ```
|
@@ -369,14 +369,14 @@ function removeAttributeToken(element, key, token) {
|
|
369
369
|
*
|
370
370
|
* ```
|
371
371
|
* <script type="module">
|
372
|
-
* import {containsAttributeToken} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
372
|
+
* import {containsAttributeToken} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.17.1/dist/modules/dom/attributes.js';
|
373
373
|
* containsAttributeToken();
|
374
374
|
* </script>
|
375
375
|
* ```
|
376
376
|
*
|
377
377
|
* @since 1.9.0
|
378
378
|
* @copyright schukai GmbH
|
379
|
-
* @memberOf Monster
|
379
|
+
* @memberOf Monster.DOM
|
380
380
|
* @param {HTMLElement} element
|
381
381
|
* @param {string} key
|
382
382
|
* @param {string} token
|
@@ -402,7 +402,7 @@ function containsAttributeToken(element, key, token) {
|
|
402
402
|
*
|
403
403
|
* ```
|
404
404
|
* <script type="module">
|
405
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
405
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.17.1/dist/modules/dom/attributes.js';
|
406
406
|
* Monster.DOM.replaceAttributeToken();
|
407
407
|
* </script>
|
408
408
|
* ```
|
@@ -411,14 +411,14 @@ function containsAttributeToken(element, key, token) {
|
|
411
411
|
*
|
412
412
|
* ```
|
413
413
|
* <script type="module">
|
414
|
-
* import {replaceAttributeToken} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
414
|
+
* import {replaceAttributeToken} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.17.1/dist/modules/dom/attributes.js';
|
415
415
|
* replaceAttributeToken();
|
416
416
|
* </script>
|
417
417
|
* ```
|
418
418
|
*
|
419
419
|
* @since 1.9.0
|
420
420
|
* @copyright schukai GmbH
|
421
|
-
* @memberOf Monster
|
421
|
+
* @memberOf Monster.DOM
|
422
422
|
* @param {HTMLElement} element
|
423
423
|
* @param {string} key
|
424
424
|
* @param {string} from
|
@@ -447,7 +447,7 @@ function replaceAttributeToken(element, key, from, to) {
|
|
447
447
|
*
|
448
448
|
* ```
|
449
449
|
* <script type="module">
|
450
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
450
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.17.1/dist/modules/dom/attributes.js';
|
451
451
|
* Monster.DOM.clearAttributeTokens();
|
452
452
|
* </script>
|
453
453
|
* ```
|
@@ -456,14 +456,14 @@ function replaceAttributeToken(element, key, from, to) {
|
|
456
456
|
*
|
457
457
|
* ```
|
458
458
|
* <script type="module">
|
459
|
-
* import {clearAttributeTokens} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
459
|
+
* import {clearAttributeTokens} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.17.1/dist/modules/dom/attributes.js';
|
460
460
|
* clearAttributeTokens();
|
461
461
|
* </script>
|
462
462
|
* ```
|
463
463
|
*
|
464
464
|
* @since 1.9.0
|
465
465
|
* @copyright schukai GmbH
|
466
|
-
* @memberOf Monster
|
466
|
+
* @memberOf Monster.DOM
|
467
467
|
* @param {HTMLElement} element
|
468
468
|
* @param {string} key
|
469
469
|
* @return {HTMLElement}
|
@@ -486,7 +486,7 @@ function clearAttributeTokens(element, key) {
|
|
486
486
|
*
|
487
487
|
* ```
|
488
488
|
* <script type="module">
|
489
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
489
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.17.1/dist/modules/dom/attributes.js';
|
490
490
|
* Monster.DOM.findClosestByAttribute();
|
491
491
|
* </script>
|
492
492
|
* ```
|
@@ -495,24 +495,14 @@ function clearAttributeTokens(element, key) {
|
|
495
495
|
*
|
496
496
|
* ```
|
497
497
|
* <script type="module">
|
498
|
-
* import {
|
498
|
+
* import {findClosestByAttribute} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.17.1/dist/modules/dom/attributes.js';
|
499
499
|
* findClosestByAttribute();
|
500
500
|
* </script>
|
501
501
|
* ```
|
502
502
|
*
|
503
503
|
* @since 1.14.0
|
504
504
|
* @copyright schukai GmbH
|
505
|
-
* @memberOf Monster
|
506
|
-
* @param {HTMLElement} element
|
507
|
-
* @param {string} key
|
508
|
-
* @return {HTMLElement|undefined}
|
509
|
-
* @throws {TypeError} value is not a string
|
510
|
-
* @throws {TypeError} value is not an instance of HTMLElement
|
511
|
-
*/
|
512
|
-
|
513
|
-
/**
|
514
|
-
*
|
515
|
-
* @since 1.14.0
|
505
|
+
* @memberOf Monster.DOM
|
516
506
|
* @param {HTMLElement} element
|
517
507
|
* @param {string} key
|
518
508
|
* @param {string|undefined} value
|
package/source/dom/constants.js
CHANGED
@@ -6,14 +6,16 @@ import {Monster} from '../namespace.js';
|
|
6
6
|
*/
|
7
7
|
|
8
8
|
/**
|
9
|
-
* @memberOf Monster
|
9
|
+
* @memberOf Monster.DOM
|
10
10
|
* @since 1.8.0
|
11
11
|
* @type {string}
|
12
12
|
*/
|
13
13
|
const ATTRIBUTE_PREFIX = 'data-monster-';
|
14
14
|
|
15
15
|
/**
|
16
|
-
*
|
16
|
+
* This is the name of the attribute to pass options to a control
|
17
|
+
*
|
18
|
+
* @memberOf Monster.DOM
|
17
19
|
* @since 1.8.0
|
18
20
|
* @type {string}
|
19
21
|
*/
|
@@ -22,82 +24,82 @@ const ATTRIBUTE_OPTIONS = ATTRIBUTE_PREFIX + 'options';
|
|
22
24
|
|
23
25
|
/**
|
24
26
|
* default theme
|
25
|
-
* @memberOf Monster
|
27
|
+
* @memberOf Monster.DOM
|
26
28
|
* @type {string}
|
27
29
|
*/
|
28
30
|
const DEFAULT_THEME = 'monster';
|
29
31
|
|
30
32
|
/**
|
31
|
-
* @memberOf Monster
|
33
|
+
* @memberOf Monster.DOM
|
32
34
|
* @type {string}
|
33
35
|
* @since 1.8.0
|
34
36
|
*/
|
35
37
|
const ATTRIBUTE_THEME_PREFIX = ATTRIBUTE_PREFIX + 'theme-';
|
36
38
|
|
37
39
|
/**
|
38
|
-
* @memberOf Monster
|
40
|
+
* @memberOf Monster.DOM
|
39
41
|
* @type {string}
|
40
42
|
*/
|
41
43
|
const ATTRIBUTE_THEME_NAME = ATTRIBUTE_THEME_PREFIX + 'name';
|
42
44
|
|
43
45
|
/**
|
44
|
-
* @memberOf Monster
|
46
|
+
* @memberOf Monster.DOM
|
45
47
|
* @type {string}
|
46
48
|
* @since 1.8.0
|
47
49
|
*/
|
48
50
|
const ATTRIBUTE_UPDATER_ATTRIBUTES = ATTRIBUTE_PREFIX + 'attributes';
|
49
51
|
|
50
52
|
/**
|
51
|
-
* @memberOf Monster
|
53
|
+
* @memberOf Monster.DOM
|
52
54
|
* @type {string}
|
53
55
|
* @since 1.8.0
|
54
56
|
*/
|
55
57
|
const ATTRIBUTE_UPDATER_REPLACE = ATTRIBUTE_PREFIX + 'replace';
|
56
58
|
|
57
59
|
/**
|
58
|
-
* @memberOf Monster
|
60
|
+
* @memberOf Monster.DOM
|
59
61
|
* @type {string}
|
60
62
|
* @since 1.8.0
|
61
63
|
*/
|
62
64
|
const ATTRIBUTE_UPDATER_INSERT = ATTRIBUTE_PREFIX + 'insert';
|
63
65
|
|
64
66
|
/**
|
65
|
-
* @memberOf Monster
|
67
|
+
* @memberOf Monster.DOM
|
66
68
|
* @type {string}
|
67
69
|
* @since 1.8.0
|
68
70
|
*/
|
69
71
|
const ATTRIBUTE_UPDATER_INSERT_REFERENCE = ATTRIBUTE_PREFIX + 'insert-reference';
|
70
72
|
|
71
73
|
/**
|
72
|
-
* @memberOf Monster
|
74
|
+
* @memberOf Monster.DOM
|
73
75
|
* @type {string}
|
74
76
|
* @since 1.8.0
|
75
77
|
*/
|
76
78
|
const ATTRIBUTE_UPDATER_REMOVE = ATTRIBUTE_PREFIX + 'remove';
|
77
79
|
|
78
80
|
/**
|
79
|
-
* @memberOf Monster
|
81
|
+
* @memberOf Monster.DOM
|
80
82
|
* @type {string}
|
81
83
|
* @since 1.9.0
|
82
84
|
*/
|
83
85
|
const ATTRIBUTE_UPDATER_BIND = ATTRIBUTE_PREFIX + 'bind';
|
84
86
|
|
85
87
|
/**
|
86
|
-
* @memberOf Monster
|
88
|
+
* @memberOf Monster.DOM
|
87
89
|
* @type {string}
|
88
90
|
* @since 1.14.0
|
89
91
|
*/
|
90
92
|
const ATTRIBUTE_ROLE = ATTRIBUTE_PREFIX + 'role';
|
91
93
|
|
92
94
|
/**
|
93
|
-
* @memberOf Monster
|
95
|
+
* @memberOf Monster.DOM
|
94
96
|
* @type {string}
|
95
97
|
* @since 1.9.0
|
96
98
|
*/
|
97
99
|
const ATTRIBUTE_OBJECTLINK = ATTRIBUTE_PREFIX + 'objectlink';
|
98
100
|
|
99
101
|
/**
|
100
|
-
* @memberOf Monster
|
102
|
+
* @memberOf Monster.DOM
|
101
103
|
* @type {string}
|
102
104
|
* @since 1.10.0
|
103
105
|
*/
|