@schukai/monster 1.26.0 → 1.28.1
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG +36 -1
- 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 +1 -1
- 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/buildtree.js +2 -2
- package/dist/modules/data/datasource/namespace.js +1 -1
- package/dist/modules/data/datasource/restapi/writeerror.js +1 -1
- package/dist/modules/data/datasource/restapi.js +1 -1
- package/dist/modules/data/datasource/storage/localstorage.js +1 -1
- package/dist/modules/data/datasource/storage/namespace.js +1 -1
- package/dist/modules/data/datasource/storage/sessionstorage.js +1 -1
- package/dist/modules/data/datasource/storage.js +1 -1
- package/dist/modules/data/datasource.js +1 -1
- package/dist/modules/data/diff.js +1 -1
- package/dist/modules/data/extend.js +1 -1
- package/dist/modules/data/namespace.js +1 -1
- package/dist/modules/data/pathfinder.js +1 -1
- 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 +2 -2
- package/dist/modules/dom/constants.js +2 -2
- package/dist/modules/dom/customcontrol.js +1 -1
- package/dist/modules/dom/customelement.js +1 -1
- package/dist/modules/dom/events.js +2 -2
- package/dist/modules/dom/focusmanager.js +1 -1
- package/dist/modules/dom/locale.js +1 -1
- package/dist/modules/dom/namespace.js +1 -1
- package/dist/modules/dom/resource/data.js +1 -1
- package/dist/modules/dom/resource/link/stylesheet.js +1 -1
- package/dist/modules/dom/resource/link.js +1 -1
- package/dist/modules/dom/resource/script.js +1 -1
- package/dist/modules/dom/resource.js +1 -1
- package/dist/modules/dom/resourcemanager.js +1 -1
- package/dist/modules/dom/template.js +2 -2
- package/dist/modules/dom/theme.js +1 -1
- package/dist/modules/dom/updater.js +2 -2
- package/dist/modules/dom/util.js +1 -1
- package/dist/modules/dom/worker/factory.js +1 -1
- package/dist/modules/i18n/formatter.js +1 -1
- package/dist/modules/i18n/locale.js +1 -1
- package/dist/modules/i18n/namespace.js +1 -1
- package/dist/modules/i18n/provider.js +1 -1
- package/dist/modules/i18n/providers/fetch.js +1 -1
- package/dist/modules/i18n/providers/namespace.js +1 -1
- package/dist/modules/i18n/translations.js +1 -1
- package/dist/modules/logging/handler/console.js +1 -1
- package/dist/modules/logging/handler/namespace.js +1 -1
- 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 +1 -1
- package/dist/modules/math/namespace.js +1 -1
- 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 +1 -1
- package/dist/modules/types/base.js +1 -1
- package/dist/modules/types/basewithoptions.js +1 -1
- package/dist/modules/types/binary.js +1 -1
- package/dist/modules/types/dataurl.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/mediatype.js +1 -1
- package/dist/modules/types/namespace.js +1 -1
- package/dist/modules/types/node.js +2 -2
- package/dist/modules/types/nodelist.js +2 -2
- package/dist/modules/types/noderecursiveiterator.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/regex.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/uuid.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 +1 -1
- package/dist/modules/util/processing.js +1 -1
- package/dist/modules/util/trimspaces.js +1 -1
- package/dist/monster.dev.js +883 -604
- package/dist/monster.dev.js.map +1 -1
- package/dist/monster.js +2 -2
- package/package.json +1 -1
- package/source/constraints/andoperator.js +5 -5
- package/source/constraints/invalid.js +3 -3
- package/source/constraints/isarray.js +3 -3
- package/source/constraints/isobject.js +3 -3
- package/source/constraints/oroperator.js +5 -5
- package/source/constraints/valid.js +3 -3
- package/source/data/buildmap.js +8 -10
- package/source/data/buildtree.js +51 -17
- package/source/data/datasource/restapi.js +3 -3
- package/source/data/datasource/storage/localstorage.js +2 -2
- package/source/data/datasource/storage/sessionstorage.js +2 -2
- package/source/data/datasource/storage.js +3 -3
- package/source/data/datasource.js +3 -3
- package/source/data/diff.js +3 -3
- package/source/data/extend.js +2 -2
- package/source/data/pathfinder.js +4 -4
- package/source/data/pipe.js +3 -3
- package/source/data/transformer.js +3 -3
- package/source/dom/assembler.js +2 -2
- package/source/dom/attributes.js +111 -28
- package/source/dom/constants.js +17 -1
- package/source/dom/customcontrol.js +1 -1
- package/source/dom/customelement.js +1 -1
- package/source/dom/events.js +68 -12
- package/source/dom/focusmanager.js +2 -2
- package/source/dom/locale.js +2 -2
- package/source/dom/resource/data.js +2 -2
- package/source/dom/resource/link/stylesheet.js +2 -2
- package/source/dom/resource/link.js +2 -2
- package/source/dom/resource/script.js +2 -2
- package/source/dom/resource.js +2 -2
- package/source/dom/resourcemanager.js +2 -2
- package/source/dom/template.js +55 -15
- package/source/dom/theme.js +3 -3
- package/source/dom/updater.js +156 -96
- package/source/dom/util.js +6 -6
- package/source/dom/worker/factory.js +2 -2
- package/source/i18n/formatter.js +4 -4
- package/source/i18n/locale.js +4 -4
- package/source/i18n/provider.js +2 -2
- package/source/i18n/providers/fetch.js +3 -3
- package/source/i18n/translations.js +4 -4
- package/source/logging/handler/console.js +2 -2
- package/source/logging/handler.js +2 -2
- package/source/logging/logentry.js +2 -2
- package/source/logging/logger.js +2 -2
- package/source/math/random.js +2 -2
- package/source/namespace.js +1 -1
- package/source/text/formatter.js +3 -3
- package/source/types/base.js +2 -2
- package/source/types/basewithoptions.js +2 -2
- package/source/types/binary.js +4 -4
- package/source/types/dataurl.js +4 -4
- package/source/types/global.js +4 -4
- package/source/types/id.js +2 -2
- package/source/types/is.js +20 -20
- package/source/types/mediatype.js +4 -4
- package/source/types/node.js +33 -2
- package/source/types/nodelist.js +9 -5
- package/source/types/noderecursiveiterator.js +29 -7
- package/source/types/observer.js +3 -3
- package/source/types/observerlist.js +2 -2
- package/source/types/proxyobserver.js +5 -5
- package/source/types/queue.js +3 -3
- package/source/types/randomid.js +2 -2
- package/source/types/regex.js +2 -2
- package/source/types/stack.js +2 -2
- package/source/types/tokenlist.js +2 -2
- package/source/types/typeof.js +3 -3
- package/source/types/uniquequeue.js +2 -2
- package/source/types/uuid.js +2 -2
- package/source/types/validate.js +20 -20
- package/source/types/version.js +6 -6
- package/source/util/clone.js +2 -2
- package/source/util/comparator.js +3 -3
- package/source/util/freeze.js +2 -2
- package/source/util/processing.js +3 -3
- package/source/util/trimspaces.js +2 -2
- package/test/cases/data/buildtree.js +84 -21
- package/test/cases/dom/attributes.js +29 -6
- package/test/cases/dom/events.js +66 -1
- package/test/cases/dom/template.js +72 -14
- package/test/cases/dom/updater.js +102 -75
- package/test/cases/monster.js +1 -1
- package/test/cases/types/node.js +57 -1
- package/test/cases/types/nodelist.js +7 -0
- package/test/cases/types/noderecursiveiterator.js +21 -0
- package/test/web/monster-dev.html +3 -3
- package/test/web/monster.html +2 -2
- package/test/web/test.html +3 -3
- package/test/web/tests.js +2 -2
package/dist/monster.dev.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
/** Monster 1.
|
1
|
+
/** Monster 1.28.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
|
2
2
|
(function webpackUniversalModuleDefinition(root, factory) {
|
3
3
|
if(typeof exports === 'object' && typeof module === 'object')
|
4
4
|
module.exports = factory();
|
@@ -140,7 +140,7 @@ var Monster = new Namespace("Monster");
|
|
140
140
|
*
|
141
141
|
* ```
|
142
142
|
* <script type="module">
|
143
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
143
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
144
144
|
* function hello() {
|
145
145
|
* console.log('Hello World!');
|
146
146
|
* }
|
@@ -387,7 +387,7 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
387
387
|
*
|
388
388
|
* ```
|
389
389
|
* <script type="module">
|
390
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
390
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
391
391
|
* new Monster.Types.Base()
|
392
392
|
* </script>
|
393
393
|
* ```
|
@@ -396,7 +396,7 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
396
396
|
*
|
397
397
|
* ```
|
398
398
|
* <script type="module">
|
399
|
-
* import {Base} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
399
|
+
* import {Base} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/types/base.js';
|
400
400
|
* new Base()
|
401
401
|
* </script>
|
402
402
|
* ```
|
@@ -568,7 +568,7 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
568
568
|
*
|
569
569
|
* ```
|
570
570
|
* <script type="module">
|
571
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
571
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
572
572
|
* new Monster.Constraint.AndOperator();
|
573
573
|
* </script>
|
574
574
|
* ```
|
@@ -577,16 +577,16 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
577
577
|
*
|
578
578
|
* ```
|
579
579
|
* <script type="module">
|
580
|
-
* import {AndOperator} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
580
|
+
* import {AndOperator} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/constraints/andoperator.js';
|
581
581
|
* new AndOperator();
|
582
582
|
* </script>
|
583
583
|
* ```
|
584
584
|
*
|
585
585
|
* @example
|
586
586
|
*
|
587
|
-
* import {Valid} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
588
|
-
* import {Invalid} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
589
|
-
* import {AndOperator} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
587
|
+
* import {Valid} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/constraints/valid.js';
|
588
|
+
* import {Invalid} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/constraints/invalid.js';
|
589
|
+
* import {AndOperator} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/constraints/andoperator.js';
|
590
590
|
*
|
591
591
|
* new AndOperator(
|
592
592
|
* new Valid(), new Valid()).isValid()
|
@@ -688,7 +688,7 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
688
688
|
*
|
689
689
|
* ```
|
690
690
|
* <script type="module">
|
691
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
691
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
692
692
|
* new Monster.Constraint.Invalid();
|
693
693
|
* </script>
|
694
694
|
* ```
|
@@ -697,14 +697,14 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
697
697
|
*
|
698
698
|
* ```
|
699
699
|
* <script type="module">
|
700
|
-
* import {Invalid} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
700
|
+
* import {Invalid} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/constraints/invalid.js';
|
701
701
|
* new Invalid();
|
702
702
|
* </script>
|
703
703
|
* ```
|
704
704
|
*
|
705
705
|
* @example
|
706
706
|
*
|
707
|
-
* import {Invalid} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
707
|
+
* import {Invalid} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/constraints/invalid.js';
|
708
708
|
*
|
709
709
|
* new Invalid().isValid()
|
710
710
|
* .then(()=>console.log(true))
|
@@ -799,7 +799,7 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
799
799
|
*
|
800
800
|
* ```
|
801
801
|
* <script type="module">
|
802
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
802
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
803
803
|
* new Monster.Constraint.IsArray()
|
804
804
|
* </script>
|
805
805
|
* ```
|
@@ -808,14 +808,14 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
808
808
|
*
|
809
809
|
* ```
|
810
810
|
* <script type="module">
|
811
|
-
* import {IsArray} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
811
|
+
* import {IsArray} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/constraints/isarray.js';
|
812
812
|
* console.log(new IsArray())
|
813
813
|
* </script>
|
814
814
|
* ```
|
815
815
|
*
|
816
816
|
* @example
|
817
817
|
*
|
818
|
-
* import {IsArray} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
818
|
+
* import {IsArray} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/constraints/isarray.js';
|
819
819
|
*
|
820
820
|
* new IsArray()
|
821
821
|
* .isValid([])
|
@@ -904,7 +904,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
904
904
|
*
|
905
905
|
* ```
|
906
906
|
* <script type="module">
|
907
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
907
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
908
908
|
* Monster.Types.isIterable(null) // ↦ false
|
909
909
|
* Monster.Types.isIterable('hello') // ↦ true
|
910
910
|
* Monster.Types.isIterable([]) // ↦ true
|
@@ -915,7 +915,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
915
915
|
*
|
916
916
|
* ```
|
917
917
|
* <script type="module">
|
918
|
-
* import {isIterable} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
918
|
+
* import {isIterable} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/types/is.js';
|
919
919
|
* isIterable(null) // ↦ false
|
920
920
|
* isIterable('hello') // ↦ true
|
921
921
|
* isIterable([]) // ↦ true
|
@@ -943,7 +943,7 @@ function isIterable(value) {
|
|
943
943
|
*
|
944
944
|
* ```
|
945
945
|
* <script type="module">
|
946
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
946
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
947
947
|
* Monster.Types.isPrimitive('2') // ↦ false
|
948
948
|
* Monster.Types.isPrimitive([]) // ↦ true
|
949
949
|
* </script>
|
@@ -953,7 +953,7 @@ function isIterable(value) {
|
|
953
953
|
*
|
954
954
|
* ```
|
955
955
|
* <script type="module">
|
956
|
-
* import {isPrimitive} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
956
|
+
* import {isPrimitive} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/types/is.js';
|
957
957
|
* isPrimitive('2')) // ↦ true
|
958
958
|
* isPrimitive([])) // ↦ false
|
959
959
|
* </script>
|
@@ -991,7 +991,7 @@ function isPrimitive(value) {
|
|
991
991
|
*
|
992
992
|
* ```
|
993
993
|
* <script type="module">
|
994
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
994
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
995
995
|
* Monster.Types.isSymbol('2') // ↦ false
|
996
996
|
* Monster.Types.isSymbol(Symbol('test') // ↦ true
|
997
997
|
* </script>
|
@@ -1001,7 +1001,7 @@ function isPrimitive(value) {
|
|
1001
1001
|
*
|
1002
1002
|
* ```
|
1003
1003
|
* <script type="module">
|
1004
|
-
* import {isSymbol} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
1004
|
+
* import {isSymbol} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/types/is.js';
|
1005
1005
|
* isSymbol(Symbol('a'))) // ↦ true
|
1006
1006
|
* isSymbol([]) // ↦ false
|
1007
1007
|
* </script>
|
@@ -1027,7 +1027,7 @@ function isSymbol(value) {
|
|
1027
1027
|
*
|
1028
1028
|
* ```
|
1029
1029
|
* <script type="module">
|
1030
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
1030
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
1031
1031
|
* Monster.Types.isBoolean('2') // ↦ false
|
1032
1032
|
* Monster.Types.isBoolean([]) // ↦ false
|
1033
1033
|
* Monster.Types.isBoolean(true) // ↦ true
|
@@ -1038,7 +1038,7 @@ function isSymbol(value) {
|
|
1038
1038
|
*
|
1039
1039
|
* ```
|
1040
1040
|
* <script type="module">
|
1041
|
-
* import {isBoolean} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
1041
|
+
* import {isBoolean} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/types/is.js';
|
1042
1042
|
* isBoolean('2')) // ↦ false
|
1043
1043
|
* isBoolean([])) // ↦ false
|
1044
1044
|
* isBoolean(2>4)) // ↦ true
|
@@ -1069,7 +1069,7 @@ function isBoolean(value) {
|
|
1069
1069
|
*
|
1070
1070
|
* ```
|
1071
1071
|
* <script type="module">
|
1072
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
1072
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
1073
1073
|
* Monster.Types.isString('2') // ↦ true
|
1074
1074
|
* Monster.Types.isString([]) // ↦ false
|
1075
1075
|
* </script>
|
@@ -1079,7 +1079,7 @@ function isBoolean(value) {
|
|
1079
1079
|
*
|
1080
1080
|
* ```
|
1081
1081
|
* <script type="module">
|
1082
|
-
* import {isString} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
1082
|
+
* import {isString} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/types/is.js';
|
1083
1083
|
* isString('2')) // ↦ true
|
1084
1084
|
* isString([])) // ↦ false
|
1085
1085
|
* </script>
|
@@ -1109,7 +1109,7 @@ function isString(value) {
|
|
1109
1109
|
*
|
1110
1110
|
* ```
|
1111
1111
|
* <script type="module">
|
1112
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
1112
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
1113
1113
|
* Monster.Types.isObject('2') // ↦ false
|
1114
1114
|
* Monster.Types.isObject([]) // ↦ false
|
1115
1115
|
* Monster.Types.isObject({}) // ↦ true
|
@@ -1120,7 +1120,7 @@ function isString(value) {
|
|
1120
1120
|
*
|
1121
1121
|
* ```
|
1122
1122
|
* <script type="module">
|
1123
|
-
* import {isObject} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
1123
|
+
* import {isObject} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/types/is.js';
|
1124
1124
|
* isObject('2')) // ↦ false
|
1125
1125
|
* isObject([])) // ↦ false
|
1126
1126
|
* </script>
|
@@ -1153,7 +1153,7 @@ function isObject(value) {
|
|
1153
1153
|
*
|
1154
1154
|
* ```
|
1155
1155
|
* <script type="module">
|
1156
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
1156
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
1157
1157
|
* Monster.Types.isInstance('2') // ↦ false
|
1158
1158
|
* Monster.Types.isInstance([]) // ↦ false
|
1159
1159
|
* Monster.Types.isInstance({}) // ↦ true
|
@@ -1164,7 +1164,7 @@ function isObject(value) {
|
|
1164
1164
|
*
|
1165
1165
|
* ```
|
1166
1166
|
* <script type="module">
|
1167
|
-
* import {isInstance} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
1167
|
+
* import {isInstance} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/types/is.js';
|
1168
1168
|
* isInstance('2')) // ↦ false
|
1169
1169
|
* isInstance([])) // ↦ false
|
1170
1170
|
* </script>
|
@@ -1194,7 +1194,7 @@ function isInstance(value, instance) {
|
|
1194
1194
|
*
|
1195
1195
|
* ```
|
1196
1196
|
* <script type="module">
|
1197
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
1197
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
1198
1198
|
* Monster.Types.isArray('2') // ↦ false
|
1199
1199
|
* Monster.Types.isArray([]) // ↦ true
|
1200
1200
|
* </script>
|
@@ -1204,7 +1204,7 @@ function isInstance(value, instance) {
|
|
1204
1204
|
*
|
1205
1205
|
* ```
|
1206
1206
|
* <script type="module">
|
1207
|
-
* import {isArray} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
1207
|
+
* import {isArray} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/types/is.js';
|
1208
1208
|
* isArray('2')) // ↦ false
|
1209
1209
|
* isArray([])) // ↦ true
|
1210
1210
|
* </script>
|
@@ -1231,7 +1231,7 @@ function isArray(value) {
|
|
1231
1231
|
*
|
1232
1232
|
* ```
|
1233
1233
|
* <script type="module">
|
1234
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
1234
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
1235
1235
|
* Monster.Types.isFunction(()=>{}) // ↦ true
|
1236
1236
|
* Monster.Types.isFunction('2') // ↦ false
|
1237
1237
|
* Monster.Types.isFunction([]) // ↦ false
|
@@ -1242,7 +1242,7 @@ function isArray(value) {
|
|
1242
1242
|
*
|
1243
1243
|
* ```
|
1244
1244
|
* <script type="module">
|
1245
|
-
* import {isFunction} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
1245
|
+
* import {isFunction} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/types/is.js';
|
1246
1246
|
* isFunction(()=>{}) // ↦ true
|
1247
1247
|
* isFunction('2')) // ↦ false
|
1248
1248
|
* isFunction([])) // ↦ false
|
@@ -1276,7 +1276,7 @@ function isFunction(value) {
|
|
1276
1276
|
*
|
1277
1277
|
* ```
|
1278
1278
|
* <script type="module">
|
1279
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
1279
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
1280
1280
|
* Monster.Types.isInteger(()=>{}) // ↦ true
|
1281
1281
|
* Monster.Types.isInteger('2') // ↦ false
|
1282
1282
|
* Monster.Types.isInteger(2) // ↦ true
|
@@ -1287,7 +1287,7 @@ function isFunction(value) {
|
|
1287
1287
|
*
|
1288
1288
|
* ```
|
1289
1289
|
* <script type="module">
|
1290
|
-
* import {isInteger} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
1290
|
+
* import {isInteger} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/types/is.js';
|
1291
1291
|
* isInteger(()=>{}) // ↦ true
|
1292
1292
|
* isInteger('2')) // ↦ false
|
1293
1293
|
* isInteger(2)) // ↦ true
|
@@ -1360,7 +1360,7 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
1360
1360
|
*
|
1361
1361
|
* ```
|
1362
1362
|
* <script type="module">
|
1363
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
1363
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
1364
1364
|
* console.log(new Monster.Constraint.IsObject())
|
1365
1365
|
* </script>
|
1366
1366
|
* ```
|
@@ -1369,14 +1369,14 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
1369
1369
|
*
|
1370
1370
|
* ```
|
1371
1371
|
* <script type="module">
|
1372
|
-
* import {IsObject} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
1372
|
+
* import {IsObject} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/constraints/isobject.js';
|
1373
1373
|
* console.log(new IsObject())
|
1374
1374
|
* </script>
|
1375
1375
|
* ```
|
1376
1376
|
*
|
1377
1377
|
* @example
|
1378
1378
|
*
|
1379
|
-
* import {IsObject} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
1379
|
+
* import {IsObject} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/constraints/isobject.js';
|
1380
1380
|
*
|
1381
1381
|
* new IsObject()
|
1382
1382
|
* .isValid({})
|
@@ -1479,7 +1479,7 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
1479
1479
|
*
|
1480
1480
|
* ```
|
1481
1481
|
* <script type="module">
|
1482
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
1482
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
1483
1483
|
* new Monster.Constraint.OrOperator();
|
1484
1484
|
* </script>
|
1485
1485
|
* ```
|
@@ -1488,16 +1488,16 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
1488
1488
|
*
|
1489
1489
|
* ```
|
1490
1490
|
* <script type="module">
|
1491
|
-
* import {OrOperator} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
1491
|
+
* import {OrOperator} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/constraint/oroperator.js';
|
1492
1492
|
* new OrOperator();
|
1493
1493
|
* </script>
|
1494
1494
|
* ```
|
1495
1495
|
*
|
1496
1496
|
* @example
|
1497
1497
|
*
|
1498
|
-
* import {Valid} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
1499
|
-
* import {Invalid} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
1500
|
-
* import {OrOperator} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
1498
|
+
* import {Valid} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/constraints/valid.js';
|
1499
|
+
* import {Invalid} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/constraints/invalid.js';
|
1500
|
+
* import {OrOperator} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/constraints/oroperator.js';
|
1501
1501
|
*
|
1502
1502
|
* new OrOperator(
|
1503
1503
|
* new Valid(), new Invalid()).isValid()
|
@@ -1622,7 +1622,7 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
1622
1622
|
*
|
1623
1623
|
* ```
|
1624
1624
|
* <script type="module">
|
1625
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
1625
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
1626
1626
|
* new Monster.Constraint.Valid();
|
1627
1627
|
* </script>
|
1628
1628
|
* ```
|
@@ -1631,14 +1631,14 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
1631
1631
|
*
|
1632
1632
|
* ```
|
1633
1633
|
* <script type="module">
|
1634
|
-
* import {Valid} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
1634
|
+
* import {Valid} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/constraints/valid.js';
|
1635
1635
|
* new Valid();
|
1636
1636
|
* </script>
|
1637
1637
|
* ```
|
1638
1638
|
*
|
1639
1639
|
* @example
|
1640
1640
|
*
|
1641
|
-
* import {Valid} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
1641
|
+
* import {Valid} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/constraints/valid.js';
|
1642
1642
|
*
|
1643
1643
|
* new Valid().isValid()
|
1644
1644
|
* .then(()=>console.log(true))
|
@@ -1747,7 +1747,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
1747
1747
|
*
|
1748
1748
|
* ```
|
1749
1749
|
* <script type="module">
|
1750
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
1750
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
1751
1751
|
* console.log(Monster.Data.buildMap())
|
1752
1752
|
* </script>
|
1753
1753
|
* ```
|
@@ -1756,7 +1756,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
1756
1756
|
*
|
1757
1757
|
* ```
|
1758
1758
|
* <script type="module">
|
1759
|
-
* import {buildMap} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
1759
|
+
* import {buildMap} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/data/buildmap.js';
|
1760
1760
|
* console.log(buildMap())
|
1761
1761
|
* </script>
|
1762
1762
|
* ```
|
@@ -1767,7 +1767,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
1767
1767
|
*
|
1768
1768
|
* @example
|
1769
1769
|
*
|
1770
|
-
* import {buildMap} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
1770
|
+
* import {buildMap} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/data/buildmap.js';
|
1771
1771
|
* // a typical data structure as reported by an api
|
1772
1772
|
*
|
1773
1773
|
* let map;
|
@@ -1859,7 +1859,7 @@ function buildMap(subject, selector, valueTemplate, keyTemplate, filter) {
|
|
1859
1859
|
* @param {string|Monster.Data~exampleSelectorCallback} selector
|
1860
1860
|
* @param {Monster.Data~exampleFilterCallback} [filter]
|
1861
1861
|
* @param {function} callback
|
1862
|
-
* @return {
|
1862
|
+
* @return {Map}
|
1863
1863
|
*/
|
1864
1864
|
|
1865
1865
|
|
@@ -1943,7 +1943,7 @@ function buildFlatMap(subject, selector, key, parentMap) {
|
|
1943
1943
|
var kk = copyKey.join(_pathfinder_js__WEBPACK_IMPORTED_MODULE_4__.DELIMITER);
|
1944
1944
|
var sub = buildFlatMap.call(result, o, parts.join(_pathfinder_js__WEBPACK_IMPORTED_MODULE_4__.DELIMITER), copyKey, o);
|
1945
1945
|
|
1946
|
-
if ((0,_types_is_js__WEBPACK_IMPORTED_MODULE_1__.isObject)(sub)) {
|
1946
|
+
if ((0,_types_is_js__WEBPACK_IMPORTED_MODULE_1__.isObject)(sub) && parentMap !== undefined) {
|
1947
1947
|
sub['^'] = parentMap;
|
1948
1948
|
}
|
1949
1949
|
|
@@ -1997,7 +1997,7 @@ function buildFlatMap(subject, selector, key, parentMap) {
|
|
1997
1997
|
* Alternatively to a string selector a callback can be specified. this must return a map.
|
1998
1998
|
*
|
1999
1999
|
* @example
|
2000
|
-
* import {buildMap} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
2000
|
+
* import {buildMap} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/data/buildmap.js';
|
2001
2001
|
*
|
2002
2002
|
* let obj = {
|
2003
2003
|
* "data": [
|
@@ -2200,7 +2200,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
2200
2200
|
*
|
2201
2201
|
* ```
|
2202
2202
|
* <script type="module">
|
2203
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
2203
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
2204
2204
|
* console.log(Monster.Types.validateIterable('2')) // ↦ TypeError
|
2205
2205
|
* console.log(Monster.Types.validateIterable([])) // ↦ value
|
2206
2206
|
* </script>
|
@@ -2210,7 +2210,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
2210
2210
|
*
|
2211
2211
|
* ```
|
2212
2212
|
* <script type="module">
|
2213
|
-
* import {validateIterable} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
2213
|
+
* import {validateIterable} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/types/validate.js';
|
2214
2214
|
* console.log(validateIterable('2')) // ↦ TypeError
|
2215
2215
|
* console.log(validateIterable([])) // ↦ value
|
2216
2216
|
* </script>
|
@@ -2241,7 +2241,7 @@ function validateIterable(value) {
|
|
2241
2241
|
*
|
2242
2242
|
* ```
|
2243
2243
|
* <script type="module">
|
2244
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
2244
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
2245
2245
|
* console.log(Monster.Types.validatePrimitive('2')) // ↦ value
|
2246
2246
|
* console.log(Monster.Types.validatePrimitive([])) // ↦ TypeError
|
2247
2247
|
* </script>
|
@@ -2251,7 +2251,7 @@ function validateIterable(value) {
|
|
2251
2251
|
*
|
2252
2252
|
* ```
|
2253
2253
|
* <script type="module">
|
2254
|
-
* import {validatePrimitive} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
2254
|
+
* import {validatePrimitive} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/types/validate.js';
|
2255
2255
|
* console.log(validatePrimitive('2')) // ↦ value
|
2256
2256
|
* console.log(validatePrimitive([])) // ↦ TypeError
|
2257
2257
|
* </script>
|
@@ -2283,7 +2283,7 @@ function validatePrimitive(value) {
|
|
2283
2283
|
*
|
2284
2284
|
* ```
|
2285
2285
|
* <script type="module">
|
2286
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
2286
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
2287
2287
|
* console.log(Monster.Types.validateBoolean(true)) // ↦ value
|
2288
2288
|
* console.log(Monster.Types.validateBoolean('2')) // ↦ TypeError
|
2289
2289
|
* console.log(Monster.Types.validateBoolean([])) // ↦ TypeError
|
@@ -2294,7 +2294,7 @@ function validatePrimitive(value) {
|
|
2294
2294
|
*
|
2295
2295
|
* ```
|
2296
2296
|
* <script type="module">
|
2297
|
-
* import {validateBoolean} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
2297
|
+
* import {validateBoolean} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/types/validate.js';
|
2298
2298
|
* console.log(validateBoolean(false)) // ↦ value
|
2299
2299
|
* console.log(validateBoolean('2')) // ↦ TypeError
|
2300
2300
|
* console.log(validateBoolean([])) // ↦ TypeError
|
@@ -2325,7 +2325,7 @@ function validateBoolean(value) {
|
|
2325
2325
|
*
|
2326
2326
|
* ```
|
2327
2327
|
* <script type="module">
|
2328
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
2328
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
2329
2329
|
* console.log(Monster.Types.validateString('2')) // ↦ value
|
2330
2330
|
* console.log(Monster.Types.validateString([])) // ↦ TypeError
|
2331
2331
|
* </script>
|
@@ -2335,7 +2335,7 @@ function validateBoolean(value) {
|
|
2335
2335
|
*
|
2336
2336
|
* ```
|
2337
2337
|
* <script type="module">
|
2338
|
-
* import {validateString} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
2338
|
+
* import {validateString} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/types/validate.js';
|
2339
2339
|
* console.log(validateString('2')) // ↦ value
|
2340
2340
|
* console.log(validateString([])) // ↦ TypeError
|
2341
2341
|
* </script>
|
@@ -2364,7 +2364,7 @@ function validateString(value) {
|
|
2364
2364
|
*
|
2365
2365
|
* ```
|
2366
2366
|
* <script type="module">
|
2367
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
2367
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
2368
2368
|
* console.log(Monster.Types.validateObject({})) // ↦ value
|
2369
2369
|
* console.log(Monster.Types.validateObject('2')) // ↦ TypeError
|
2370
2370
|
* console.log(Monster.Types.validateObject([])) // ↦ TypeError
|
@@ -2375,7 +2375,7 @@ function validateString(value) {
|
|
2375
2375
|
*
|
2376
2376
|
* ```
|
2377
2377
|
* <script type="module">
|
2378
|
-
* import {validateObject} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
2378
|
+
* import {validateObject} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/types/validate.js';
|
2379
2379
|
* console.log(validateObject({})) // ↦ value
|
2380
2380
|
* console.log(validateObject('2')) // ↦ TypeError
|
2381
2381
|
* console.log(validateObject([])) // ↦ TypeError
|
@@ -2405,7 +2405,7 @@ function validateObject(value) {
|
|
2405
2405
|
*
|
2406
2406
|
* ```
|
2407
2407
|
* <script type="module">
|
2408
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
2408
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
2409
2409
|
* console.log(Monster.Types.validateInstance({}, Object)) // ↦ value
|
2410
2410
|
* console.log(Monster.Types.validateInstance('2', Object)) // ↦ TypeError
|
2411
2411
|
* console.log(Monster.Types.validateInstance([], Object)) // ↦ TypeError
|
@@ -2416,7 +2416,7 @@ function validateObject(value) {
|
|
2416
2416
|
*
|
2417
2417
|
* ```
|
2418
2418
|
* <script type="module">
|
2419
|
-
* import {validateInstance} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
2419
|
+
* import {validateInstance} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/types/validate.js';
|
2420
2420
|
* console.log(validateInstance({}, Object)) // ↦ value
|
2421
2421
|
* console.log(validateInstance('2', Object)) // ↦ TypeError
|
2422
2422
|
* console.log(validateInstance([], Object)) // ↦ TypeError
|
@@ -2456,7 +2456,7 @@ function validateInstance(value, instance) {
|
|
2456
2456
|
*
|
2457
2457
|
* ```
|
2458
2458
|
* <script type="module">
|
2459
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
2459
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
2460
2460
|
* console.log(Monster.Types.validateArray('2')) // ↦ TypeError
|
2461
2461
|
* console.log(Monster.Types.validateArray([])) // ↦ value
|
2462
2462
|
* </script>
|
@@ -2466,7 +2466,7 @@ function validateInstance(value, instance) {
|
|
2466
2466
|
*
|
2467
2467
|
* ```
|
2468
2468
|
* <script type="module">
|
2469
|
-
* import {validateArray} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
2469
|
+
* import {validateArray} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/types/validate.js';
|
2470
2470
|
* console.log(validateArray('2')) // ↦ TypeError
|
2471
2471
|
* console.log(validateArray([])) // ↦ value
|
2472
2472
|
* </script>
|
@@ -2495,7 +2495,7 @@ function validateArray(value) {
|
|
2495
2495
|
*
|
2496
2496
|
* ```
|
2497
2497
|
* <script type="module">
|
2498
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
2498
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
2499
2499
|
* console.log(Monster.Types.validateSymbol('2')) // ↦ TypeError
|
2500
2500
|
* console.log(Monster.Types.validateSymbol([])) // ↦ value
|
2501
2501
|
* </script>
|
@@ -2505,7 +2505,7 @@ function validateArray(value) {
|
|
2505
2505
|
*
|
2506
2506
|
* ```
|
2507
2507
|
* <script type="module">
|
2508
|
-
* import {validateSymbol} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
2508
|
+
* import {validateSymbol} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/types/validate.js';
|
2509
2509
|
* console.log(validateSymbol('2')) // ↦ TypeError
|
2510
2510
|
* console.log(validateSymbol()) // ↦ value
|
2511
2511
|
* </script>
|
@@ -2534,7 +2534,7 @@ function validateSymbol(value) {
|
|
2534
2534
|
*
|
2535
2535
|
* ```
|
2536
2536
|
* <script type="module">
|
2537
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
2537
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
2538
2538
|
* console.log(Monster.Types.validateFunction(()=>{})) // ↦ value
|
2539
2539
|
* console.log(Monster.Types.validateFunction('2')) // ↦ TypeError
|
2540
2540
|
* console.log(Monster.Types.validateFunction([])) // ↦ TypeError
|
@@ -2545,7 +2545,7 @@ function validateSymbol(value) {
|
|
2545
2545
|
*
|
2546
2546
|
* ```
|
2547
2547
|
* <script type="module">
|
2548
|
-
* import {validateFunction} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
2548
|
+
* import {validateFunction} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/types/validate.js';
|
2549
2549
|
* console.log(validateFunction(()=>{})) // ↦ value
|
2550
2550
|
* console.log(validateFunction('2')) // ↦ TypeError
|
2551
2551
|
* console.log(validateFunction([])) // ↦ TypeError
|
@@ -2575,7 +2575,7 @@ function validateFunction(value) {
|
|
2575
2575
|
*
|
2576
2576
|
* ```
|
2577
2577
|
* <script type="module">
|
2578
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
2578
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
2579
2579
|
* console.log(Monster.Types.validateInteger(true)) // ↦ TypeError
|
2580
2580
|
* console.log(Monster.Types.validateInteger('2')) // ↦ TypeError
|
2581
2581
|
* console.log(Monster.Types.validateInteger(2)) // ↦ value
|
@@ -2586,7 +2586,7 @@ function validateFunction(value) {
|
|
2586
2586
|
*
|
2587
2587
|
* ```
|
2588
2588
|
* <script type="module">
|
2589
|
-
* import {validateFunction} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
2589
|
+
* import {validateFunction} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/types/validate.js';
|
2590
2590
|
* console.log(validateInteger(true)) // ↦ TypeError
|
2591
2591
|
* console.log(validateInteger('2')) // ↦ TypeError
|
2592
2592
|
* console.log(validateInteger(2)) // ↦ value
|
@@ -2652,7 +2652,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
2652
2652
|
*
|
2653
2653
|
* ```
|
2654
2654
|
* <script type="module">
|
2655
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
2655
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
2656
2656
|
* Monster.Util.clone({})
|
2657
2657
|
* </script>
|
2658
2658
|
* ```
|
@@ -2661,7 +2661,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
2661
2661
|
*
|
2662
2662
|
* ```
|
2663
2663
|
* <script type="module">
|
2664
|
-
* import {clone} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
2664
|
+
* import {clone} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/util/clone.js';
|
2665
2665
|
* clone({})
|
2666
2666
|
* </script>
|
2667
2667
|
* ```
|
@@ -2873,7 +2873,7 @@ function getGlobal() {
|
|
2873
2873
|
*
|
2874
2874
|
* ```
|
2875
2875
|
* <script type="module">
|
2876
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
2876
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
2877
2877
|
* Monster.Types.getGlobalObject('document')
|
2878
2878
|
* // ↦ { }
|
2879
2879
|
* </script>
|
@@ -2883,7 +2883,7 @@ function getGlobal() {
|
|
2883
2883
|
*
|
2884
2884
|
* ```
|
2885
2885
|
* <script type="module">
|
2886
|
-
* import {getGlobalObject} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
2886
|
+
* import {getGlobalObject} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/types/global.js';
|
2887
2887
|
* getGlobalObject('document')
|
2888
2888
|
* // ↦ { }
|
2889
2889
|
* </script>
|
@@ -2915,7 +2915,7 @@ function getGlobalObject(name) {
|
|
2915
2915
|
*
|
2916
2916
|
* ```
|
2917
2917
|
* <script type="module">
|
2918
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
2918
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
2919
2919
|
* console.log(Monster.Types.getGlobalFunction('parseInt')) // ↦ f parseInt() { }
|
2920
2920
|
* </script>
|
2921
2921
|
* ```
|
@@ -2924,7 +2924,7 @@ function getGlobalObject(name) {
|
|
2924
2924
|
*
|
2925
2925
|
* ```
|
2926
2926
|
* <script type="module">
|
2927
|
-
* import {getGlobalFunction} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
2927
|
+
* import {getGlobalFunction} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/types/global.js';
|
2928
2928
|
* console.log(getGlobalFunction('parseInt')) // ↦ f parseInt() { }
|
2929
2929
|
* </script>
|
2930
2930
|
* ```
|
@@ -2975,7 +2975,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
2975
2975
|
*
|
2976
2976
|
* ```
|
2977
2977
|
* <script type="module">
|
2978
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
2978
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
2979
2979
|
* console.log(Monster.Types.typeOf())
|
2980
2980
|
* </script>
|
2981
2981
|
* ```
|
@@ -2984,14 +2984,14 @@ __webpack_require__.r(__webpack_exports__);
|
|
2984
2984
|
*
|
2985
2985
|
* ```
|
2986
2986
|
* <script type="module">
|
2987
|
-
* import {typeOf} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
2987
|
+
* import {typeOf} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/types/typeof.js';
|
2988
2988
|
* console.log(typeOf())
|
2989
2989
|
* </script>
|
2990
2990
|
* ```
|
2991
2991
|
*
|
2992
2992
|
* @example
|
2993
2993
|
*
|
2994
|
-
* import {typeOf} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
2994
|
+
* import {typeOf} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/types/typeof.js';
|
2995
2995
|
*
|
2996
2996
|
* console.log(typeOf(undefined)); // ↦ undefined
|
2997
2997
|
* console.log(typeOf("")); // ↦ string
|
@@ -3110,7 +3110,7 @@ var WILDCARD = '*';
|
|
3110
3110
|
*
|
3111
3111
|
* ```
|
3112
3112
|
* <script type="module">
|
3113
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
3113
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
3114
3114
|
* console.log(new Monster.Data.Pathfinder())
|
3115
3115
|
* </script>
|
3116
3116
|
* ```
|
@@ -3119,7 +3119,7 @@ var WILDCARD = '*';
|
|
3119
3119
|
*
|
3120
3120
|
* ```
|
3121
3121
|
* <script type="module">
|
3122
|
-
* import {Pathfinder} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
3122
|
+
* import {Pathfinder} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/data/pathfinder.js';
|
3123
3123
|
* console.log(new Pathfinder())
|
3124
3124
|
* </script>
|
3125
3125
|
* ```
|
@@ -3161,7 +3161,7 @@ var WILDCARD = '*';
|
|
3161
3161
|
*
|
3162
3162
|
* @example
|
3163
3163
|
*
|
3164
|
-
* import {Pathfinder} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
3164
|
+
* import {Pathfinder} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/data/pathfinder.js';
|
3165
3165
|
*
|
3166
3166
|
* let value = new Pathfinder({
|
3167
3167
|
* a: {
|
@@ -3187,7 +3187,7 @@ var WILDCARD = '*';
|
|
3187
3187
|
*
|
3188
3188
|
* @example
|
3189
3189
|
*
|
3190
|
-
* import {Pathfinder} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
3190
|
+
* import {Pathfinder} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/data/pathfinder.js';
|
3191
3191
|
*
|
3192
3192
|
* let p = new Pathfinder({
|
3193
3193
|
* a: {
|
@@ -3602,7 +3602,7 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
3602
3602
|
*
|
3603
3603
|
* ```
|
3604
3604
|
* <script type="module">
|
3605
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
3605
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
3606
3606
|
* console.log(new Monster.Types.Stack())
|
3607
3607
|
* </script>
|
3608
3608
|
* ```
|
@@ -3611,7 +3611,7 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
3611
3611
|
*
|
3612
3612
|
* ```
|
3613
3613
|
* <script type="module">
|
3614
|
-
* import {ID} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
3614
|
+
* import {ID} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/types/stack.js';
|
3615
3615
|
* console.log(new Stack())
|
3616
3616
|
* </script>
|
3617
3617
|
* ```
|
@@ -3746,7 +3746,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
3746
3746
|
*
|
3747
3747
|
* ```
|
3748
3748
|
* <script type="module">
|
3749
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
3749
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
3750
3750
|
* Monster.Data.Diff(a, b)
|
3751
3751
|
* </script>
|
3752
3752
|
* ```
|
@@ -3755,14 +3755,14 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
3755
3755
|
*
|
3756
3756
|
* ```
|
3757
3757
|
* <script type="module">
|
3758
|
-
* import {Diff} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
3758
|
+
* import {Diff} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/data/diff.js';
|
3759
3759
|
* Diff(a, b)
|
3760
3760
|
* </script>
|
3761
3761
|
* ```
|
3762
3762
|
*
|
3763
3763
|
* @example
|
3764
3764
|
*
|
3765
|
-
* import {Diff} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
3765
|
+
* import {Diff} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/data/diff.js';
|
3766
3766
|
*
|
3767
3767
|
* // given are two objects x and y.
|
3768
3768
|
*
|
@@ -4008,7 +4008,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
4008
4008
|
*
|
4009
4009
|
* ```
|
4010
4010
|
* <script type="module">
|
4011
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
4011
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
4012
4012
|
* Monster.Data.extend(a, b)
|
4013
4013
|
* </script>
|
4014
4014
|
* ```
|
@@ -4017,7 +4017,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
4017
4017
|
*
|
4018
4018
|
* ```
|
4019
4019
|
* <script type="module">
|
4020
|
-
* import {extend} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
4020
|
+
* import {extend} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/data/extend.js';
|
4021
4021
|
* extend(a, b)
|
4022
4022
|
* </script>
|
4023
4023
|
* ```
|
@@ -4146,7 +4146,7 @@ var DELIMITER = '|';
|
|
4146
4146
|
*
|
4147
4147
|
* ```
|
4148
4148
|
* <script type="module">
|
4149
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
4149
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
4150
4150
|
* new Monster.Data.Pipe()
|
4151
4151
|
* </script>
|
4152
4152
|
* ```
|
@@ -4155,7 +4155,7 @@ var DELIMITER = '|';
|
|
4155
4155
|
*
|
4156
4156
|
* ```
|
4157
4157
|
* <script type="module">
|
4158
|
-
* import {Pipe} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
4158
|
+
* import {Pipe} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/data/pipe.js';
|
4159
4159
|
* new Pipe()
|
4160
4160
|
* </script>
|
4161
4161
|
* ```
|
@@ -4166,7 +4166,7 @@ var DELIMITER = '|';
|
|
4166
4166
|
* the word is then converted to uppercase letters and a prefix Hello is added. the two backslash safe the space char.
|
4167
4167
|
*
|
4168
4168
|
* @example
|
4169
|
-
* import {Pipe} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
4169
|
+
* import {Pipe} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/data/pipe.js';
|
4170
4170
|
*
|
4171
4171
|
* let obj = {
|
4172
4172
|
* a: {
|
@@ -4328,7 +4328,7 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
4328
4328
|
*
|
4329
4329
|
* ```
|
4330
4330
|
* <script type="module">
|
4331
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
4331
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
4332
4332
|
* new Monster.Data.Transformer()
|
4333
4333
|
* </script>
|
4334
4334
|
* ```
|
@@ -4337,7 +4337,7 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
4337
4337
|
*
|
4338
4338
|
* ```
|
4339
4339
|
* <script type="module">
|
4340
|
-
* import {Transformer} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
4340
|
+
* import {Transformer} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/data/transformer.js';
|
4341
4341
|
* new Transformer()
|
4342
4342
|
* </script>
|
4343
4343
|
* ```
|
@@ -4423,7 +4423,7 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
4423
4423
|
*
|
4424
4424
|
* @example
|
4425
4425
|
*
|
4426
|
-
* import {Transformer} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
4426
|
+
* import {Transformer} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/data/transformer.js';
|
4427
4427
|
*
|
4428
4428
|
* const transformer = new Transformer("tolower")
|
4429
4429
|
*
|
@@ -4956,7 +4956,7 @@ var internalCounter = new Map();
|
|
4956
4956
|
*
|
4957
4957
|
* ```
|
4958
4958
|
* <script type="module">
|
4959
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
4959
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
4960
4960
|
* console.log(new Monster.Types.ID())
|
4961
4961
|
* </script>
|
4962
4962
|
* ```
|
@@ -4965,7 +4965,7 @@ var internalCounter = new Map();
|
|
4965
4965
|
*
|
4966
4966
|
* ```
|
4967
4967
|
* <script type="module">
|
4968
|
-
* import {ID} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
4968
|
+
* import {ID} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/types/id.js';
|
4969
4969
|
* console.log(new ID())
|
4970
4970
|
* </script>
|
4971
4971
|
* ```
|
@@ -5088,7 +5088,7 @@ var ATTRIBUTEPREFIX = "data-monster-";
|
|
5088
5088
|
*
|
5089
5089
|
* ```
|
5090
5090
|
* <script type="module">
|
5091
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
5091
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
5092
5092
|
* console.log(new Monster.DOM.Assembler())
|
5093
5093
|
* </script>
|
5094
5094
|
* ```
|
@@ -5097,7 +5097,7 @@ var ATTRIBUTEPREFIX = "data-monster-";
|
|
5097
5097
|
*
|
5098
5098
|
* ```
|
5099
5099
|
* <script type="module">
|
5100
|
-
* import {Assembler} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
5100
|
+
* import {Assembler} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/dom/assembler.js';
|
5101
5101
|
* console.log(new Assembler())
|
5102
5102
|
* </script>
|
5103
5103
|
* ```
|
@@ -5238,7 +5238,7 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
5238
5238
|
*
|
5239
5239
|
* ```
|
5240
5240
|
* <script type="module">
|
5241
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
5241
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
5242
5242
|
* new Monster.Types.ProxyObserver()
|
5243
5243
|
* </script>
|
5244
5244
|
* ```
|
@@ -5247,7 +5247,7 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
5247
5247
|
*
|
5248
5248
|
* ```
|
5249
5249
|
* <script type="module">
|
5250
|
-
* import {ProxyObserver} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
5250
|
+
* import {ProxyObserver} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/types/proxyobserver.js';
|
5251
5251
|
* new ProxyObserver()
|
5252
5252
|
* </script>
|
5253
5253
|
* ```
|
@@ -5258,9 +5258,9 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
5258
5258
|
*
|
5259
5259
|
* @example
|
5260
5260
|
*
|
5261
|
-
* import {ProxyObserver} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
5262
|
-
* import {Observer} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
5263
|
-
* import {isObject} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
5261
|
+
* import {ProxyObserver} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/types/proxyobserver.js';
|
5262
|
+
* import {Observer} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/types/observer.js';
|
5263
|
+
* import {isObject} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/types/is.js';
|
5264
5264
|
*
|
5265
5265
|
* const o = new Observer(function () {
|
5266
5266
|
* if (isObject(this) && this instanceof ProxyObserver) {
|
@@ -5586,7 +5586,7 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
5586
5586
|
*
|
5587
5587
|
* ```
|
5588
5588
|
* <script type="module">
|
5589
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
5589
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
5590
5590
|
* console.log(new Monster.Types.Observer())
|
5591
5591
|
* </script>
|
5592
5592
|
* ```
|
@@ -5595,7 +5595,7 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
5595
5595
|
*
|
5596
5596
|
* ```
|
5597
5597
|
* <script type="module">
|
5598
|
-
* import {Observer} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
5598
|
+
* import {Observer} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/types/observer.js';
|
5599
5599
|
* console.log(new Observer())
|
5600
5600
|
* </script>
|
5601
5601
|
* ```
|
@@ -5629,7 +5629,7 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
5629
5629
|
*
|
5630
5630
|
* @example
|
5631
5631
|
*
|
5632
|
-
* import {Observer} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
5632
|
+
* import {Observer} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/types/observer.js';
|
5633
5633
|
*
|
5634
5634
|
* const observer = new Observer(function(a, b, c) {
|
5635
5635
|
* console.log(this, a, b, c); // ↦ "a", 2, true
|
@@ -5829,7 +5829,7 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
5829
5829
|
*
|
5830
5830
|
* ```
|
5831
5831
|
* <script type="module">
|
5832
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
5832
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
5833
5833
|
* new Monster.Types.TokenList("myclass row")
|
5834
5834
|
* </script>
|
5835
5835
|
* ```
|
@@ -5838,7 +5838,7 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
5838
5838
|
*
|
5839
5839
|
* ```
|
5840
5840
|
* <script type="module">
|
5841
|
-
* import {TokenList} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
5841
|
+
* import {TokenList} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/types/tokenlist.js';
|
5842
5842
|
* new TokenList("myclass row")
|
5843
5843
|
* </script>
|
5844
5844
|
* ```
|
@@ -6261,7 +6261,7 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
6261
6261
|
*
|
6262
6262
|
* ```
|
6263
6263
|
* <script type="module">
|
6264
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
6264
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
6265
6265
|
* new Monster.Types.UniqueQueue()
|
6266
6266
|
* </script>
|
6267
6267
|
* ```
|
@@ -6270,7 +6270,7 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
6270
6270
|
*
|
6271
6271
|
* ```
|
6272
6272
|
* <script type="module">
|
6273
|
-
* import {UniqueQueue} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
6273
|
+
* import {UniqueQueue} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/types/uniquequeue.js';
|
6274
6274
|
* new UniqueQueue()
|
6275
6275
|
* </script>
|
6276
6276
|
* ```
|
@@ -6405,7 +6405,7 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
6405
6405
|
*
|
6406
6406
|
* ```
|
6407
6407
|
* <script type="module">
|
6408
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
6408
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
6409
6409
|
* new Monster.Types.Queue()
|
6410
6410
|
* </script>
|
6411
6411
|
* ```
|
@@ -6414,14 +6414,14 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
6414
6414
|
*
|
6415
6415
|
* ```
|
6416
6416
|
* <script type="module">
|
6417
|
-
* import {Queue} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
6417
|
+
* import {Queue} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/types/queue.js';
|
6418
6418
|
* new Queue()
|
6419
6419
|
* </script>
|
6420
6420
|
* ```
|
6421
6421
|
*
|
6422
6422
|
* @example
|
6423
6423
|
*
|
6424
|
-
* import {Queue} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
6424
|
+
* import {Queue} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/types/queue.js';
|
6425
6425
|
*
|
6426
6426
|
* const queue = new Queue;
|
6427
6427
|
*
|
@@ -6590,7 +6590,7 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
6590
6590
|
*
|
6591
6591
|
* ```
|
6592
6592
|
* <script type="module">
|
6593
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
6593
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
6594
6594
|
* console.log(new Monster.Types.ObserverList())
|
6595
6595
|
* console.log(new Monster.Types.ObserverList())
|
6596
6596
|
* </script>
|
@@ -6600,7 +6600,7 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
6600
6600
|
*
|
6601
6601
|
* ```
|
6602
6602
|
* <script type="module">
|
6603
|
-
* import {ObserverList} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
6603
|
+
* import {ObserverList} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/types/observerlist.js';
|
6604
6604
|
* console.log(ObserverList())
|
6605
6605
|
* console.log(ObserverList())
|
6606
6606
|
* </script>
|
@@ -6732,7 +6732,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
6732
6732
|
/* harmony export */ "addAttributeToken": function() { return /* binding */ addAttributeToken; },
|
6733
6733
|
/* harmony export */ "toggleAttributeToken": function() { return /* binding */ toggleAttributeToken; },
|
6734
6734
|
/* harmony export */ "getLinkedObjects": function() { return /* binding */ getLinkedObjects; },
|
6735
|
-
/* harmony export */ "findClosestObjectLink": function() { return /* binding */ findClosestObjectLink; }
|
6735
|
+
/* harmony export */ "findClosestObjectLink": function() { return /* binding */ findClosestObjectLink; },
|
6736
|
+
/* harmony export */ "findClosestByClass": function() { return /* binding */ findClosestByClass; }
|
6736
6737
|
/* harmony export */ });
|
6737
6738
|
/* harmony import */ var _namespace_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
|
6738
6739
|
/* harmony import */ var _types_global_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(16);
|
@@ -6759,7 +6760,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
6759
6760
|
*
|
6760
6761
|
* ```
|
6761
6762
|
* <script type="module">
|
6762
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
6763
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
6763
6764
|
* console.log(Monster.DOM.findClosestObjectLink())
|
6764
6765
|
* </script>
|
6765
6766
|
* ```
|
@@ -6768,7 +6769,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
6768
6769
|
*
|
6769
6770
|
* ```
|
6770
6771
|
* <script type="module">
|
6771
|
-
* import {getUpdaterFromNode} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
6772
|
+
* import {getUpdaterFromNode} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/dom/updater.js';
|
6772
6773
|
* console.log(findClosestObjectLink())
|
6773
6774
|
* </script>
|
6774
6775
|
* ```
|
@@ -6789,7 +6790,7 @@ function findClosestObjectLink(element) {
|
|
6789
6790
|
*
|
6790
6791
|
* ```
|
6791
6792
|
* <script type="module">
|
6792
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
6793
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
6793
6794
|
* Monster.DOM.addToObjectLink();
|
6794
6795
|
* </script>
|
6795
6796
|
* ```
|
@@ -6798,7 +6799,7 @@ function findClosestObjectLink(element) {
|
|
6798
6799
|
*
|
6799
6800
|
* ```
|
6800
6801
|
* <script type="module">
|
6801
|
-
* import {addToObjectLink} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
6802
|
+
* import {addToObjectLink} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/dom/attributes.js';
|
6802
6803
|
* addToObjectLink();
|
6803
6804
|
* </script>
|
6804
6805
|
* ```
|
@@ -6830,7 +6831,7 @@ function addToObjectLink(element, symbol, object) {
|
|
6830
6831
|
*
|
6831
6832
|
* ```
|
6832
6833
|
* <script type="module">
|
6833
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
6834
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
6834
6835
|
* Monster.DOM.removeObjectLink();
|
6835
6836
|
* </script>
|
6836
6837
|
* ```
|
@@ -6839,7 +6840,7 @@ function addToObjectLink(element, symbol, object) {
|
|
6839
6840
|
*
|
6840
6841
|
* ```
|
6841
6842
|
* <script type="module">
|
6842
|
-
* import {removeObjectLink} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
6843
|
+
* import {removeObjectLink} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/dom/attributes.js';
|
6843
6844
|
* removeObjectLink();
|
6844
6845
|
* </script>
|
6845
6846
|
* ```
|
@@ -6870,7 +6871,7 @@ function removeObjectLink(element, symbol) {
|
|
6870
6871
|
*
|
6871
6872
|
* ```
|
6872
6873
|
* <script type="module">
|
6873
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
6874
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
6874
6875
|
* Monster.DOM.hasObjectLink();
|
6875
6876
|
* </script>
|
6876
6877
|
* ```
|
@@ -6879,7 +6880,7 @@ function removeObjectLink(element, symbol) {
|
|
6879
6880
|
*
|
6880
6881
|
* ```
|
6881
6882
|
* <script type="module">
|
6882
|
-
* import {hasObjectLink} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
6883
|
+
* import {hasObjectLink} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/dom/attributes.js';
|
6883
6884
|
* hasObjectLink();
|
6884
6885
|
* </script>
|
6885
6886
|
* ```
|
@@ -6915,7 +6916,7 @@ function hasObjectLink(element, symbol) {
|
|
6915
6916
|
*
|
6916
6917
|
* ```
|
6917
6918
|
* <script type="module">
|
6918
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
6919
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
6919
6920
|
* Monster.DOM.getLinkedObjects();
|
6920
6921
|
* </script>
|
6921
6922
|
* ```
|
@@ -6924,7 +6925,7 @@ function hasObjectLink(element, symbol) {
|
|
6924
6925
|
*
|
6925
6926
|
* ```
|
6926
6927
|
* <script type="module">
|
6927
|
-
* import {getLinkedObjects} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
6928
|
+
* import {getLinkedObjects} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/dom/attributes.js';
|
6928
6929
|
* getLinkedObjects();
|
6929
6930
|
* </script>
|
6930
6931
|
* ```
|
@@ -6958,7 +6959,7 @@ function getLinkedObjects(element, symbol) {
|
|
6958
6959
|
*
|
6959
6960
|
* ```
|
6960
6961
|
* <script type="module">
|
6961
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
6962
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
6962
6963
|
* Monster.DOM.toggleAttributeToken();
|
6963
6964
|
* </script>
|
6964
6965
|
* ```
|
@@ -6967,7 +6968,7 @@ function getLinkedObjects(element, symbol) {
|
|
6967
6968
|
*
|
6968
6969
|
* ```
|
6969
6970
|
* <script type="module">
|
6970
|
-
* import {toggleAttributeToken} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
6971
|
+
* import {toggleAttributeToken} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/dom/attributes.js';
|
6971
6972
|
* toggleAttributeToken();
|
6972
6973
|
* </script>
|
6973
6974
|
* ```
|
@@ -7002,7 +7003,7 @@ function toggleAttributeToken(element, key, token) {
|
|
7002
7003
|
*
|
7003
7004
|
* ```
|
7004
7005
|
* <script type="module">
|
7005
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
7006
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
7006
7007
|
* Monster.DOM.addAttributeToken();
|
7007
7008
|
* </script>
|
7008
7009
|
* ```
|
@@ -7011,7 +7012,7 @@ function toggleAttributeToken(element, key, token) {
|
|
7011
7012
|
*
|
7012
7013
|
* ```
|
7013
7014
|
* <script type="module">
|
7014
|
-
* import {addAttributeToken} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
7015
|
+
* import {addAttributeToken} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/dom/attributes.js';
|
7015
7016
|
* addAttributeToken();
|
7016
7017
|
* </script>
|
7017
7018
|
* ```
|
@@ -7048,7 +7049,7 @@ function addAttributeToken(element, key, token) {
|
|
7048
7049
|
*
|
7049
7050
|
* ```
|
7050
7051
|
* <script type="module">
|
7051
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
7052
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
7052
7053
|
* Monster.DOM.removeAttributeToken();
|
7053
7054
|
* </script>
|
7054
7055
|
* ```
|
@@ -7057,7 +7058,7 @@ function addAttributeToken(element, key, token) {
|
|
7057
7058
|
*
|
7058
7059
|
* ```
|
7059
7060
|
* <script type="module">
|
7060
|
-
* import {removeAttributeToken} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
7061
|
+
* import {removeAttributeToken} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/dom/attributes.js';
|
7061
7062
|
* removeAttributeToken();
|
7062
7063
|
* </script>
|
7063
7064
|
* ```
|
@@ -7093,7 +7094,7 @@ function removeAttributeToken(element, key, token) {
|
|
7093
7094
|
*
|
7094
7095
|
* ```
|
7095
7096
|
* <script type="module">
|
7096
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
7097
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
7097
7098
|
* Monster.DOM.containsAttributeToken();
|
7098
7099
|
* </script>
|
7099
7100
|
* ```
|
@@ -7102,7 +7103,7 @@ function removeAttributeToken(element, key, token) {
|
|
7102
7103
|
*
|
7103
7104
|
* ```
|
7104
7105
|
* <script type="module">
|
7105
|
-
* import {containsAttributeToken} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
7106
|
+
* import {containsAttributeToken} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/dom/attributes.js';
|
7106
7107
|
* containsAttributeToken();
|
7107
7108
|
* </script>
|
7108
7109
|
* ```
|
@@ -7135,7 +7136,7 @@ function containsAttributeToken(element, key, token) {
|
|
7135
7136
|
*
|
7136
7137
|
* ```
|
7137
7138
|
* <script type="module">
|
7138
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
7139
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
7139
7140
|
* Monster.DOM.replaceAttributeToken();
|
7140
7141
|
* </script>
|
7141
7142
|
* ```
|
@@ -7144,7 +7145,7 @@ function containsAttributeToken(element, key, token) {
|
|
7144
7145
|
*
|
7145
7146
|
* ```
|
7146
7147
|
* <script type="module">
|
7147
|
-
* import {replaceAttributeToken} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
7148
|
+
* import {replaceAttributeToken} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/dom/attributes.js';
|
7148
7149
|
* replaceAttributeToken();
|
7149
7150
|
* </script>
|
7150
7151
|
* ```
|
@@ -7180,7 +7181,7 @@ function replaceAttributeToken(element, key, from, to) {
|
|
7180
7181
|
*
|
7181
7182
|
* ```
|
7182
7183
|
* <script type="module">
|
7183
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
7184
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
7184
7185
|
* Monster.DOM.clearAttributeTokens();
|
7185
7186
|
* </script>
|
7186
7187
|
* ```
|
@@ -7189,7 +7190,7 @@ function replaceAttributeToken(element, key, from, to) {
|
|
7189
7190
|
*
|
7190
7191
|
* ```
|
7191
7192
|
* <script type="module">
|
7192
|
-
* import {clearAttributeTokens} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
7193
|
+
* import {clearAttributeTokens} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/dom/attributes.js';
|
7193
7194
|
* clearAttributeTokens();
|
7194
7195
|
* </script>
|
7195
7196
|
* ```
|
@@ -7215,11 +7216,29 @@ function clearAttributeTokens(element, key) {
|
|
7215
7216
|
return element;
|
7216
7217
|
}
|
7217
7218
|
/**
|
7219
|
+
* This function searches, starting from an `HTMLElemement`, for the next element that has a certain attribute.
|
7220
|
+
*
|
7221
|
+
* ```html
|
7222
|
+
* <div data-my-attribute="2" id="2">
|
7223
|
+
* <div id="1"></div>
|
7224
|
+
* </div>
|
7225
|
+
* ```
|
7226
|
+
*
|
7227
|
+
* ```javascript
|
7228
|
+
* // if no value is specified (undefined), then only the attribute is checked.
|
7229
|
+
* findClosestByAttribute(document.getElementById('1'),'data-my-attribute'); // ↦ node with id 2
|
7230
|
+
* findClosestByAttribute(document.getElementById('2'),'data-my-attribute'); // ↦ node with id 2
|
7231
|
+
*
|
7232
|
+
* // if a value is specified, for example an empty string, then the name and the value are checked.
|
7233
|
+
* findClosestByAttribute(document.getElementById('1'),'data-my-attribute', ''); // ↦ undefined
|
7234
|
+
* findClosestByAttribute(document.getElementById('1'),'data-my-attribute', '2'); // ↦ node with id 2
|
7235
|
+
* ```
|
7236
|
+
*
|
7218
7237
|
* You can call the method via the monster namespace `new Monster.DOM.findClosestByAttribute()`.
|
7219
7238
|
*
|
7220
7239
|
* ```
|
7221
7240
|
* <script type="module">
|
7222
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
7241
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
7223
7242
|
* Monster.DOM.findClosestByAttribute();
|
7224
7243
|
* </script>
|
7225
7244
|
* ```
|
@@ -7228,7 +7247,7 @@ function clearAttributeTokens(element, key) {
|
|
7228
7247
|
*
|
7229
7248
|
* ```
|
7230
7249
|
* <script type="module">
|
7231
|
-
* import {findClosestByAttribute} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
7250
|
+
* import {findClosestByAttribute} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/dom/attributes.js';
|
7232
7251
|
* findClosestByAttribute();
|
7233
7252
|
* </script>
|
7234
7253
|
* ```
|
@@ -7240,14 +7259,21 @@ function clearAttributeTokens(element, key) {
|
|
7240
7259
|
* @param {string} key
|
7241
7260
|
* @param {string|undefined} value
|
7242
7261
|
* @return {HTMLElement|undefined}
|
7262
|
+
* @summary find closest node
|
7243
7263
|
*/
|
7244
7264
|
|
7245
7265
|
|
7246
7266
|
function findClosestByAttribute(element, key, value) {
|
7247
7267
|
(0,_types_validate_js__WEBPACK_IMPORTED_MODULE_3__.validateInstance)(element, (0,_types_global_js__WEBPACK_IMPORTED_MODULE_1__.getGlobalFunction)('HTMLElement'));
|
7248
7268
|
|
7249
|
-
if (element.hasAttribute(key)
|
7250
|
-
|
7269
|
+
if (element.hasAttribute(key)) {
|
7270
|
+
if (value === undefined) {
|
7271
|
+
return element;
|
7272
|
+
}
|
7273
|
+
|
7274
|
+
if (element.getAttribute(key) === value) {
|
7275
|
+
return element;
|
7276
|
+
}
|
7251
7277
|
}
|
7252
7278
|
|
7253
7279
|
var selector = (0,_types_validate_js__WEBPACK_IMPORTED_MODULE_3__.validateString)(key);
|
@@ -7258,11 +7284,71 @@ function findClosestByAttribute(element, key, value) {
|
|
7258
7284
|
return result;
|
7259
7285
|
}
|
7260
7286
|
|
7287
|
+
return undefined;
|
7288
|
+
}
|
7289
|
+
/**
|
7290
|
+
* This function searches, starting from an `HTMLElemement`, for the next element that has a certain attribute.
|
7291
|
+
*
|
7292
|
+
* ```html
|
7293
|
+
* <div class="myclass" id="2">
|
7294
|
+
* <div id="1"></div>
|
7295
|
+
* </div>
|
7296
|
+
* ```
|
7297
|
+
*
|
7298
|
+
* ```javascript
|
7299
|
+
* // if no value is specified (undefined), then only the attribute is checked.
|
7300
|
+
* findClosestByClass(document.getElementById('1'),'myclass'); // ↦ node with id 2
|
7301
|
+
* findClosestByClass(document.getElementById('2'),'myclass'); // ↦ node with id 2
|
7302
|
+
* ```
|
7303
|
+
*
|
7304
|
+
* You can call the method via the monster namespace `new Monster.DOM.findClosestByClass()`.
|
7305
|
+
*
|
7306
|
+
* ```
|
7307
|
+
* <script type="module">
|
7308
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
7309
|
+
* Monster.DOM.findClosestByClass();
|
7310
|
+
* </script>
|
7311
|
+
* ```
|
7312
|
+
*
|
7313
|
+
* Alternatively, you can also integrate this function individually.
|
7314
|
+
*
|
7315
|
+
* ```
|
7316
|
+
* <script type="module">
|
7317
|
+
* import {findClosestByClass} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/dom/attributes.js';
|
7318
|
+
* findClosestByClass();
|
7319
|
+
* </script>
|
7320
|
+
* ```
|
7321
|
+
*
|
7322
|
+
* @since 1.27.0
|
7323
|
+
* @copyright schukai GmbH
|
7324
|
+
* @memberOf Monster.DOM
|
7325
|
+
* @param {HTMLElement} element
|
7326
|
+
* @param {string} className
|
7327
|
+
* @return {HTMLElement|undefined}
|
7328
|
+
* @summary find closest node
|
7329
|
+
*/
|
7330
|
+
|
7331
|
+
|
7332
|
+
function findClosestByClass(element, className) {
|
7333
|
+
var _element$classList;
|
7334
|
+
|
7335
|
+
(0,_types_validate_js__WEBPACK_IMPORTED_MODULE_3__.validateInstance)(element, (0,_types_global_js__WEBPACK_IMPORTED_MODULE_1__.getGlobalFunction)('HTMLElement'));
|
7336
|
+
|
7337
|
+
if (element !== null && element !== void 0 && (_element$classList = element.classList) !== null && _element$classList !== void 0 && _element$classList.contains((0,_types_validate_js__WEBPACK_IMPORTED_MODULE_3__.validateString)(className))) {
|
7338
|
+
return element;
|
7339
|
+
}
|
7340
|
+
|
7341
|
+
var result = element.closest('.' + className);
|
7342
|
+
|
7343
|
+
if (result instanceof HTMLElement) {
|
7344
|
+
return result;
|
7345
|
+
}
|
7346
|
+
|
7261
7347
|
return undefined;
|
7262
7348
|
} // exports
|
7263
7349
|
|
7264
7350
|
|
7265
|
-
(0,_namespace_js__WEBPACK_IMPORTED_MODULE_0__.assignToNamespace)('Monster.DOM', getLinkedObjects, addToObjectLink, removeObjectLink, findClosestByAttribute, hasObjectLink, clearAttributeTokens, replaceAttributeToken, containsAttributeToken, removeAttributeToken, addAttributeToken, toggleAttributeToken);
|
7351
|
+
(0,_namespace_js__WEBPACK_IMPORTED_MODULE_0__.assignToNamespace)('Monster.DOM', findClosestByClass, getLinkedObjects, addToObjectLink, removeObjectLink, findClosestByAttribute, hasObjectLink, clearAttributeTokens, replaceAttributeToken, containsAttributeToken, removeAttributeToken, addAttributeToken, toggleAttributeToken);
|
7266
7352
|
|
7267
7353
|
|
7268
7354
|
/***/ }),
|
@@ -7320,7 +7406,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
7320
7406
|
/* harmony export */ "ATTRIBUTE_DISABLED": function() { return /* binding */ ATTRIBUTE_DISABLED; },
|
7321
7407
|
/* harmony export */ "ATTRIBUTE_ERRORMESSAGE": function() { return /* binding */ ATTRIBUTE_ERRORMESSAGE; },
|
7322
7408
|
/* harmony export */ "ATTRIBUTE_VALUE": function() { return /* binding */ ATTRIBUTE_VALUE; },
|
7323
|
-
/* harmony export */ "objectUpdaterLinkSymbol": function() { return /* binding */ objectUpdaterLinkSymbol; }
|
7409
|
+
/* harmony export */ "objectUpdaterLinkSymbol": function() { return /* binding */ objectUpdaterLinkSymbol; },
|
7410
|
+
/* harmony export */ "ATTRIBUTE_TEMPLATE_PREFIX": function() { return /* binding */ ATTRIBUTE_TEMPLATE_PREFIX; },
|
7411
|
+
/* harmony export */ "ATTRIBUTE_UPDATER_SELECT_THIS": function() { return /* binding */ ATTRIBUTE_UPDATER_SELECT_THIS; }
|
7324
7412
|
/* harmony export */ });
|
7325
7413
|
/* harmony import */ var _namespace_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
|
7326
7414
|
|
@@ -7373,6 +7461,13 @@ var ATTRIBUTE_THEME_NAME = ATTRIBUTE_THEME_PREFIX + 'name';
|
|
7373
7461
|
*/
|
7374
7462
|
|
7375
7463
|
var ATTRIBUTE_UPDATER_ATTRIBUTES = ATTRIBUTE_PREFIX + 'attributes';
|
7464
|
+
/**
|
7465
|
+
* @memberOf Monster.DOM
|
7466
|
+
* @type {string}
|
7467
|
+
* @since 1.27.1
|
7468
|
+
*/
|
7469
|
+
|
7470
|
+
var ATTRIBUTE_UPDATER_SELECT_THIS = ATTRIBUTE_PREFIX + 'select-this';
|
7376
7471
|
/**
|
7377
7472
|
* @memberOf Monster.DOM
|
7378
7473
|
* @type {string}
|
@@ -7408,6 +7503,13 @@ var ATTRIBUTE_UPDATER_REMOVE = ATTRIBUTE_PREFIX + 'remove';
|
|
7408
7503
|
*/
|
7409
7504
|
|
7410
7505
|
var ATTRIBUTE_UPDATER_BIND = ATTRIBUTE_PREFIX + 'bind';
|
7506
|
+
/**
|
7507
|
+
* @memberOf Monster.DOM
|
7508
|
+
* @type {string}
|
7509
|
+
* @since 1.27.0
|
7510
|
+
*/
|
7511
|
+
|
7512
|
+
var ATTRIBUTE_TEMPLATE_PREFIX = ATTRIBUTE_PREFIX + 'template-prefix';
|
7411
7513
|
/**
|
7412
7514
|
* @memberOf Monster.DOM
|
7413
7515
|
* @type {string}
|
@@ -7746,7 +7848,7 @@ var attachedInternalSymbol = Symbol('attachedInternal');
|
|
7746
7848
|
*
|
7747
7849
|
* ```
|
7748
7850
|
* <script type="module">
|
7749
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
7851
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
7750
7852
|
* document.createElement('monster-')
|
7751
7853
|
* </script>
|
7752
7854
|
* ```
|
@@ -8281,7 +8383,7 @@ var attributeObserverSymbol = Symbol('attributeObserver');
|
|
8281
8383
|
*
|
8282
8384
|
* ```
|
8283
8385
|
* <script type="module">
|
8284
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
8386
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
8285
8387
|
* document.createElement('monster-')
|
8286
8388
|
* </script>
|
8287
8389
|
* ```
|
@@ -9147,7 +9249,7 @@ var internal = Symbol('internal');
|
|
9147
9249
|
*
|
9148
9250
|
* ```
|
9149
9251
|
* <script type="module">
|
9150
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
9252
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
9151
9253
|
* new Monster.Types.DataUrl()
|
9152
9254
|
* </script>
|
9153
9255
|
* ```
|
@@ -9156,7 +9258,7 @@ var internal = Symbol('internal');
|
|
9156
9258
|
*
|
9157
9259
|
* ```
|
9158
9260
|
* <script type="module">
|
9159
|
-
* import {DataUrl} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
9261
|
+
* import {DataUrl} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/types/dataurl.js';
|
9160
9262
|
* new DataUrl()
|
9161
9263
|
* </script>
|
9162
9264
|
* ```
|
@@ -9236,7 +9338,7 @@ var DataUrl = /*#__PURE__*/function (_Base) {
|
|
9236
9338
|
*
|
9237
9339
|
* ```
|
9238
9340
|
* <script type="module">
|
9239
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
9341
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
9240
9342
|
* console.log(Monster.Types.parseDataURL())
|
9241
9343
|
* </script>
|
9242
9344
|
* ```
|
@@ -9245,7 +9347,7 @@ var DataUrl = /*#__PURE__*/function (_Base) {
|
|
9245
9347
|
*
|
9246
9348
|
* ```
|
9247
9349
|
* <script type="module">
|
9248
|
-
* import {parseDataURL} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
9350
|
+
* import {parseDataURL} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/types/dataurl.js';
|
9249
9351
|
* console.log(parseDataURL())
|
9250
9352
|
* </script>
|
9251
9353
|
* ```
|
@@ -9383,7 +9485,7 @@ var internal = Symbol('internal');
|
|
9383
9485
|
*
|
9384
9486
|
* ```
|
9385
9487
|
* <script type="module">
|
9386
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
9488
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
9387
9489
|
* console.log(new Monster.Types.MediaType())
|
9388
9490
|
* </script>
|
9389
9491
|
* ```
|
@@ -9392,7 +9494,7 @@ var internal = Symbol('internal');
|
|
9392
9494
|
*
|
9393
9495
|
* ```
|
9394
9496
|
* <script type="module">
|
9395
|
-
* import {MediaType} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
9497
|
+
* import {MediaType} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/types/mediatype.js';
|
9396
9498
|
* console.log(new MediaType())
|
9397
9499
|
* </script>
|
9398
9500
|
* ```
|
@@ -9510,7 +9612,7 @@ var MediaType = /*#__PURE__*/function (_Base) {
|
|
9510
9612
|
*
|
9511
9613
|
* ```
|
9512
9614
|
* <script type="module">
|
9513
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
9615
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
9514
9616
|
* console.log(Monster.Types.parseMediaType())
|
9515
9617
|
* </script>
|
9516
9618
|
* ```
|
@@ -9519,7 +9621,7 @@ var MediaType = /*#__PURE__*/function (_Base) {
|
|
9519
9621
|
*
|
9520
9622
|
* ```
|
9521
9623
|
* <script type="module">
|
9522
|
-
* import {parseMediaType} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
9624
|
+
* import {parseMediaType} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/types/dataurl.js';
|
9523
9625
|
* console.log(parseMediaType())
|
9524
9626
|
* </script>
|
9525
9627
|
* ```
|
@@ -9618,7 +9720,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
9618
9720
|
/* harmony import */ var _types_base_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4);
|
9619
9721
|
/* harmony import */ var _types_global_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(16);
|
9620
9722
|
/* harmony import */ var _types_validate_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(14);
|
9621
|
-
/* harmony import */ var
|
9723
|
+
/* harmony import */ var _constants_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(33);
|
9724
|
+
/* harmony import */ var _theme_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(39);
|
9622
9725
|
|
9623
9726
|
/**
|
9624
9727
|
* @author schukai GmbH
|
@@ -9651,12 +9754,13 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
9651
9754
|
|
9652
9755
|
|
9653
9756
|
|
9757
|
+
|
9654
9758
|
/**
|
9655
9759
|
* you can call the method via the monster namespace `new Monster.DOM.Template()`.
|
9656
9760
|
*
|
9657
9761
|
* ```
|
9658
9762
|
* <script type="module">
|
9659
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
9763
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
9660
9764
|
* new Monster.DOM.Template()
|
9661
9765
|
* </script>
|
9662
9766
|
* ```
|
@@ -9665,7 +9769,7 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
9665
9769
|
*
|
9666
9770
|
* ```
|
9667
9771
|
* <script type="module">
|
9668
|
-
* import {Template} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
9772
|
+
* import {Template} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/dom/template.js';
|
9669
9773
|
* new Template()
|
9670
9774
|
* </script>
|
9671
9775
|
* ```
|
@@ -9736,14 +9840,14 @@ var Template = /*#__PURE__*/function (_Base) {
|
|
9736
9840
|
*
|
9737
9841
|
* If no theme was specified, the default theme is `monster`.
|
9738
9842
|
*
|
9739
|
-
* Now it is looked if there is a template with the given ID and theme `id-theme` and if yes it is returned.
|
9843
|
+
* Now it is looked if there is a template with the given ID and theme `id-theme` and if yes it is returned.
|
9740
9844
|
* If there is no template a search for a template with the given ID `id` is done. If this is also not found, an error is thrown.
|
9741
|
-
*
|
9845
|
+
*
|
9742
9846
|
* You can call the method via the monster namespace `Monster.DOM.findDocumentTemplate()`.
|
9743
9847
|
*
|
9744
9848
|
* ```
|
9745
9849
|
* <script type="module">
|
9746
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
9850
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
9747
9851
|
* Monster.DOM.findDocumentTemplate()
|
9748
9852
|
* </script>
|
9749
9853
|
* ```
|
@@ -9752,14 +9856,14 @@ var Template = /*#__PURE__*/function (_Base) {
|
|
9752
9856
|
*
|
9753
9857
|
* ```
|
9754
9858
|
* <script type="module">
|
9755
|
-
* import {findTemplate} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
9859
|
+
* import {findTemplate} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/dom/template.js';
|
9756
9860
|
* findDocumentTemplate()
|
9757
9861
|
* </script>
|
9758
9862
|
* ```
|
9759
9863
|
*
|
9760
9864
|
* @example
|
9761
9865
|
*
|
9762
|
-
* import { findDocumentTemplate } from "https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
9866
|
+
* import { findDocumentTemplate } from "https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/dom/template.js";
|
9763
9867
|
*
|
9764
9868
|
* const template = document.createElement("template");
|
9765
9869
|
* template.id = "myTemplate";
|
@@ -9780,8 +9884,8 @@ var Template = /*#__PURE__*/function (_Base) {
|
|
9780
9884
|
* document
|
9781
9885
|
* .querySelector("html")
|
9782
9886
|
* .setAttribute("data-monster-theme-name", "myTheme");
|
9783
|
-
*
|
9784
|
-
* // now we don't get the default template,
|
9887
|
+
*
|
9888
|
+
* // now we don't get the default template,
|
9785
9889
|
* // but the template with the theme in the id
|
9786
9890
|
* const template2 = findDocumentTemplate("myTemplate");
|
9787
9891
|
* console.log(template2.createDocumentFragment());
|
@@ -9800,9 +9904,18 @@ var Template = /*#__PURE__*/function (_Base) {
|
|
9800
9904
|
|
9801
9905
|
function findDocumentTemplate(id, currentNode) {
|
9802
9906
|
(0,_types_validate_js__WEBPACK_IMPORTED_MODULE_3__.validateString)(id);
|
9907
|
+
var document = (0,_types_global_js__WEBPACK_IMPORTED_MODULE_2__.getGlobalObject)('document');
|
9908
|
+
var HTMLTemplateElement = (0,_types_global_js__WEBPACK_IMPORTED_MODULE_2__.getGlobalFunction)('HTMLTemplateElement');
|
9909
|
+
var DocumentFragment = (0,_types_global_js__WEBPACK_IMPORTED_MODULE_2__.getGlobalFunction)('DocumentFragment');
|
9910
|
+
var Document = (0,_types_global_js__WEBPACK_IMPORTED_MODULE_2__.getGlobalFunction)('Document');
|
9911
|
+
var prefixID;
|
9803
9912
|
|
9804
9913
|
if (!(currentNode instanceof Document || currentNode instanceof DocumentFragment)) {
|
9805
9914
|
if (currentNode instanceof Node) {
|
9915
|
+
if (currentNode.hasAttribute(_constants_js__WEBPACK_IMPORTED_MODULE_4__.ATTRIBUTE_TEMPLATE_PREFIX)) {
|
9916
|
+
prefixID = currentNode.getAttribute(_constants_js__WEBPACK_IMPORTED_MODULE_4__.ATTRIBUTE_TEMPLATE_PREFIX);
|
9917
|
+
}
|
9918
|
+
|
9806
9919
|
currentNode = currentNode.getRootNode();
|
9807
9920
|
|
9808
9921
|
if (!(currentNode instanceof Document || currentNode instanceof DocumentFragment)) {
|
@@ -9811,27 +9924,57 @@ function findDocumentTemplate(id, currentNode) {
|
|
9811
9924
|
}
|
9812
9925
|
|
9813
9926
|
if (!(currentNode instanceof Document || currentNode instanceof DocumentFragment)) {
|
9814
|
-
currentNode =
|
9927
|
+
currentNode = document;
|
9815
9928
|
}
|
9816
9929
|
}
|
9817
9930
|
|
9818
|
-
var
|
9819
|
-
var theme = (0,
|
9820
|
-
|
9821
|
-
|
9931
|
+
var template;
|
9932
|
+
var theme = (0,_theme_js__WEBPACK_IMPORTED_MODULE_5__.getDocumentTheme)();
|
9933
|
+
|
9934
|
+
if (prefixID) {
|
9935
|
+
var themedPrefixID = prefixID + '-' + id + '-' + theme.getName(); // current + themedPrefixID
|
9936
|
+
|
9937
|
+
template = currentNode.getElementById(themedPrefixID);
|
9938
|
+
|
9939
|
+
if (template instanceof HTMLTemplateElement) {
|
9940
|
+
return new Template(template);
|
9941
|
+
} // document + themedPrefixID
|
9942
|
+
|
9943
|
+
|
9944
|
+
template = document.getElementById(themedPrefixID);
|
9945
|
+
|
9946
|
+
if (template instanceof HTMLTemplateElement) {
|
9947
|
+
return new Template(template);
|
9948
|
+
}
|
9949
|
+
}
|
9950
|
+
|
9951
|
+
var themedID = id + '-' + theme.getName(); // current + themedID
|
9952
|
+
|
9953
|
+
template = currentNode.getElementById(themedID);
|
9822
9954
|
|
9823
9955
|
if (template instanceof HTMLTemplateElement) {
|
9824
9956
|
return new Template(template);
|
9825
|
-
}
|
9957
|
+
} // document + themedID
|
9958
|
+
|
9959
|
+
|
9960
|
+
template = document.getElementById(themedID);
|
9961
|
+
|
9962
|
+
if (template instanceof HTMLTemplateElement) {
|
9963
|
+
return new Template(template);
|
9964
|
+
} // current + ID
|
9965
|
+
|
9826
9966
|
|
9827
9967
|
template = currentNode.getElementById(id);
|
9828
9968
|
|
9829
9969
|
if (template instanceof HTMLTemplateElement) {
|
9830
9970
|
return new Template(template);
|
9831
|
-
}
|
9971
|
+
} // document + ID
|
9832
9972
|
|
9833
|
-
|
9834
|
-
|
9973
|
+
|
9974
|
+
template = document.getElementById(id);
|
9975
|
+
|
9976
|
+
if (template instanceof HTMLTemplateElement) {
|
9977
|
+
return new Template(template);
|
9835
9978
|
}
|
9836
9979
|
|
9837
9980
|
throw new Error("template " + id + " not found.");
|
@@ -9892,7 +10035,7 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
9892
10035
|
*
|
9893
10036
|
* ```
|
9894
10037
|
* <script type="module">
|
9895
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
10038
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
9896
10039
|
* console.log(new Monster.DOM.Theme())
|
9897
10040
|
* </script>
|
9898
10041
|
* ```
|
@@ -9901,14 +10044,14 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
9901
10044
|
*
|
9902
10045
|
* ```
|
9903
10046
|
* <script type="module">
|
9904
|
-
* import {Theme} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
10047
|
+
* import {Theme} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/dom/theme.js';
|
9905
10048
|
* console.log(new Theme())
|
9906
10049
|
* </script>
|
9907
10050
|
* ```
|
9908
10051
|
*
|
9909
10052
|
* @example
|
9910
10053
|
*
|
9911
|
-
* import {getDocumentTheme} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
10054
|
+
* import {getDocumentTheme} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/dom/theme.js';
|
9912
10055
|
*
|
9913
10056
|
* const theme = getDocumentTheme();
|
9914
10057
|
* console.log(theme.getName());
|
@@ -9998,23 +10141,25 @@ function getDocumentTheme() {
|
|
9998
10141
|
|
9999
10142
|
__webpack_require__.r(__webpack_exports__);
|
10000
10143
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
10001
|
-
/* harmony export */ "Monster": function() { return /* reexport safe */
|
10144
|
+
/* harmony export */ "Monster": function() { return /* reexport safe */ _namespace_js__WEBPACK_IMPORTED_MODULE_5__.Monster; },
|
10002
10145
|
/* harmony export */ "Updater": function() { return /* binding */ Updater; }
|
10003
10146
|
/* harmony export */ });
|
10004
|
-
/* harmony import */ var
|
10005
|
-
/* harmony import */ var
|
10006
|
-
/* harmony import */ var
|
10007
|
-
/* harmony import */ var
|
10008
|
-
/* harmony import */ var
|
10009
|
-
/* harmony import */ var
|
10010
|
-
/* harmony import */ var
|
10011
|
-
/* harmony import */ var
|
10012
|
-
/* harmony import */ var
|
10013
|
-
/* harmony import */ var
|
10014
|
-
/* harmony import */ var
|
10015
|
-
/* harmony import */ var
|
10016
|
-
/* harmony import */ var
|
10017
|
-
/* harmony import */ var
|
10147
|
+
/* harmony import */ var _constants_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1);
|
10148
|
+
/* harmony import */ var _data_diff_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(20);
|
10149
|
+
/* harmony import */ var _data_pathfinder_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(18);
|
10150
|
+
/* harmony import */ var _data_pipe_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(22);
|
10151
|
+
/* harmony import */ var _dom_constants_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(33);
|
10152
|
+
/* harmony import */ var _namespace_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2);
|
10153
|
+
/* harmony import */ var _types_base_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(4);
|
10154
|
+
/* harmony import */ var _types_is_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(9);
|
10155
|
+
/* harmony import */ var _types_observer_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(27);
|
10156
|
+
/* harmony import */ var _types_proxyobserver_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(26);
|
10157
|
+
/* harmony import */ var _types_validate_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(14);
|
10158
|
+
/* harmony import */ var _util_clone_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(15);
|
10159
|
+
/* harmony import */ var _util_trimspaces_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(41);
|
10160
|
+
/* harmony import */ var _events_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(42);
|
10161
|
+
/* harmony import */ var _template_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(38);
|
10162
|
+
/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(43);
|
10018
10163
|
|
10019
10164
|
/**
|
10020
10165
|
* @author schukai GmbH
|
@@ -10078,17 +10223,22 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
10078
10223
|
|
10079
10224
|
|
10080
10225
|
|
10226
|
+
|
10227
|
+
|
10081
10228
|
/**
|
10082
10229
|
* The updater class connects an object with the dom. In this way, structures and contents in the DOM can be programmatically adapted via attributes.
|
10083
10230
|
*
|
10084
10231
|
* For example, to include a string from an object, the attribute `data-monster-replace` can be used.
|
10085
10232
|
* a further explanation can be found under {@tutorial dom-based-templating-implementation}.
|
10086
10233
|
*
|
10234
|
+
* Changes to attributes are made only when the direct values are changed. If you want to assign changes to other values
|
10235
|
+
* as well, you have to insert the attribute `data-monster-select-this`. This should be done with care, as it can reduce performance.
|
10236
|
+
*
|
10087
10237
|
* You can create an object of this class using the monster namespace `new Monster.DOM.Updater()`.
|
10088
10238
|
*
|
10089
10239
|
* ```
|
10090
10240
|
* <script type="module">
|
10091
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
10241
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
10092
10242
|
* new Monster.DOM.Updater()
|
10093
10243
|
* </script>
|
10094
10244
|
* ```
|
@@ -10097,14 +10247,14 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
10097
10247
|
*
|
10098
10248
|
* ```
|
10099
10249
|
* <script type="module">
|
10100
|
-
* import {Updater} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
10250
|
+
* import {Updater} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/dom/updater.js';
|
10101
10251
|
* new Updater()
|
10102
10252
|
* </script>
|
10103
10253
|
* ```
|
10104
10254
|
*
|
10105
10255
|
* @example
|
10106
10256
|
*
|
10107
|
-
* import {Updater} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
10257
|
+
* import {Updater} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/dom/updater.js';
|
10108
10258
|
*
|
10109
10259
|
* // First we prepare the html document.
|
10110
10260
|
* // This is done here via script, but can also be inserted into the document as pure html.
|
@@ -10118,7 +10268,7 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
10118
10268
|
* let obj = {
|
10119
10269
|
* headline: "Hello World",
|
10120
10270
|
* };
|
10121
|
-
*
|
10271
|
+
*
|
10122
10272
|
* // Now comes the real magic. we pass the updater the parent HTMLElement
|
10123
10273
|
* // and the desired data structure.
|
10124
10274
|
* const updater = new Updater(body, obj);
|
@@ -10163,28 +10313,27 @@ var Updater = /*#__PURE__*/function (_Base) {
|
|
10163
10313
|
* @type {HTMLElement}
|
10164
10314
|
*/
|
10165
10315
|
|
10166
|
-
_this.element = (0,_types_validate_js__WEBPACK_IMPORTED_MODULE_9__.validateInstance)(element, HTMLElement);
|
10167
10316
|
if (subject === undefined) subject = {};
|
10168
|
-
var a = subject;
|
10169
10317
|
|
10170
|
-
if (!(0,
|
10171
|
-
subject = new
|
10318
|
+
if (!(0,_types_is_js__WEBPACK_IMPORTED_MODULE_7__.isInstance)(subject, _types_proxyobserver_js__WEBPACK_IMPORTED_MODULE_9__.ProxyObserver)) {
|
10319
|
+
subject = new _types_proxyobserver_js__WEBPACK_IMPORTED_MODULE_9__.ProxyObserver(subject);
|
10172
10320
|
}
|
10173
10321
|
|
10174
|
-
_this.
|
10175
|
-
|
10176
|
-
|
10177
|
-
|
10178
|
-
|
10179
|
-
|
10180
|
-
|
10322
|
+
_this[_constants_js__WEBPACK_IMPORTED_MODULE_0__.internalSymbol] = {
|
10323
|
+
element: (0,_types_validate_js__WEBPACK_IMPORTED_MODULE_10__.validateInstance)(element, HTMLElement),
|
10324
|
+
last: {},
|
10325
|
+
callbacks: new Map(),
|
10326
|
+
eventTypes: ['keyup', 'click', 'change', 'drop', 'touchend', 'input'],
|
10327
|
+
subject: subject
|
10328
|
+
};
|
10181
10329
|
|
10330
|
+
_this[_constants_js__WEBPACK_IMPORTED_MODULE_0__.internalSymbol].callbacks.set('checkstate', getCheckStateCallback.call(_assertThisInitialized(_this)));
|
10182
10331
|
|
10183
|
-
_this.subject
|
10184
|
-
var s = _this.subject.getRealSubject();
|
10332
|
+
_this[_constants_js__WEBPACK_IMPORTED_MODULE_0__.internalSymbol].subject.attachObserver(new _types_observer_js__WEBPACK_IMPORTED_MODULE_8__.Observer(function () {
|
10333
|
+
var s = _this[_constants_js__WEBPACK_IMPORTED_MODULE_0__.internalSymbol].subject.getRealSubject();
|
10185
10334
|
|
10186
|
-
var diffResult = (0,
|
10187
|
-
_this.last = (0,
|
10335
|
+
var diffResult = (0,_data_diff_js__WEBPACK_IMPORTED_MODULE_1__.diff)(_this[_constants_js__WEBPACK_IMPORTED_MODULE_0__.internalSymbol].last, s);
|
10336
|
+
_this[_constants_js__WEBPACK_IMPORTED_MODULE_0__.internalSymbol].last = (0,_util_clone_js__WEBPACK_IMPORTED_MODULE_11__.clone)(s);
|
10188
10337
|
|
10189
10338
|
for (var _i = 0, _Object$entries = Object.entries(diffResult); _i < _Object$entries.length; _i++) {
|
10190
10339
|
var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
|
@@ -10196,7 +10345,7 @@ var Updater = /*#__PURE__*/function (_Base) {
|
|
10196
10345
|
updateAttributes.call(_assertThisInitialized(_this), change);
|
10197
10346
|
}
|
10198
10347
|
}));
|
10199
|
-
|
10348
|
+
|
10200
10349
|
return _this;
|
10201
10350
|
}
|
10202
10351
|
/**
|
@@ -10212,7 +10361,7 @@ var Updater = /*#__PURE__*/function (_Base) {
|
|
10212
10361
|
_createClass(Updater, [{
|
10213
10362
|
key: "setEventTypes",
|
10214
10363
|
value: function setEventTypes(types) {
|
10215
|
-
this.eventTypes = (0,
|
10364
|
+
this[_constants_js__WEBPACK_IMPORTED_MODULE_0__.internalSymbol].eventTypes = (0,_types_validate_js__WEBPACK_IMPORTED_MODULE_10__.validateArray)(types);
|
10216
10365
|
return this;
|
10217
10366
|
}
|
10218
10367
|
/**
|
@@ -10226,6 +10375,7 @@ var Updater = /*#__PURE__*/function (_Base) {
|
|
10226
10375
|
*
|
10227
10376
|
* @since 1.9.0
|
10228
10377
|
* @return {Updater}
|
10378
|
+
* @throws {Error} the bind argument must start as a value with a path
|
10229
10379
|
*/
|
10230
10380
|
|
10231
10381
|
}, {
|
@@ -10233,13 +10383,17 @@ var Updater = /*#__PURE__*/function (_Base) {
|
|
10233
10383
|
value: function enableEventProcessing() {
|
10234
10384
|
this.disableEventProcessing();
|
10235
10385
|
|
10236
|
-
var _iterator = _createForOfIteratorHelper(this.eventTypes),
|
10386
|
+
var _iterator = _createForOfIteratorHelper(this[_constants_js__WEBPACK_IMPORTED_MODULE_0__.internalSymbol].eventTypes),
|
10237
10387
|
_step;
|
10238
10388
|
|
10239
10389
|
try {
|
10240
10390
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
10241
10391
|
var type = _step.value;
|
10242
|
-
|
10392
|
+
// @see https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener
|
10393
|
+
this[_constants_js__WEBPACK_IMPORTED_MODULE_0__.internalSymbol].element.addEventListener(type, getControlEventHandler.call(this), {
|
10394
|
+
capture: true,
|
10395
|
+
passive: true
|
10396
|
+
});
|
10243
10397
|
}
|
10244
10398
|
} catch (err) {
|
10245
10399
|
_iterator.e(err);
|
@@ -10259,13 +10413,13 @@ var Updater = /*#__PURE__*/function (_Base) {
|
|
10259
10413
|
}, {
|
10260
10414
|
key: "disableEventProcessing",
|
10261
10415
|
value: function disableEventProcessing() {
|
10262
|
-
var _iterator2 = _createForOfIteratorHelper(this.eventTypes),
|
10416
|
+
var _iterator2 = _createForOfIteratorHelper(this[_constants_js__WEBPACK_IMPORTED_MODULE_0__.internalSymbol].eventTypes),
|
10263
10417
|
_step2;
|
10264
10418
|
|
10265
10419
|
try {
|
10266
10420
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
10267
10421
|
var type = _step2.value;
|
10268
|
-
this.element.removeEventListener(type, getControlEventHandler.call(this));
|
10422
|
+
this[_constants_js__WEBPACK_IMPORTED_MODULE_0__.internalSymbol].element.removeEventListener(type, getControlEventHandler.call(this));
|
10269
10423
|
}
|
10270
10424
|
} catch (err) {
|
10271
10425
|
_iterator2.e(err);
|
@@ -10294,10 +10448,23 @@ var Updater = /*#__PURE__*/function (_Base) {
|
|
10294
10448
|
value: function run() {
|
10295
10449
|
// the key __init__has no further meaning and is only
|
10296
10450
|
// used to create the diff for empty objects.
|
10297
|
-
this.last = {
|
10451
|
+
this[_constants_js__WEBPACK_IMPORTED_MODULE_0__.internalSymbol].last = {
|
10298
10452
|
'__init__': true
|
10299
10453
|
};
|
10300
|
-
return this.subject.notifyObservers();
|
10454
|
+
return this[_constants_js__WEBPACK_IMPORTED_MODULE_0__.internalSymbol].subject.notifyObservers();
|
10455
|
+
}
|
10456
|
+
/**
|
10457
|
+
* Gets the values of bound elements and changes them in subject
|
10458
|
+
*
|
10459
|
+
* @since 1.27.0
|
10460
|
+
* @return {Monster.DOM.Updater}
|
10461
|
+
*/
|
10462
|
+
|
10463
|
+
}, {
|
10464
|
+
key: "retrieve",
|
10465
|
+
value: function retrieve() {
|
10466
|
+
retrieveFromBindings.call(this);
|
10467
|
+
return this;
|
10301
10468
|
}
|
10302
10469
|
/**
|
10303
10470
|
* If you have passed a ProxyObserver in the constructor, you will get the object that the ProxyObserver manages here.
|
@@ -10312,7 +10479,7 @@ var Updater = /*#__PURE__*/function (_Base) {
|
|
10312
10479
|
}, {
|
10313
10480
|
key: "getSubject",
|
10314
10481
|
value: function getSubject() {
|
10315
|
-
return this.subject.getSubject();
|
10482
|
+
return this[_constants_js__WEBPACK_IMPORTED_MODULE_0__.internalSymbol].subject.getSubject();
|
10316
10483
|
}
|
10317
10484
|
/**
|
10318
10485
|
* This method can be used to register commands that can be called via call: instruction.
|
@@ -10328,13 +10495,13 @@ var Updater = /*#__PURE__*/function (_Base) {
|
|
10328
10495
|
}, {
|
10329
10496
|
key: "setCallback",
|
10330
10497
|
value: function setCallback(name, callback) {
|
10331
|
-
this.callbacks.set(name, callback);
|
10498
|
+
this[_constants_js__WEBPACK_IMPORTED_MODULE_0__.internalSymbol].callbacks.set(name, callback);
|
10332
10499
|
return this;
|
10333
10500
|
}
|
10334
10501
|
}]);
|
10335
10502
|
|
10336
10503
|
return Updater;
|
10337
|
-
}(
|
10504
|
+
}(_types_base_js__WEBPACK_IMPORTED_MODULE_6__.Base);
|
10338
10505
|
/**
|
10339
10506
|
* @private
|
10340
10507
|
* @since 1.9.0
|
@@ -10346,12 +10513,13 @@ var Updater = /*#__PURE__*/function (_Base) {
|
|
10346
10513
|
function getCheckStateCallback() {
|
10347
10514
|
var self = this;
|
10348
10515
|
return function (current) {
|
10516
|
+
// this is a reference to the current object (therefore no array function here)
|
10349
10517
|
if (this instanceof HTMLInputElement) {
|
10350
10518
|
if (['radio', 'checkbox'].indexOf(this.type) !== -1) {
|
10351
10519
|
return this.value + "" === current + "" ? 'true' : undefined;
|
10352
10520
|
}
|
10353
10521
|
} else if (this instanceof HTMLOptionElement) {
|
10354
|
-
if ((0,
|
10522
|
+
if ((0,_types_is_js__WEBPACK_IMPORTED_MODULE_7__.isArray)(current) && current.indexOf(this.value) !== -1) {
|
10355
10523
|
return 'true';
|
10356
10524
|
}
|
10357
10525
|
|
@@ -10369,6 +10537,7 @@ var symbol = Symbol('EventHandler');
|
|
10369
10537
|
* @private
|
10370
10538
|
* @return {function}
|
10371
10539
|
* @this Updater
|
10540
|
+
* @throws {Error} the bind argument must start as a value with a path
|
10372
10541
|
*/
|
10373
10542
|
|
10374
10543
|
function getControlEventHandler() {
|
@@ -10377,97 +10546,112 @@ function getControlEventHandler() {
|
|
10377
10546
|
if (self[symbol]) {
|
10378
10547
|
return self[symbol];
|
10379
10548
|
}
|
10380
|
-
|
10381
|
-
var pathfinder = new _data_pathfinder_js__WEBPACK_IMPORTED_MODULE_1__.Pathfinder(this.subject.getSubject());
|
10382
10549
|
/**
|
10383
10550
|
* @throws {Error} the bind argument must start as a value with a path.
|
10384
10551
|
* @throws {Error} unsupported object
|
10385
10552
|
* @param {Event} event
|
10386
10553
|
*/
|
10387
10554
|
|
10388
|
-
self[symbol] = function (event) {
|
10389
|
-
var _element$constructor, _Object$getOwnPropert;
|
10390
10555
|
|
10391
|
-
|
10556
|
+
self[symbol] = function (event) {
|
10557
|
+
var element = (0,_events_js__WEBPACK_IMPORTED_MODULE_13__.findTargetElementFromEvent)(event, _dom_constants_js__WEBPACK_IMPORTED_MODULE_4__.ATTRIBUTE_UPDATER_BIND);
|
10392
10558
|
|
10393
|
-
if (
|
10559
|
+
if (element === undefined) {
|
10394
10560
|
return;
|
10395
10561
|
}
|
10396
10562
|
|
10397
|
-
|
10563
|
+
retrieveAndSetValue.call(self, element);
|
10564
|
+
};
|
10398
10565
|
|
10399
|
-
|
10400
|
-
|
10401
|
-
|
10566
|
+
return self[symbol];
|
10567
|
+
}
|
10568
|
+
/**
|
10569
|
+
* @throws {Error} the bind argument must start as a value with a path
|
10570
|
+
* @param {HTMLElement} element
|
10571
|
+
* @return void
|
10572
|
+
*/
|
10402
10573
|
|
10403
|
-
path = path.substr(5);
|
10404
|
-
var value;
|
10405
10574
|
|
10406
|
-
|
10407
|
-
|
10408
|
-
case 'checkbox':
|
10409
|
-
value = element.checked ? element.value : undefined;
|
10410
|
-
break;
|
10575
|
+
function retrieveAndSetValue(element) {
|
10576
|
+
var _element$constructor, _Object$getOwnPropert;
|
10411
10577
|
|
10412
|
-
|
10413
|
-
|
10414
|
-
|
10415
|
-
}
|
10416
|
-
} else if (element instanceof HTMLTextAreaElement) {
|
10417
|
-
value = element.value;
|
10418
|
-
} else if (element instanceof HTMLSelectElement) {
|
10419
|
-
switch (element.type) {
|
10420
|
-
case 'select-one':
|
10421
|
-
value = element.value;
|
10422
|
-
break;
|
10423
|
-
|
10424
|
-
case 'select-multiple':
|
10425
|
-
value = element.value;
|
10426
|
-
var options = element === null || element === void 0 ? void 0 : element.selectedOptions;
|
10427
|
-
if (options === undefined) options = element.querySelectorAll(":scope option:checked");
|
10428
|
-
value = Array.from(options).map(function (_ref) {
|
10429
|
-
var value = _ref.value;
|
10430
|
-
return value;
|
10431
|
-
});
|
10432
|
-
break;
|
10433
|
-
} // values from customelements
|
10578
|
+
var self = this;
|
10579
|
+
var pathfinder = new _data_pathfinder_js__WEBPACK_IMPORTED_MODULE_2__.Pathfinder(self[_constants_js__WEBPACK_IMPORTED_MODULE_0__.internalSymbol].subject.getSubject());
|
10580
|
+
var path = element.getAttribute(_dom_constants_js__WEBPACK_IMPORTED_MODULE_4__.ATTRIBUTE_UPDATER_BIND);
|
10434
10581
|
|
10435
|
-
|
10436
|
-
|
10437
|
-
|
10438
|
-
|
10439
|
-
|
10582
|
+
if (path.indexOf('path:') !== 0) {
|
10583
|
+
throw new Error('the bind argument must start as a value with a path');
|
10584
|
+
}
|
10585
|
+
|
10586
|
+
path = path.substr(5);
|
10587
|
+
var value;
|
10440
10588
|
|
10441
|
-
|
10442
|
-
|
10443
|
-
|
10444
|
-
|
10589
|
+
if (element instanceof HTMLInputElement) {
|
10590
|
+
switch (element.type) {
|
10591
|
+
case 'checkbox':
|
10592
|
+
value = element.checked ? element.value : undefined;
|
10593
|
+
break;
|
10445
10594
|
|
10446
|
-
|
10447
|
-
|
10595
|
+
default:
|
10596
|
+
value = element.value;
|
10597
|
+
break;
|
10448
10598
|
}
|
10449
|
-
}
|
10599
|
+
} else if (element instanceof HTMLTextAreaElement) {
|
10600
|
+
value = element.value;
|
10601
|
+
} else if (element instanceof HTMLSelectElement) {
|
10602
|
+
switch (element.type) {
|
10603
|
+
case 'select-one':
|
10604
|
+
value = element.value;
|
10605
|
+
break;
|
10450
10606
|
|
10451
|
-
|
10607
|
+
case 'select-multiple':
|
10608
|
+
value = element.value;
|
10609
|
+
var options = element === null || element === void 0 ? void 0 : element.selectedOptions;
|
10610
|
+
if (options === undefined) options = element.querySelectorAll(":scope option:checked");
|
10611
|
+
value = Array.from(options).map(function (_ref) {
|
10612
|
+
var value = _ref.value;
|
10613
|
+
return value;
|
10614
|
+
});
|
10615
|
+
break;
|
10616
|
+
} // values from customelements
|
10617
|
+
|
10618
|
+
} else if (element !== null && element !== void 0 && (_element$constructor = element.constructor) !== null && _element$constructor !== void 0 && _element$constructor.prototype && !!((_Object$getOwnPropert = Object.getOwnPropertyDescriptor(element.constructor.prototype, 'value')) !== null && _Object$getOwnPropert !== void 0 && _Object$getOwnPropert['get']) || element.hasOwnProperty('value')) {
|
10619
|
+
value = element === null || element === void 0 ? void 0 : element['value'];
|
10620
|
+
} else {
|
10621
|
+
throw new Error("unsupported object");
|
10622
|
+
}
|
10623
|
+
|
10624
|
+
var copy = (0,_util_clone_js__WEBPACK_IMPORTED_MODULE_11__.clone)(self[_constants_js__WEBPACK_IMPORTED_MODULE_0__.internalSymbol].subject.getRealSubject());
|
10625
|
+
var pf = new _data_pathfinder_js__WEBPACK_IMPORTED_MODULE_2__.Pathfinder(copy);
|
10626
|
+
pf.setVia(path, value);
|
10627
|
+
var diffResult = (0,_data_diff_js__WEBPACK_IMPORTED_MODULE_1__.diff)(copy, self[_constants_js__WEBPACK_IMPORTED_MODULE_0__.internalSymbol].subject.getRealSubject());
|
10628
|
+
|
10629
|
+
if (diffResult.length > 0) {
|
10630
|
+
pathfinder.setVia(path, value);
|
10631
|
+
}
|
10452
10632
|
}
|
10453
10633
|
/**
|
10454
|
-
* @
|
10455
|
-
* @
|
10456
|
-
* @param {object} change
|
10457
|
-
* @return {void}
|
10634
|
+
* @since 1.27.0
|
10635
|
+
* @return void
|
10458
10636
|
*/
|
10459
10637
|
|
10460
10638
|
|
10461
|
-
function
|
10462
|
-
var
|
10639
|
+
function retrieveFromBindings() {
|
10640
|
+
var self = this;
|
10641
|
+
|
10642
|
+
if (self[_constants_js__WEBPACK_IMPORTED_MODULE_0__.internalSymbol].element.matches('[' + _dom_constants_js__WEBPACK_IMPORTED_MODULE_4__.ATTRIBUTE_UPDATER_BIND + ']')) {
|
10643
|
+
retrieveAndSetValue.call(self, element);
|
10644
|
+
}
|
10645
|
+
|
10646
|
+
var _iterator3 = _createForOfIteratorHelper(self[_constants_js__WEBPACK_IMPORTED_MODULE_0__.internalSymbol].element.querySelectorAll('[' + _dom_constants_js__WEBPACK_IMPORTED_MODULE_4__.ATTRIBUTE_UPDATER_BIND + ']').entries()),
|
10463
10647
|
_step3;
|
10464
10648
|
|
10465
10649
|
try {
|
10466
10650
|
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
10467
10651
|
var _step3$value = _slicedToArray(_step3.value, 2),
|
10468
|
-
|
10652
|
+
_element = _step3$value[1];
|
10469
10653
|
|
10470
|
-
|
10654
|
+
retrieveAndSetValue.call(self, _element);
|
10471
10655
|
}
|
10472
10656
|
} catch (err) {
|
10473
10657
|
_iterator3.e(err);
|
@@ -10475,6 +10659,33 @@ function removeElement(change) {
|
|
10475
10659
|
_iterator3.f();
|
10476
10660
|
}
|
10477
10661
|
}
|
10662
|
+
/**
|
10663
|
+
* @private
|
10664
|
+
* @since 1.8.0
|
10665
|
+
* @param {object} change
|
10666
|
+
* @return {void}
|
10667
|
+
*/
|
10668
|
+
|
10669
|
+
|
10670
|
+
function removeElement(change) {
|
10671
|
+
var self = this;
|
10672
|
+
|
10673
|
+
var _iterator4 = _createForOfIteratorHelper(self[_constants_js__WEBPACK_IMPORTED_MODULE_0__.internalSymbol].element.querySelectorAll(':scope [' + _dom_constants_js__WEBPACK_IMPORTED_MODULE_4__.ATTRIBUTE_UPDATER_REMOVE + ']').entries()),
|
10674
|
+
_step4;
|
10675
|
+
|
10676
|
+
try {
|
10677
|
+
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
10678
|
+
var _step4$value = _slicedToArray(_step4.value, 2),
|
10679
|
+
_element2 = _step4$value[1];
|
10680
|
+
|
10681
|
+
_element2.parentNode.removeChild(_element2);
|
10682
|
+
}
|
10683
|
+
} catch (err) {
|
10684
|
+
_iterator4.e(err);
|
10685
|
+
} finally {
|
10686
|
+
_iterator4.f();
|
10687
|
+
}
|
10688
|
+
}
|
10478
10689
|
/**
|
10479
10690
|
* @private
|
10480
10691
|
* @since 1.8.0
|
@@ -10492,56 +10703,56 @@ function insertElement(change) {
|
|
10492
10703
|
var _this2 = this;
|
10493
10704
|
|
10494
10705
|
var self = this;
|
10495
|
-
var subject = self.subject.getRealSubject();
|
10496
|
-
var document = (0,
|
10706
|
+
var subject = self[_constants_js__WEBPACK_IMPORTED_MODULE_0__.internalSymbol].subject.getRealSubject();
|
10707
|
+
var document = (0,_util_js__WEBPACK_IMPORTED_MODULE_15__.getDocument)();
|
10497
10708
|
var mem = new WeakSet();
|
10498
10709
|
var wd = 0;
|
10499
10710
|
|
10500
10711
|
while (true) {
|
10501
10712
|
var found = false;
|
10502
10713
|
wd++;
|
10503
|
-
var p = (0,
|
10504
|
-
if (!(0,
|
10714
|
+
var p = (0,_util_clone_js__WEBPACK_IMPORTED_MODULE_11__.clone)(change === null || change === void 0 ? void 0 : change['path']);
|
10715
|
+
if (!(0,_types_is_js__WEBPACK_IMPORTED_MODULE_7__.isArray)(p)) return this;
|
10505
10716
|
|
10506
10717
|
while (p.length > 0) {
|
10507
10718
|
var current = p.join('.');
|
10508
|
-
var list = this.element.querySelectorAll(':scope [' +
|
10719
|
+
var list = this[_constants_js__WEBPACK_IMPORTED_MODULE_0__.internalSymbol].element.querySelectorAll(':scope [' + _dom_constants_js__WEBPACK_IMPORTED_MODULE_4__.ATTRIBUTE_UPDATER_INSERT + '*="path:' + current + '"]').entries();
|
10509
10720
|
|
10510
|
-
var
|
10511
|
-
|
10721
|
+
var _iterator5 = _createForOfIteratorHelper(list),
|
10722
|
+
_step5;
|
10512
10723
|
|
10513
10724
|
try {
|
10514
10725
|
var _loop = function _loop() {
|
10515
|
-
var
|
10516
|
-
containerElement =
|
10726
|
+
var _step5$value = _slicedToArray(_step5.value, 2),
|
10727
|
+
containerElement = _step5$value[1];
|
10517
10728
|
|
10518
10729
|
if (mem.has(containerElement)) return "continue";
|
10519
10730
|
mem.add(containerElement);
|
10520
10731
|
found = true;
|
10521
|
-
var attributes = containerElement.getAttribute(
|
10522
|
-
var def = (0,
|
10732
|
+
var attributes = containerElement.getAttribute(_dom_constants_js__WEBPACK_IMPORTED_MODULE_4__.ATTRIBUTE_UPDATER_INSERT);
|
10733
|
+
var def = (0,_util_trimspaces_js__WEBPACK_IMPORTED_MODULE_12__.trimSpaces)(attributes);
|
10523
10734
|
var i = def.indexOf(' ');
|
10524
|
-
var key = (0,
|
10735
|
+
var key = (0,_util_trimspaces_js__WEBPACK_IMPORTED_MODULE_12__.trimSpaces)(def.substr(0, i));
|
10525
10736
|
var refPrefix = key + '-';
|
10526
|
-
var cmd = (0,
|
10737
|
+
var cmd = (0,_util_trimspaces_js__WEBPACK_IMPORTED_MODULE_12__.trimSpaces)(def.substr(i)); // this case is actually excluded by the query but is nevertheless checked again here
|
10527
10738
|
|
10528
10739
|
if (cmd.indexOf('|') > 0) {
|
10529
10740
|
throw new Error("pipes are not allowed when cloning a node.");
|
10530
10741
|
}
|
10531
10742
|
|
10532
|
-
var pipe = new
|
10743
|
+
var pipe = new _data_pipe_js__WEBPACK_IMPORTED_MODULE_3__.Pipe(cmd);
|
10533
10744
|
|
10534
|
-
_this2.callbacks.forEach(function (f, n) {
|
10745
|
+
_this2[_constants_js__WEBPACK_IMPORTED_MODULE_0__.internalSymbol].callbacks.forEach(function (f, n) {
|
10535
10746
|
pipe.setCallback(n, f);
|
10536
10747
|
});
|
10537
10748
|
|
10538
10749
|
var value = void 0;
|
10539
10750
|
|
10540
10751
|
try {
|
10541
|
-
containerElement.removeAttribute(
|
10752
|
+
containerElement.removeAttribute(_dom_constants_js__WEBPACK_IMPORTED_MODULE_4__.ATTRIBUTE_ERRORMESSAGE);
|
10542
10753
|
value = pipe.run(subject);
|
10543
10754
|
} catch (e) {
|
10544
|
-
containerElement.setAttribute(
|
10755
|
+
containerElement.setAttribute(_dom_constants_js__WEBPACK_IMPORTED_MODULE_4__.ATTRIBUTE_ERRORMESSAGE, e.message);
|
10545
10756
|
}
|
10546
10757
|
|
10547
10758
|
var dataPath = cmd.split(':').pop();
|
@@ -10551,7 +10762,7 @@ function insertElement(change) {
|
|
10551
10762
|
insertPoint = containerElement.lastChild;
|
10552
10763
|
}
|
10553
10764
|
|
10554
|
-
if (!(0,
|
10765
|
+
if (!(0,_types_is_js__WEBPACK_IMPORTED_MODULE_7__.isIterable)(value)) {
|
10555
10766
|
throw new Error('the value is not iterable');
|
10556
10767
|
}
|
10557
10768
|
|
@@ -10565,7 +10776,7 @@ function insertElement(change) {
|
|
10565
10776
|
var ref = refPrefix + _i3;
|
10566
10777
|
var currentPath = dataPath + "." + _i3;
|
10567
10778
|
available.add(ref);
|
10568
|
-
var refElement = containerElement.querySelector('[' +
|
10779
|
+
var refElement = containerElement.querySelector('[' + _dom_constants_js__WEBPACK_IMPORTED_MODULE_4__.ATTRIBUTE_UPDATER_INSERT_REFERENCE + '="' + ref + '"]');
|
10569
10780
|
|
10570
10781
|
if (refElement instanceof HTMLElement) {
|
10571
10782
|
insertPoint = refElement;
|
@@ -10575,27 +10786,27 @@ function insertElement(change) {
|
|
10575
10786
|
appendNewDocumentFragment(containerElement, key, ref, currentPath);
|
10576
10787
|
}
|
10577
10788
|
|
10578
|
-
var nodes = containerElement.querySelectorAll('[' +
|
10789
|
+
var nodes = containerElement.querySelectorAll('[' + _dom_constants_js__WEBPACK_IMPORTED_MODULE_4__.ATTRIBUTE_UPDATER_INSERT_REFERENCE + '*="' + refPrefix + '"]');
|
10579
10790
|
|
10580
10791
|
for (var _i4 = 0, _Object$entries3 = Object.entries(nodes); _i4 < _Object$entries3.length; _i4++) {
|
10581
10792
|
var _Object$entries3$_i = _slicedToArray(_Object$entries3[_i4], 2),
|
10582
10793
|
node = _Object$entries3$_i[1];
|
10583
10794
|
|
10584
|
-
if (!available.has(node.getAttribute(
|
10795
|
+
if (!available.has(node.getAttribute(_dom_constants_js__WEBPACK_IMPORTED_MODULE_4__.ATTRIBUTE_UPDATER_INSERT_REFERENCE))) {
|
10585
10796
|
containerElement.removeChild(node);
|
10586
10797
|
}
|
10587
10798
|
}
|
10588
10799
|
};
|
10589
10800
|
|
10590
|
-
for (
|
10801
|
+
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
10591
10802
|
var _ret = _loop();
|
10592
10803
|
|
10593
10804
|
if (_ret === "continue") continue;
|
10594
10805
|
}
|
10595
10806
|
} catch (err) {
|
10596
|
-
|
10807
|
+
_iterator5.e(err);
|
10597
10808
|
} finally {
|
10598
|
-
|
10809
|
+
_iterator5.f();
|
10599
10810
|
}
|
10600
10811
|
|
10601
10812
|
p.pop();
|
@@ -10621,7 +10832,7 @@ function insertElement(change) {
|
|
10621
10832
|
|
10622
10833
|
|
10623
10834
|
function appendNewDocumentFragment(container, key, ref, path) {
|
10624
|
-
var template = (0,
|
10835
|
+
var template = (0,_template_js__WEBPACK_IMPORTED_MODULE_14__.findDocumentTemplate)(key, container);
|
10625
10836
|
var nodes = template.createDocumentFragment();
|
10626
10837
|
|
10627
10838
|
for (var _i5 = 0, _Object$entries4 = Object.entries(nodes.childNodes); _i5 < _Object$entries4.length; _i5++) {
|
@@ -10630,7 +10841,7 @@ function appendNewDocumentFragment(container, key, ref, path) {
|
|
10630
10841
|
|
10631
10842
|
if (node instanceof HTMLElement) {
|
10632
10843
|
applyRecursive(node, key, path);
|
10633
|
-
node.setAttribute(
|
10844
|
+
node.setAttribute(_dom_constants_js__WEBPACK_IMPORTED_MODULE_4__.ATTRIBUTE_UPDATER_INSERT_REFERENCE, ref);
|
10634
10845
|
}
|
10635
10846
|
|
10636
10847
|
container.appendChild(node);
|
@@ -10648,15 +10859,15 @@ function appendNewDocumentFragment(container, key, ref, path) {
|
|
10648
10859
|
|
10649
10860
|
function applyRecursive(node, key, path) {
|
10650
10861
|
if (node instanceof HTMLElement) {
|
10651
|
-
if (node.hasAttribute(
|
10652
|
-
var value = node.getAttribute(
|
10653
|
-
node.setAttribute(
|
10862
|
+
if (node.hasAttribute(_dom_constants_js__WEBPACK_IMPORTED_MODULE_4__.ATTRIBUTE_UPDATER_REPLACE)) {
|
10863
|
+
var value = node.getAttribute(_dom_constants_js__WEBPACK_IMPORTED_MODULE_4__.ATTRIBUTE_UPDATER_REPLACE);
|
10864
|
+
node.setAttribute(_dom_constants_js__WEBPACK_IMPORTED_MODULE_4__.ATTRIBUTE_UPDATER_REPLACE, value.replaceAll("path:" + key, "path:" + path));
|
10654
10865
|
}
|
10655
10866
|
|
10656
|
-
if (node.hasAttribute(
|
10657
|
-
var _value = node.getAttribute(
|
10867
|
+
if (node.hasAttribute(_dom_constants_js__WEBPACK_IMPORTED_MODULE_4__.ATTRIBUTE_UPDATER_ATTRIBUTES)) {
|
10868
|
+
var _value = node.getAttribute(_dom_constants_js__WEBPACK_IMPORTED_MODULE_4__.ATTRIBUTE_UPDATER_ATTRIBUTES);
|
10658
10869
|
|
10659
|
-
node.setAttribute(
|
10870
|
+
node.setAttribute(_dom_constants_js__WEBPACK_IMPORTED_MODULE_4__.ATTRIBUTE_UPDATER_ATTRIBUTES, _value.replaceAll("path:" + key, "path:" + path));
|
10660
10871
|
}
|
10661
10872
|
|
10662
10873
|
for (var _i6 = 0, _Object$entries5 = Object.entries(node.childNodes); _i6 < _Object$entries5.length; _i6++) {
|
@@ -10678,10 +10889,10 @@ function applyRecursive(node, key, path) {
|
|
10678
10889
|
|
10679
10890
|
function updateContent(change) {
|
10680
10891
|
var self = this;
|
10681
|
-
var subject = self.subject.getRealSubject();
|
10682
|
-
var p = (0,
|
10683
|
-
runUpdateContent.call(this, this.element, p, subject);
|
10684
|
-
var slots = this.element.querySelectorAll('slot');
|
10892
|
+
var subject = self[_constants_js__WEBPACK_IMPORTED_MODULE_0__.internalSymbol].subject.getRealSubject();
|
10893
|
+
var p = (0,_util_clone_js__WEBPACK_IMPORTED_MODULE_11__.clone)(change === null || change === void 0 ? void 0 : change['path']);
|
10894
|
+
runUpdateContent.call(this, this[_constants_js__WEBPACK_IMPORTED_MODULE_0__.internalSymbol].element, p, subject);
|
10895
|
+
var slots = this[_constants_js__WEBPACK_IMPORTED_MODULE_0__.internalSymbol].element.querySelectorAll('slot');
|
10685
10896
|
|
10686
10897
|
if (slots.length > 0) {
|
10687
10898
|
for (var _i7 = 0, _Object$entries6 = Object.entries(slots); _i7 < _Object$entries6.length; _i7++) {
|
@@ -10690,9 +10901,9 @@ function updateContent(change) {
|
|
10690
10901
|
|
10691
10902
|
for (var _i8 = 0, _Object$entries7 = Object.entries(slot.assignedNodes()); _i8 < _Object$entries7.length; _i8++) {
|
10692
10903
|
var _Object$entries7$_i = _slicedToArray(_Object$entries7[_i8], 2),
|
10693
|
-
|
10904
|
+
_element3 = _Object$entries7$_i[1];
|
10694
10905
|
|
10695
|
-
runUpdateContent.call(this,
|
10906
|
+
runUpdateContent.call(this, _element3, p, subject);
|
10696
10907
|
}
|
10697
10908
|
}
|
10698
10909
|
}
|
@@ -10710,16 +10921,16 @@ function updateContent(change) {
|
|
10710
10921
|
function runUpdateContent(container, parts, subject) {
|
10711
10922
|
var _this3 = this;
|
10712
10923
|
|
10713
|
-
if (!(0,
|
10924
|
+
if (!(0,_types_is_js__WEBPACK_IMPORTED_MODULE_7__.isArray)(parts)) return;
|
10714
10925
|
if (!(container instanceof HTMLElement)) return;
|
10715
|
-
parts = (0,
|
10926
|
+
parts = (0,_util_clone_js__WEBPACK_IMPORTED_MODULE_11__.clone)(parts);
|
10716
10927
|
var mem = new WeakSet();
|
10717
10928
|
|
10718
10929
|
while (parts.length > 0) {
|
10719
10930
|
var current = parts.join('.');
|
10720
10931
|
parts.pop(); // Unfortunately, static data is always changed as well, since it is not possible to react to changes here.
|
10721
10932
|
|
10722
|
-
var query = '[' +
|
10933
|
+
var query = '[' + _dom_constants_js__WEBPACK_IMPORTED_MODULE_4__.ATTRIBUTE_UPDATER_REPLACE + '^="path:' + current + '"], [' + _dom_constants_js__WEBPACK_IMPORTED_MODULE_4__.ATTRIBUTE_UPDATER_REPLACE + '^="static:"]';
|
10723
10934
|
var e = container.querySelectorAll('' + query);
|
10724
10935
|
var iterator = new Set(_toConsumableArray(e));
|
10725
10936
|
|
@@ -10730,21 +10941,21 @@ function runUpdateContent(container, parts, subject) {
|
|
10730
10941
|
iterator.forEach(function (key, element) {
|
10731
10942
|
if (mem.has(element)) return;
|
10732
10943
|
mem.add(element);
|
10733
|
-
var attributes = element.getAttribute(
|
10734
|
-
var cmd = (0,
|
10735
|
-
var pipe = new
|
10944
|
+
var attributes = element.getAttribute(_dom_constants_js__WEBPACK_IMPORTED_MODULE_4__.ATTRIBUTE_UPDATER_REPLACE);
|
10945
|
+
var cmd = (0,_util_trimspaces_js__WEBPACK_IMPORTED_MODULE_12__.trimSpaces)(attributes);
|
10946
|
+
var pipe = new _data_pipe_js__WEBPACK_IMPORTED_MODULE_3__.Pipe(cmd);
|
10736
10947
|
|
10737
|
-
_this3.callbacks.forEach(function (f, n) {
|
10948
|
+
_this3[_constants_js__WEBPACK_IMPORTED_MODULE_0__.internalSymbol].callbacks.forEach(function (f, n) {
|
10738
10949
|
pipe.setCallback(n, f);
|
10739
10950
|
});
|
10740
10951
|
|
10741
10952
|
var value;
|
10742
10953
|
|
10743
10954
|
try {
|
10744
|
-
element.removeAttribute(
|
10955
|
+
element.removeAttribute(_dom_constants_js__WEBPACK_IMPORTED_MODULE_4__.ATTRIBUTE_ERRORMESSAGE);
|
10745
10956
|
value = pipe.run(subject);
|
10746
10957
|
} catch (e) {
|
10747
|
-
element.setAttribute(
|
10958
|
+
element.setAttribute(_dom_constants_js__WEBPACK_IMPORTED_MODULE_4__.ATTRIBUTE_ERRORMESSAGE, e.message);
|
10748
10959
|
}
|
10749
10960
|
|
10750
10961
|
if (value instanceof HTMLElement) {
|
@@ -10769,9 +10980,9 @@ function runUpdateContent(container, parts, subject) {
|
|
10769
10980
|
|
10770
10981
|
|
10771
10982
|
function updateAttributes(change) {
|
10772
|
-
var subject = this.subject.getRealSubject();
|
10773
|
-
var p = (0,
|
10774
|
-
runUpdateAttributes.call(this, this.element, p, subject);
|
10983
|
+
var subject = this[_constants_js__WEBPACK_IMPORTED_MODULE_0__.internalSymbol].subject.getRealSubject();
|
10984
|
+
var p = (0,_util_clone_js__WEBPACK_IMPORTED_MODULE_11__.clone)(change === null || change === void 0 ? void 0 : change['path']);
|
10985
|
+
runUpdateAttributes.call(this, this[_constants_js__WEBPACK_IMPORTED_MODULE_0__.internalSymbol].element, p, subject);
|
10775
10986
|
}
|
10776
10987
|
/**
|
10777
10988
|
* @private
|
@@ -10787,15 +10998,15 @@ function runUpdateAttributes(container, parts, subject) {
|
|
10787
10998
|
var _this4 = this;
|
10788
10999
|
|
10789
11000
|
var self = this;
|
10790
|
-
if (!(0,
|
10791
|
-
parts = (0,
|
11001
|
+
if (!(0,_types_is_js__WEBPACK_IMPORTED_MODULE_7__.isArray)(parts)) return;
|
11002
|
+
parts = (0,_util_clone_js__WEBPACK_IMPORTED_MODULE_11__.clone)(parts);
|
10792
11003
|
var mem = new WeakSet();
|
10793
11004
|
|
10794
11005
|
while (parts.length > 0) {
|
10795
11006
|
var current = parts.join('.');
|
10796
11007
|
parts.pop();
|
10797
11008
|
var iterator = new Set();
|
10798
|
-
var query = '[' +
|
11009
|
+
var query = '[' + _dom_constants_js__WEBPACK_IMPORTED_MODULE_4__.ATTRIBUTE_UPDATER_SELECT_THIS + '], [' + _dom_constants_js__WEBPACK_IMPORTED_MODULE_4__.ATTRIBUTE_UPDATER_ATTRIBUTES + '*="path:' + current + '"], [' + _dom_constants_js__WEBPACK_IMPORTED_MODULE_4__.ATTRIBUTE_UPDATER_ATTRIBUTES + '^="static:"]';
|
10799
11010
|
var e = container.querySelectorAll(query);
|
10800
11011
|
|
10801
11012
|
if (e.length > 0) {
|
@@ -10809,27 +11020,27 @@ function runUpdateAttributes(container, parts, subject) {
|
|
10809
11020
|
iterator.forEach(function (key, element) {
|
10810
11021
|
if (mem.has(element)) return;
|
10811
11022
|
mem.add(element);
|
10812
|
-
var attributes = element.getAttribute(
|
11023
|
+
var attributes = element.getAttribute(_dom_constants_js__WEBPACK_IMPORTED_MODULE_4__.ATTRIBUTE_UPDATER_ATTRIBUTES);
|
10813
11024
|
|
10814
11025
|
var _loop2 = function _loop2() {
|
10815
11026
|
var _Object$entries8$_i = _slicedToArray(_Object$entries8[_i9], 2),
|
10816
11027
|
def = _Object$entries8$_i[1];
|
10817
11028
|
|
10818
|
-
def = (0,
|
11029
|
+
def = (0,_util_trimspaces_js__WEBPACK_IMPORTED_MODULE_12__.trimSpaces)(def);
|
10819
11030
|
var i = def.indexOf(' ');
|
10820
|
-
var name = (0,
|
10821
|
-
var cmd = (0,
|
10822
|
-
var pipe = new
|
10823
|
-
self.callbacks.forEach(function (f, n) {
|
11031
|
+
var name = (0,_util_trimspaces_js__WEBPACK_IMPORTED_MODULE_12__.trimSpaces)(def.substr(0, i));
|
11032
|
+
var cmd = (0,_util_trimspaces_js__WEBPACK_IMPORTED_MODULE_12__.trimSpaces)(def.substr(i));
|
11033
|
+
var pipe = new _data_pipe_js__WEBPACK_IMPORTED_MODULE_3__.Pipe(cmd);
|
11034
|
+
self[_constants_js__WEBPACK_IMPORTED_MODULE_0__.internalSymbol].callbacks.forEach(function (f, n) {
|
10824
11035
|
pipe.setCallback(n, f, element);
|
10825
11036
|
});
|
10826
11037
|
var value = void 0;
|
10827
11038
|
|
10828
11039
|
try {
|
10829
|
-
element.removeAttribute(
|
11040
|
+
element.removeAttribute(_dom_constants_js__WEBPACK_IMPORTED_MODULE_4__.ATTRIBUTE_ERRORMESSAGE);
|
10830
11041
|
value = pipe.run(subject);
|
10831
11042
|
} catch (e) {
|
10832
|
-
element.setAttribute(
|
11043
|
+
element.setAttribute(_dom_constants_js__WEBPACK_IMPORTED_MODULE_4__.ATTRIBUTE_ERRORMESSAGE, e.message);
|
10833
11044
|
}
|
10834
11045
|
|
10835
11046
|
if (value === undefined) {
|
@@ -10895,19 +11106,23 @@ function handleInputControlAttributeUpdate(element, name, value) {
|
|
10895
11106
|
} else if (element instanceof HTMLInputElement) {
|
10896
11107
|
switch (element.type) {
|
10897
11108
|
case 'radio':
|
10898
|
-
if (name === 'checked'
|
10899
|
-
|
10900
|
-
|
10901
|
-
|
11109
|
+
if (name === 'checked') {
|
11110
|
+
if (value !== undefined) {
|
11111
|
+
element.checked = true;
|
11112
|
+
} else {
|
11113
|
+
element.checked = false;
|
11114
|
+
}
|
10902
11115
|
}
|
10903
11116
|
|
10904
11117
|
break;
|
10905
11118
|
|
10906
11119
|
case 'checkbox':
|
10907
|
-
if (name === 'checked'
|
10908
|
-
|
10909
|
-
|
10910
|
-
|
11120
|
+
if (name === 'checked') {
|
11121
|
+
if (value !== undefined) {
|
11122
|
+
element.checked = true;
|
11123
|
+
} else {
|
11124
|
+
element.checked = false;
|
11125
|
+
}
|
10911
11126
|
}
|
10912
11127
|
|
10913
11128
|
break;
|
@@ -10927,7 +11142,7 @@ function handleInputControlAttributeUpdate(element, name, value) {
|
|
10927
11142
|
}
|
10928
11143
|
}
|
10929
11144
|
|
10930
|
-
(0,
|
11145
|
+
(0,_namespace_js__WEBPACK_IMPORTED_MODULE_5__.assignToNamespace)('Monster.DOM', Updater);
|
10931
11146
|
|
10932
11147
|
|
10933
11148
|
/***/ }),
|
@@ -10973,7 +11188,7 @@ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || func
|
|
10973
11188
|
*
|
10974
11189
|
* ```
|
10975
11190
|
* <script type="module">
|
10976
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
11191
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
10977
11192
|
* Monster.Util.trimSpaces(" hello ")
|
10978
11193
|
* </script>
|
10979
11194
|
* ```
|
@@ -10982,7 +11197,7 @@ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || func
|
|
10982
11197
|
*
|
10983
11198
|
* ```
|
10984
11199
|
* <script type="module">
|
10985
|
-
* import {trimSpaces} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
11200
|
+
* import {trimSpaces} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/util/trimspaces.js';
|
10986
11201
|
* trimSpaces(' hello \\ ')
|
10987
11202
|
* </script>
|
10988
11203
|
* ```
|
@@ -11059,30 +11274,36 @@ function trimSpaces(value) {
|
|
11059
11274
|
__webpack_require__.r(__webpack_exports__);
|
11060
11275
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
11061
11276
|
/* harmony export */ "Monster": function() { return /* reexport safe */ _namespace_js__WEBPACK_IMPORTED_MODULE_0__.Monster; },
|
11062
|
-
/* harmony export */ "
|
11063
|
-
/* harmony export */ "
|
11064
|
-
/* harmony export */ "
|
11277
|
+
/* harmony export */ "findTargetElementFromEvent": function() { return /* binding */ findTargetElementFromEvent; },
|
11278
|
+
/* harmony export */ "fireEvent": function() { return /* binding */ fireEvent; },
|
11279
|
+
/* harmony export */ "fireCustomEvent": function() { return /* binding */ fireCustomEvent; }
|
11065
11280
|
/* harmony export */ });
|
11066
11281
|
/* harmony import */ var _namespace_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
|
11067
|
-
/* harmony import */ var
|
11282
|
+
/* harmony import */ var _types_is_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9);
|
11068
11283
|
/* harmony import */ var _types_validate_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(14);
|
11284
|
+
/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(43);
|
11069
11285
|
|
11070
11286
|
/**
|
11071
11287
|
* @author schukai GmbH
|
11072
11288
|
*/
|
11073
11289
|
|
11074
|
-
function
|
11290
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
11291
|
+
|
11292
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
11293
|
+
|
11294
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
11295
|
+
|
11075
11296
|
|
11076
11297
|
|
11077
11298
|
|
11078
11299
|
|
11079
11300
|
/**
|
11080
|
-
*
|
11301
|
+
* You can call the function via the monster namespace `new Monster.DOM.fireEvent()`.
|
11081
11302
|
*
|
11082
11303
|
* ```
|
11083
11304
|
* <script type="module">
|
11084
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
11085
|
-
*
|
11305
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
11306
|
+
* new Monster.DOM.fireEvent()
|
11086
11307
|
* </script>
|
11087
11308
|
* ```
|
11088
11309
|
*
|
@@ -11090,63 +11311,128 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
11090
11311
|
*
|
11091
11312
|
* ```
|
11092
11313
|
* <script type="module">
|
11093
|
-
* import {
|
11094
|
-
*
|
11314
|
+
* import {fireEvent} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/dom/events.js';
|
11315
|
+
* fireEvent()
|
11095
11316
|
* </script>
|
11096
11317
|
* ```
|
11097
11318
|
*
|
11098
|
-
*
|
11099
|
-
*
|
11100
|
-
*
|
11101
|
-
*
|
11102
|
-
* if (typeof window !== "object") {
|
11103
|
-
* const {window} = new JSDOM('', {
|
11104
|
-
* url: 'http://example.com/',
|
11105
|
-
* pretendToBeVisual: true
|
11106
|
-
* });
|
11107
|
-
*
|
11108
|
-
* [
|
11109
|
-
* 'self',
|
11110
|
-
* 'document',
|
11111
|
-
* 'Document',
|
11112
|
-
* 'Node',
|
11113
|
-
* 'Element',
|
11114
|
-
* 'HTMLElement',
|
11115
|
-
* 'DocumentFragment',
|
11116
|
-
* 'DOMParser',
|
11117
|
-
* 'XMLSerializer',
|
11118
|
-
* 'NodeFilter',
|
11119
|
-
* 'InputEvent',
|
11120
|
-
* 'CustomEvent'
|
11121
|
-
* ].forEach(key => (getGlobal()[key] = window[key]));
|
11122
|
-
* }
|
11123
|
-
* ```
|
11124
|
-
*
|
11125
|
-
* @returns {object}
|
11126
|
-
* @since 1.6.0
|
11319
|
+
* @param {HTMLElement|HTMLCollection|NodeList} element
|
11320
|
+
* @param {string} type
|
11321
|
+
* @return {void}
|
11322
|
+
* @since 1.10.0
|
11127
11323
|
* @copyright schukai GmbH
|
11128
11324
|
* @memberOf Monster.DOM
|
11129
|
-
* @throws {
|
11325
|
+
* @throws {TypeError} value is not an instance of HTMLElement or HTMLCollection
|
11326
|
+
* @summary Construct and send and event
|
11130
11327
|
*/
|
11131
11328
|
|
11132
|
-
function
|
11133
|
-
var
|
11134
|
-
|
11135
|
-
var document = (_getGlobal = (0,_types_global_js__WEBPACK_IMPORTED_MODULE_1__.getGlobal)()) === null || _getGlobal === void 0 ? void 0 : _getGlobal['document'];
|
11329
|
+
function fireEvent(element, type) {
|
11330
|
+
var document = (0,_util_js__WEBPACK_IMPORTED_MODULE_3__.getDocument)();
|
11136
11331
|
|
11137
|
-
if (
|
11138
|
-
|
11332
|
+
if (element instanceof HTMLElement) {
|
11333
|
+
if (type === 'click') {
|
11334
|
+
element.click();
|
11335
|
+
return;
|
11336
|
+
}
|
11337
|
+
|
11338
|
+
var event = new Event((0,_types_validate_js__WEBPACK_IMPORTED_MODULE_2__.validateString)(type), {
|
11339
|
+
bubbles: true,
|
11340
|
+
cancelable: true
|
11341
|
+
});
|
11342
|
+
element.dispatchEvent(event);
|
11343
|
+
} else if (element instanceof HTMLCollection || element instanceof NodeList) {
|
11344
|
+
var _iterator = _createForOfIteratorHelper(element),
|
11345
|
+
_step;
|
11346
|
+
|
11347
|
+
try {
|
11348
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
11349
|
+
var e = _step.value;
|
11350
|
+
fireEvent(e, type);
|
11351
|
+
}
|
11352
|
+
} catch (err) {
|
11353
|
+
_iterator.e(err);
|
11354
|
+
} finally {
|
11355
|
+
_iterator.f();
|
11356
|
+
}
|
11357
|
+
} else {
|
11358
|
+
throw new TypeError('value is not an instance of HTMLElement or HTMLCollection');
|
11139
11359
|
}
|
11360
|
+
}
|
11361
|
+
/**
|
11362
|
+
* You can call the function via the monster namespace `new Monster.DOM.fireCustomEvent()`.
|
11363
|
+
*
|
11364
|
+
* ```
|
11365
|
+
* <script type="module">
|
11366
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
11367
|
+
* new Monster.DOM.fireCustomEvent()
|
11368
|
+
* </script>
|
11369
|
+
* ```
|
11370
|
+
*
|
11371
|
+
* Alternatively, you can also integrate this function individually.
|
11372
|
+
*
|
11373
|
+
* ```
|
11374
|
+
* <script type="module">
|
11375
|
+
* import {fireCustomEvent} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/dom/events.js';
|
11376
|
+
* fireCustomEvent()
|
11377
|
+
* </script>
|
11378
|
+
* ```
|
11379
|
+
*
|
11380
|
+
* @param {HTMLElement|HTMLCollection|NodeList} element
|
11381
|
+
* @param {string} type
|
11382
|
+
* @return {void}
|
11383
|
+
* @since 1.19.0
|
11384
|
+
* @copyright schukai GmbH
|
11385
|
+
* @memberOf Monster.DOM
|
11386
|
+
* @throws {TypeError} value is not an instance of HTMLElement or HTMLCollection
|
11387
|
+
* @summary Construct and send and event
|
11388
|
+
*/
|
11140
11389
|
|
11141
|
-
|
11390
|
+
|
11391
|
+
function fireCustomEvent(element, type, detail) {
|
11392
|
+
var document = (0,_util_js__WEBPACK_IMPORTED_MODULE_3__.getDocument)();
|
11393
|
+
|
11394
|
+
if (element instanceof HTMLElement) {
|
11395
|
+
if (!(0,_types_is_js__WEBPACK_IMPORTED_MODULE_1__.isObject)(detail)) {
|
11396
|
+
detail = {
|
11397
|
+
detail: detail
|
11398
|
+
};
|
11399
|
+
}
|
11400
|
+
|
11401
|
+
var event = new CustomEvent((0,_types_validate_js__WEBPACK_IMPORTED_MODULE_2__.validateString)(type), {
|
11402
|
+
bubbles: true,
|
11403
|
+
cancelable: true,
|
11404
|
+
detail: detail
|
11405
|
+
});
|
11406
|
+
element.dispatchEvent(event);
|
11407
|
+
} else if (element instanceof HTMLCollection || element instanceof NodeList) {
|
11408
|
+
var _iterator2 = _createForOfIteratorHelper(element),
|
11409
|
+
_step2;
|
11410
|
+
|
11411
|
+
try {
|
11412
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
11413
|
+
var e = _step2.value;
|
11414
|
+
fireCustomEvent(e, type, detail);
|
11415
|
+
}
|
11416
|
+
} catch (err) {
|
11417
|
+
_iterator2.e(err);
|
11418
|
+
} finally {
|
11419
|
+
_iterator2.f();
|
11420
|
+
}
|
11421
|
+
} else {
|
11422
|
+
throw new TypeError('value is not an instance of HTMLElement or HTMLCollection');
|
11423
|
+
}
|
11142
11424
|
}
|
11143
11425
|
/**
|
11144
|
-
*
|
11426
|
+
* This function gets the path `Event.composedPath()` from an event and tries to find the next element
|
11427
|
+
* up the tree `element.closest()` with the attribute and value. If no value, or a value that is undefined or null,
|
11428
|
+
* is specified, only the attribute is searched.
|
11429
|
+
*
|
11430
|
+
* You can call the function via the monster namespace `new Monster.DOM.findTargetElementFromEvent()`.
|
11145
11431
|
*
|
11146
11432
|
* ```
|
11147
11433
|
* <script type="module">
|
11148
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
11149
|
-
*
|
11434
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
11435
|
+
* new Monster.DOM.findTargetElementFromEvent()
|
11150
11436
|
* </script>
|
11151
11437
|
* ```
|
11152
11438
|
*
|
@@ -11154,8 +11440,88 @@ function getDocument() {
|
|
11154
11440
|
*
|
11155
11441
|
* ```
|
11156
11442
|
* <script type="module">
|
11157
|
-
* import {
|
11158
|
-
*
|
11443
|
+
* import {findTargetElementFromEvent} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/dom/events.js';
|
11444
|
+
* findTargetElementFromEvent()
|
11445
|
+
* </script>
|
11446
|
+
* ```
|
11447
|
+
*
|
11448
|
+
* @since 1.14.0
|
11449
|
+
* @param {Event} event
|
11450
|
+
* @param {string} attributeName
|
11451
|
+
* @param {string|null|undefined} attributeValue
|
11452
|
+
* @throws {Error} unsupported event
|
11453
|
+
* @memberOf Monster.DOM
|
11454
|
+
* @throws {TypeError} value is not a string
|
11455
|
+
* @throws {TypeError} value is not an instance of HTMLElement
|
11456
|
+
* @summary Help function to find the appropriate control
|
11457
|
+
*/
|
11458
|
+
|
11459
|
+
|
11460
|
+
function findTargetElementFromEvent(event, attributeName, attributeValue) {
|
11461
|
+
(0,_types_validate_js__WEBPACK_IMPORTED_MODULE_2__.validateInstance)(event, Event);
|
11462
|
+
|
11463
|
+
if (typeof event.composedPath !== 'function') {
|
11464
|
+
throw new Error('unsupported event');
|
11465
|
+
}
|
11466
|
+
|
11467
|
+
var path = event.composedPath(); // closest cannot be used here, because closest is not correct for slotted elements
|
11468
|
+
|
11469
|
+
if ((0,_types_is_js__WEBPACK_IMPORTED_MODULE_1__.isArray)(path)) {
|
11470
|
+
for (var i = 0; i < path.length; i++) {
|
11471
|
+
var o = path[i];
|
11472
|
+
|
11473
|
+
if (o instanceof HTMLElement && o.hasAttribute(attributeName) && (attributeValue === undefined || o.getAttribute(attributeName) === attributeValue)) {
|
11474
|
+
return o;
|
11475
|
+
}
|
11476
|
+
}
|
11477
|
+
}
|
11478
|
+
|
11479
|
+
return undefined;
|
11480
|
+
}
|
11481
|
+
|
11482
|
+
(0,_namespace_js__WEBPACK_IMPORTED_MODULE_0__.assignToNamespace)('Monster.DOM', findTargetElementFromEvent, fireEvent, fireCustomEvent);
|
11483
|
+
|
11484
|
+
|
11485
|
+
/***/ }),
|
11486
|
+
/* 43 */
|
11487
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
11488
|
+
|
11489
|
+
__webpack_require__.r(__webpack_exports__);
|
11490
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
11491
|
+
/* harmony export */ "Monster": function() { return /* reexport safe */ _namespace_js__WEBPACK_IMPORTED_MODULE_0__.Monster; },
|
11492
|
+
/* harmony export */ "getWindow": function() { return /* binding */ getWindow; },
|
11493
|
+
/* harmony export */ "getDocument": function() { return /* binding */ getDocument; },
|
11494
|
+
/* harmony export */ "getDocumentFragmentFromString": function() { return /* binding */ getDocumentFragmentFromString; }
|
11495
|
+
/* harmony export */ });
|
11496
|
+
/* harmony import */ var _namespace_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
|
11497
|
+
/* harmony import */ var _types_global_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(16);
|
11498
|
+
/* harmony import */ var _types_validate_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(14);
|
11499
|
+
|
11500
|
+
/**
|
11501
|
+
* @author schukai GmbH
|
11502
|
+
*/
|
11503
|
+
|
11504
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
11505
|
+
|
11506
|
+
|
11507
|
+
|
11508
|
+
|
11509
|
+
/**
|
11510
|
+
* this method fetches the document object
|
11511
|
+
*
|
11512
|
+
* ```
|
11513
|
+
* <script type="module">
|
11514
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
11515
|
+
* console.log(Monster.DOM.getDocument())
|
11516
|
+
* </script>
|
11517
|
+
* ```
|
11518
|
+
*
|
11519
|
+
* Alternatively, you can also integrate this function individually.
|
11520
|
+
*
|
11521
|
+
* ```
|
11522
|
+
* <script type="module">
|
11523
|
+
* import {getDocument} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/dom/util.js';
|
11524
|
+
* console.log(getDocument())
|
11159
11525
|
* </script>
|
11160
11526
|
* ```
|
11161
11527
|
*
|
@@ -11169,8 +11535,6 @@ function getDocument() {
|
|
11169
11535
|
* pretendToBeVisual: true
|
11170
11536
|
* });
|
11171
11537
|
*
|
11172
|
-
* getGlobal()['window']=window;
|
11173
|
-
*
|
11174
11538
|
* [
|
11175
11539
|
* 'self',
|
11176
11540
|
* 'document',
|
@@ -11195,27 +11559,24 @@ function getDocument() {
|
|
11195
11559
|
* @throws {Error} not supported environment
|
11196
11560
|
*/
|
11197
11561
|
|
11562
|
+
function getDocument() {
|
11563
|
+
var _getGlobal;
|
11198
11564
|
|
11199
|
-
|
11200
|
-
var _getGlobal2;
|
11201
|
-
|
11202
|
-
var window = (_getGlobal2 = (0,_types_global_js__WEBPACK_IMPORTED_MODULE_1__.getGlobal)()) === null || _getGlobal2 === void 0 ? void 0 : _getGlobal2['window'];
|
11565
|
+
var document = (_getGlobal = (0,_types_global_js__WEBPACK_IMPORTED_MODULE_1__.getGlobal)()) === null || _getGlobal === void 0 ? void 0 : _getGlobal['document'];
|
11203
11566
|
|
11204
|
-
if (_typeof(
|
11567
|
+
if (_typeof(document) !== 'object') {
|
11205
11568
|
throw new Error("not supported environment");
|
11206
11569
|
}
|
11207
11570
|
|
11208
|
-
return
|
11571
|
+
return document;
|
11209
11572
|
}
|
11210
11573
|
/**
|
11211
|
-
*
|
11212
|
-
*
|
11213
|
-
* this method fetches the document object
|
11574
|
+
* this method fetches the window object
|
11214
11575
|
*
|
11215
11576
|
* ```
|
11216
11577
|
* <script type="module">
|
11217
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
11218
|
-
* console.log(Monster.DOM.
|
11578
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
11579
|
+
* console.log(Monster.DOM.getWindow())
|
11219
11580
|
* </script>
|
11220
11581
|
* ```
|
11221
11582
|
*
|
@@ -11223,8 +11584,8 @@ function getWindow() {
|
|
11223
11584
|
*
|
11224
11585
|
* ```
|
11225
11586
|
* <script type="module">
|
11226
|
-
* import {
|
11227
|
-
* console.log(
|
11587
|
+
* import {getWindow} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/dom/util.js';
|
11588
|
+
* console.log(getWindow(null))
|
11228
11589
|
* </script>
|
11229
11590
|
* ```
|
11230
11591
|
*
|
@@ -11238,6 +11599,8 @@ function getWindow() {
|
|
11238
11599
|
* pretendToBeVisual: true
|
11239
11600
|
* });
|
11240
11601
|
*
|
11602
|
+
* getGlobal()['window']=window;
|
11603
|
+
*
|
11241
11604
|
* [
|
11242
11605
|
* 'self',
|
11243
11606
|
* 'document',
|
@@ -11255,175 +11618,91 @@ function getWindow() {
|
|
11255
11618
|
* }
|
11256
11619
|
* ```
|
11257
11620
|
*
|
11258
|
-
* @returns {
|
11621
|
+
* @returns {object}
|
11259
11622
|
* @since 1.6.0
|
11260
11623
|
* @copyright schukai GmbH
|
11261
11624
|
* @memberOf Monster.DOM
|
11262
11625
|
* @throws {Error} not supported environment
|
11263
|
-
* @throws {TypeError} value is not a string
|
11264
|
-
*/
|
11265
|
-
|
11266
|
-
|
11267
|
-
function getDocumentFragmentFromString(html) {
|
11268
|
-
(0,_types_validate_js__WEBPACK_IMPORTED_MODULE_2__.validateString)(html);
|
11269
|
-
var document = getDocument();
|
11270
|
-
var template = document.createElement('template');
|
11271
|
-
template.innerHTML = html;
|
11272
|
-
return template.content;
|
11273
|
-
}
|
11274
|
-
|
11275
|
-
(0,_namespace_js__WEBPACK_IMPORTED_MODULE_0__.assignToNamespace)('Monster.DOM', getWindow, getDocument, getDocumentFragmentFromString);
|
11276
|
-
|
11277
|
-
|
11278
|
-
/***/ }),
|
11279
|
-
/* 43 */
|
11280
|
-
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
11281
|
-
|
11282
|
-
__webpack_require__.r(__webpack_exports__);
|
11283
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
11284
|
-
/* harmony export */ "Monster": function() { return /* reexport safe */ _namespace_js__WEBPACK_IMPORTED_MODULE_0__.Monster; },
|
11285
|
-
/* harmony export */ "findTargetElementFromEvent": function() { return /* binding */ findTargetElementFromEvent; },
|
11286
|
-
/* harmony export */ "fireEvent": function() { return /* binding */ fireEvent; }
|
11287
|
-
/* harmony export */ });
|
11288
|
-
/* harmony import */ var _namespace_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
|
11289
|
-
/* harmony import */ var _types_is_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9);
|
11290
|
-
/* harmony import */ var _types_validate_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(14);
|
11291
|
-
/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(42);
|
11292
|
-
|
11293
|
-
/**
|
11294
|
-
* @author schukai GmbH
|
11295
11626
|
*/
|
11296
11627
|
|
11297
|
-
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
11298
|
-
|
11299
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
11300
|
-
|
11301
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
11302
|
-
|
11303
11628
|
|
11629
|
+
function getWindow() {
|
11630
|
+
var _getGlobal2;
|
11304
11631
|
|
11632
|
+
var window = (_getGlobal2 = (0,_types_global_js__WEBPACK_IMPORTED_MODULE_1__.getGlobal)()) === null || _getGlobal2 === void 0 ? void 0 : _getGlobal2['window'];
|
11305
11633
|
|
11634
|
+
if (_typeof(window) !== 'object') {
|
11635
|
+
throw new Error("not supported environment");
|
11636
|
+
}
|
11306
11637
|
|
11638
|
+
return window;
|
11639
|
+
}
|
11307
11640
|
/**
|
11308
|
-
* You can call the function via the monster namespace `new Monster.DOM.fireEvent()`.
|
11309
11641
|
*
|
11310
|
-
* ```
|
11311
|
-
* <script type="module">
|
11312
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.26.0/dist/monster.js';
|
11313
|
-
* console.log(new Monster.DOM.fireEvent())
|
11314
|
-
* </script>
|
11315
|
-
* ```
|
11316
11642
|
*
|
11317
|
-
*
|
11643
|
+
* this method fetches the document object
|
11318
11644
|
*
|
11319
11645
|
* ```
|
11320
11646
|
* <script type="module">
|
11321
|
-
* import {
|
11322
|
-
* console.log(
|
11647
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
11648
|
+
* console.log(Monster.DOM.getDocumentFragmentFromString())
|
11323
11649
|
* </script>
|
11324
11650
|
* ```
|
11325
11651
|
*
|
11326
|
-
*
|
11327
|
-
* @param {string} type
|
11328
|
-
* @return {void}
|
11329
|
-
* @since 1.10.0
|
11330
|
-
* @copyright schukai GmbH
|
11331
|
-
* @memberOf Monster.DOM
|
11332
|
-
* @throws {TypeError} value is not an instance of HTMLElement or HTMLCollection
|
11333
|
-
* @summary Construct and send and event
|
11334
|
-
*/
|
11335
|
-
|
11336
|
-
function fireEvent(element, type) {
|
11337
|
-
var document = (0,_util_js__WEBPACK_IMPORTED_MODULE_3__.getDocument)();
|
11338
|
-
|
11339
|
-
if (element instanceof HTMLElement) {
|
11340
|
-
if (type === 'click') {
|
11341
|
-
element.click();
|
11342
|
-
return;
|
11343
|
-
}
|
11344
|
-
|
11345
|
-
var event = new Event((0,_types_validate_js__WEBPACK_IMPORTED_MODULE_2__.validateString)(type), {
|
11346
|
-
bubbles: true,
|
11347
|
-
cancelable: true
|
11348
|
-
});
|
11349
|
-
element.dispatchEvent(event);
|
11350
|
-
} else if (element instanceof HTMLCollection || element instanceof NodeList) {
|
11351
|
-
var _iterator = _createForOfIteratorHelper(element),
|
11352
|
-
_step;
|
11353
|
-
|
11354
|
-
try {
|
11355
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
11356
|
-
var e = _step.value;
|
11357
|
-
fireEvent(e, type);
|
11358
|
-
}
|
11359
|
-
} catch (err) {
|
11360
|
-
_iterator.e(err);
|
11361
|
-
} finally {
|
11362
|
-
_iterator.f();
|
11363
|
-
}
|
11364
|
-
} else {
|
11365
|
-
throw new TypeError('value is not an instance of HTMLElement or HTMLCollection');
|
11366
|
-
}
|
11367
|
-
}
|
11368
|
-
/**
|
11369
|
-
* This function gets the path `Event.composedPath()` from an event and tries to find the next element
|
11370
|
-
* up the tree `element.closest()` with the attribute and value. If no value, or a value that is undefined or null,
|
11371
|
-
* is specified, only the attribute is searched.
|
11372
|
-
*
|
11373
|
-
* You can call the function via the monster namespace `new Monster.DOM.findTargetElementFromEvent()`.
|
11652
|
+
* Alternatively, you can also integrate this function individually.
|
11374
11653
|
*
|
11375
11654
|
* ```
|
11376
11655
|
* <script type="module">
|
11377
|
-
* import {
|
11378
|
-
* console.log(
|
11656
|
+
* import {getDocumentFragmentFromString} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/dom/util.js';
|
11657
|
+
* console.log(getDocumentFragmentFromString('<div></div>'))
|
11379
11658
|
* </script>
|
11380
11659
|
* ```
|
11381
11660
|
*
|
11382
|
-
*
|
11661
|
+
* in nodejs this functionality can be performed with [jsdom](https://www.npmjs.com/package/jsdom).
|
11383
11662
|
*
|
11384
11663
|
* ```
|
11385
|
-
*
|
11386
|
-
*
|
11387
|
-
*
|
11388
|
-
*
|
11664
|
+
* import {JSDOM} from "jsdom"
|
11665
|
+
* if (typeof window !== "object") {
|
11666
|
+
* const {window} = new JSDOM('', {
|
11667
|
+
* url: 'http://example.com/',
|
11668
|
+
* pretendToBeVisual: true
|
11669
|
+
* });
|
11670
|
+
*
|
11671
|
+
* [
|
11672
|
+
* 'self',
|
11673
|
+
* 'document',
|
11674
|
+
* 'Document',
|
11675
|
+
* 'Node',
|
11676
|
+
* 'Element',
|
11677
|
+
* 'HTMLElement',
|
11678
|
+
* 'DocumentFragment',
|
11679
|
+
* 'DOMParser',
|
11680
|
+
* 'XMLSerializer',
|
11681
|
+
* 'NodeFilter',
|
11682
|
+
* 'InputEvent',
|
11683
|
+
* 'CustomEvent'
|
11684
|
+
* ].forEach(key => (getGlobal()[key] = window[key]));
|
11685
|
+
* }
|
11389
11686
|
* ```
|
11390
11687
|
*
|
11391
|
-
* @
|
11392
|
-
* @
|
11393
|
-
* @
|
11394
|
-
* @param {string|null|undefined} attributeValue
|
11395
|
-
* @throws {Error} unsupported event
|
11688
|
+
* @returns {DocumentFragment}
|
11689
|
+
* @since 1.6.0
|
11690
|
+
* @copyright schukai GmbH
|
11396
11691
|
* @memberOf Monster.DOM
|
11692
|
+
* @throws {Error} not supported environment
|
11397
11693
|
* @throws {TypeError} value is not a string
|
11398
|
-
* @throws {TypeError} value is not an instance of HTMLElement
|
11399
|
-
* @summary Help function to find the appropriate control
|
11400
11694
|
*/
|
11401
11695
|
|
11402
11696
|
|
11403
|
-
function
|
11404
|
-
(0,_types_validate_js__WEBPACK_IMPORTED_MODULE_2__.
|
11405
|
-
|
11406
|
-
|
11407
|
-
|
11408
|
-
|
11409
|
-
|
11410
|
-
var path = event.composedPath();
|
11411
|
-
var element = path === null || path === void 0 ? void 0 : path[0]; // closest cannot be used here, because closest is not correct for slotted elements
|
11412
|
-
|
11413
|
-
if ((0,_types_is_js__WEBPACK_IMPORTED_MODULE_1__.isArray)(path)) {
|
11414
|
-
for (var i = 0; i < path.length; i++) {
|
11415
|
-
var o = path[i];
|
11416
|
-
|
11417
|
-
if (o instanceof HTMLElement && o.hasAttribute(attributeName) && (attributeValue === undefined || o.getAttribute(attributeName) === attributeValue)) {
|
11418
|
-
return o;
|
11419
|
-
}
|
11420
|
-
}
|
11421
|
-
}
|
11422
|
-
|
11423
|
-
return undefined;
|
11697
|
+
function getDocumentFragmentFromString(html) {
|
11698
|
+
(0,_types_validate_js__WEBPACK_IMPORTED_MODULE_2__.validateString)(html);
|
11699
|
+
var document = getDocument();
|
11700
|
+
var template = document.createElement('template');
|
11701
|
+
template.innerHTML = html;
|
11702
|
+
return template.content;
|
11424
11703
|
}
|
11425
11704
|
|
11426
|
-
(0,_namespace_js__WEBPACK_IMPORTED_MODULE_0__.assignToNamespace)('Monster.DOM',
|
11705
|
+
(0,_namespace_js__WEBPACK_IMPORTED_MODULE_0__.assignToNamespace)('Monster.DOM', getWindow, getDocument, getDocumentFragmentFromString);
|
11427
11706
|
|
11428
11707
|
|
11429
11708
|
/***/ }),
|
@@ -11437,7 +11716,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
11437
11716
|
/* harmony export */ });
|
11438
11717
|
/* harmony import */ var _i18n_locale_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(45);
|
11439
11718
|
/* harmony import */ var _namespace_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2);
|
11440
|
-
/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(
|
11719
|
+
/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(43);
|
11441
11720
|
|
11442
11721
|
/**
|
11443
11722
|
* @author schukai GmbH
|
@@ -11464,7 +11743,7 @@ var DEFAULT_LANGUAGE = 'en';
|
|
11464
11743
|
*
|
11465
11744
|
* ```
|
11466
11745
|
* <script type="module">
|
11467
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
11746
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
11468
11747
|
* new Monster.DOM.getLocaleOfDocument()
|
11469
11748
|
* </script>
|
11470
11749
|
* ```
|
@@ -11473,7 +11752,7 @@ var DEFAULT_LANGUAGE = 'en';
|
|
11473
11752
|
*
|
11474
11753
|
* ```
|
11475
11754
|
* <script type="module">
|
11476
|
-
* import {getLocaleOfDocument} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
11755
|
+
* import {getLocaleOfDocument} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/dom/locale.js';
|
11477
11756
|
* new getLocaleOfDocument()
|
11478
11757
|
* </script>
|
11479
11758
|
* ```
|
@@ -11566,7 +11845,7 @@ var localeStringSymbol = Symbol('localeString');
|
|
11566
11845
|
*
|
11567
11846
|
* ```
|
11568
11847
|
* <script type="module">
|
11569
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
11848
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
11570
11849
|
* new Monster.I18n.Locale()
|
11571
11850
|
* </script>
|
11572
11851
|
* ```
|
@@ -11575,7 +11854,7 @@ var localeStringSymbol = Symbol('localeString');
|
|
11575
11854
|
*
|
11576
11855
|
* ```
|
11577
11856
|
* <script type="module">
|
11578
|
-
* import {Locale} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
11857
|
+
* import {Locale} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/i18n/locale.js';
|
11579
11858
|
* new Locale()
|
11580
11859
|
* </script>
|
11581
11860
|
* ```
|
@@ -11768,7 +12047,7 @@ var Locale = /*#__PURE__*/function (_Base) {
|
|
11768
12047
|
*
|
11769
12048
|
* ```
|
11770
12049
|
* <script type="module">
|
11771
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
12050
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
11772
12051
|
* new Monster.I18n.createLocale()
|
11773
12052
|
* </script>
|
11774
12053
|
* ```
|
@@ -11777,7 +12056,7 @@ var Locale = /*#__PURE__*/function (_Base) {
|
|
11777
12056
|
*
|
11778
12057
|
* ```
|
11779
12058
|
* <script type="module">
|
11780
|
-
* import {createLocale} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
12059
|
+
* import {createLocale} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/i18n/locale.js';
|
11781
12060
|
* createLocale()
|
11782
12061
|
* </script>
|
11783
12062
|
* ```
|
@@ -11953,7 +12232,7 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
11953
12232
|
*
|
11954
12233
|
* ```
|
11955
12234
|
* <script type="module">
|
11956
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
12235
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
11957
12236
|
* new Monster.I18n.Provider()
|
11958
12237
|
* </script>
|
11959
12238
|
* ```
|
@@ -11962,7 +12241,7 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
11962
12241
|
*
|
11963
12242
|
* ```
|
11964
12243
|
* <script type="module">
|
11965
|
-
* import {Provider} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
12244
|
+
* import {Provider} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/i18n/provider.js';
|
11966
12245
|
* new Provider()
|
11967
12246
|
* </script>
|
11968
12247
|
* ```
|
@@ -12063,7 +12342,7 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
12063
12342
|
*
|
12064
12343
|
* ```
|
12065
12344
|
* <script type="module">
|
12066
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
12345
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
12067
12346
|
* new Monster.Types.BaseWithOptions()
|
12068
12347
|
* </script>
|
12069
12348
|
* ```
|
@@ -12072,7 +12351,7 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
12072
12351
|
*
|
12073
12352
|
* ```
|
12074
12353
|
* <script type="module">
|
12075
|
-
* import {BaseWithOptions} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
12354
|
+
* import {BaseWithOptions} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/types/basewithoptions.js';
|
12076
12355
|
* new BaseWithOptions()
|
12077
12356
|
* </script>
|
12078
12357
|
* ```
|
@@ -12213,7 +12492,7 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
12213
12492
|
*
|
12214
12493
|
* ```
|
12215
12494
|
* <script type="module">
|
12216
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
12495
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
12217
12496
|
* new Monster.I18n.Translations()
|
12218
12497
|
* </script>
|
12219
12498
|
* ```
|
@@ -12222,15 +12501,15 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
12222
12501
|
*
|
12223
12502
|
* ```
|
12224
12503
|
* <script type="module">
|
12225
|
-
* import {Translations} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
12504
|
+
* import {Translations} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/i18n/translations.js';
|
12226
12505
|
* new Translations()
|
12227
12506
|
* </script>
|
12228
12507
|
* ```
|
12229
12508
|
*
|
12230
12509
|
* @example
|
12231
12510
|
*
|
12232
|
-
* import {Translations} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
12233
|
-
* import {parseLocale} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
12511
|
+
* import {Translations} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/i18n/translations.js';
|
12512
|
+
* import {parseLocale} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/i18n/locale.js';
|
12234
12513
|
*
|
12235
12514
|
* const translation = new Translations(parseLocale('en-GB'));
|
12236
12515
|
*
|
@@ -12502,7 +12781,7 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
12502
12781
|
*
|
12503
12782
|
* ```
|
12504
12783
|
* <script type="module">
|
12505
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
12784
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
12506
12785
|
* new Monster.I18n.Providers.Fetch()
|
12507
12786
|
* </script>
|
12508
12787
|
* ```
|
@@ -12511,14 +12790,14 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
12511
12790
|
*
|
12512
12791
|
* ```
|
12513
12792
|
* <script type="module">
|
12514
|
-
* import {Fetch} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
12793
|
+
* import {Fetch} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/i18n/providers/fetch.js';
|
12515
12794
|
* new Fetch()
|
12516
12795
|
* </script>
|
12517
12796
|
* ```
|
12518
12797
|
*
|
12519
12798
|
* @example <caption>das ist ein test</caption>
|
12520
12799
|
*
|
12521
|
-
* import {Fetch} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
12800
|
+
* import {Fetch} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/i18n/providers/fetch.js';
|
12522
12801
|
*
|
12523
12802
|
* // fetch from API
|
12524
12803
|
* const translation = new Fetch('https://example.com/${language}.json').getTranslation('en-GB');
|
@@ -12748,7 +13027,7 @@ var workingDataSymbol = Symbol('workingData');
|
|
12748
13027
|
*
|
12749
13028
|
* ```
|
12750
13029
|
* <script type="module">
|
12751
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
13030
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
12752
13031
|
* new Monster.Text.Formatter()
|
12753
13032
|
* </script>
|
12754
13033
|
* ```
|
@@ -12757,7 +13036,7 @@ var workingDataSymbol = Symbol('workingData');
|
|
12757
13036
|
*
|
12758
13037
|
* ```
|
12759
13038
|
* <script type="module">
|
12760
|
-
* import {Formatter} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
13039
|
+
* import {Formatter} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/text/formatter.js';
|
12761
13040
|
* new Formatter()
|
12762
13041
|
* </script>
|
12763
13042
|
* ```
|
@@ -12802,7 +13081,7 @@ var workingDataSymbol = Symbol('workingData');
|
|
12802
13081
|
*
|
12803
13082
|
* @example
|
12804
13083
|
*
|
12805
|
-
* import {Formatter} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
13084
|
+
* import {Formatter} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/text/formatter.js';
|
12806
13085
|
*
|
12807
13086
|
* new Formatter({
|
12808
13087
|
* a: {
|
@@ -13147,7 +13426,7 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
13147
13426
|
*
|
13148
13427
|
* ```
|
13149
13428
|
* <script type="module">
|
13150
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
13429
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
13151
13430
|
* console.log(new Monster.Logging.Handler())
|
13152
13431
|
* </script>
|
13153
13432
|
* ```
|
@@ -13156,7 +13435,7 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
13156
13435
|
*
|
13157
13436
|
* ```
|
13158
13437
|
* <script type="module">
|
13159
|
-
* import {ID} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
13438
|
+
* import {ID} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/logging/handler.js';
|
13160
13439
|
* console.log(new Handler())
|
13161
13440
|
* </script>
|
13162
13441
|
* ```
|
@@ -13394,7 +13673,7 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
13394
13673
|
*
|
13395
13674
|
* ```
|
13396
13675
|
* <script type="module">
|
13397
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
13676
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
13398
13677
|
* console.log(new Monster.Logging.LogEntry())
|
13399
13678
|
* </script>
|
13400
13679
|
* ```
|
@@ -13403,7 +13682,7 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
13403
13682
|
*
|
13404
13683
|
* ```
|
13405
13684
|
* <script type="module">
|
13406
|
-
* import {ID} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
13685
|
+
* import {ID} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/logging/logentry.js';
|
13407
13686
|
* console.log(new LogEntry())
|
13408
13687
|
* </script>
|
13409
13688
|
* ```
|
@@ -13589,7 +13868,7 @@ var OFF = 0;
|
|
13589
13868
|
*
|
13590
13869
|
* ```
|
13591
13870
|
* <script type="module">
|
13592
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
13871
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
13593
13872
|
* new Monster.Logging.Logger()
|
13594
13873
|
* </script>
|
13595
13874
|
* ```
|
@@ -13598,7 +13877,7 @@ var OFF = 0;
|
|
13598
13877
|
*
|
13599
13878
|
* ```
|
13600
13879
|
* <script type="module">
|
13601
|
-
* import {ID} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
13880
|
+
* import {ID} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/logging/logger.js';
|
13602
13881
|
* new Logger()
|
13603
13882
|
* </script>
|
13604
13883
|
* ```
|
@@ -13898,7 +14177,7 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
13898
14177
|
*
|
13899
14178
|
* ```
|
13900
14179
|
* <script type="module">
|
13901
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
14180
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
13902
14181
|
* console.log(new Monster.Logging.Handler.ConsoleHandler())
|
13903
14182
|
* </script>
|
13904
14183
|
* ```
|
@@ -13907,7 +14186,7 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
13907
14186
|
*
|
13908
14187
|
* ```
|
13909
14188
|
* <script type="module">
|
13910
|
-
* import {ConsoleHandler} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
14189
|
+
* import {ConsoleHandler} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/logging/handler/console.js';
|
13911
14190
|
* console.log(new ConsoleHandler())
|
13912
14191
|
* </script>
|
13913
14192
|
* ```
|
@@ -13983,7 +14262,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
13983
14262
|
*
|
13984
14263
|
* ```
|
13985
14264
|
* <script type="module">
|
13986
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
14265
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
13987
14266
|
* Monster.Math.random(1,10)
|
13988
14267
|
* // ↦ 5
|
13989
14268
|
* </script>
|
@@ -13993,7 +14272,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
13993
14272
|
*
|
13994
14273
|
* ```
|
13995
14274
|
* <script type="module">
|
13996
|
-
* import {random} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
14275
|
+
* import {random} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/math/random.js';
|
13997
14276
|
* random(1,10)
|
13998
14277
|
* // ↦ 5
|
13999
14278
|
* </script>
|
@@ -14150,7 +14429,7 @@ var internalCounter = 0;
|
|
14150
14429
|
*
|
14151
14430
|
* ```
|
14152
14431
|
* <script type="module">
|
14153
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
14432
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
14154
14433
|
* console.log(new Monster.Types.RandomID())
|
14155
14434
|
* </script>
|
14156
14435
|
* ```
|
@@ -14159,7 +14438,7 @@ var internalCounter = 0;
|
|
14159
14438
|
*
|
14160
14439
|
* ```
|
14161
14440
|
* <script type="module">
|
14162
|
-
* import {RandomID} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
14441
|
+
* import {RandomID} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/types/randomid.js';
|
14163
14442
|
* console.log(new RandomID())
|
14164
14443
|
* </script>
|
14165
14444
|
* ```
|
@@ -14242,7 +14521,7 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
14242
14521
|
*
|
14243
14522
|
* ```
|
14244
14523
|
* <script type="module">
|
14245
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
14524
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
14246
14525
|
* console.log(new Monster.Types.Version('1.2.3')) // ↦ 1.2.3
|
14247
14526
|
* console.log(new Monster.Types.Version('1')) // ↦ 1.0.0
|
14248
14527
|
* </script>
|
@@ -14252,7 +14531,7 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
14252
14531
|
*
|
14253
14532
|
* ```
|
14254
14533
|
* <script type="module">
|
14255
|
-
* import {Version} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
14534
|
+
* import {Version} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/types/version.js';
|
14256
14535
|
* console.log(new Version('1.2.3')) // ↦ 1.2.3
|
14257
14536
|
* console.log(new Version('1')) // ↦ 1.0.0
|
14258
14537
|
* </script>
|
@@ -14260,7 +14539,7 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
14260
14539
|
*
|
14261
14540
|
* @example
|
14262
14541
|
*
|
14263
|
-
* import {Version} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
14542
|
+
* import {Version} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/types/version.js';
|
14264
14543
|
*
|
14265
14544
|
* new Version('1.0.0') // ↦ 1.0.0
|
14266
14545
|
* new Version(1) // ↦ 1.0.0
|
@@ -14394,7 +14673,7 @@ var monsterVersion;
|
|
14394
14673
|
*
|
14395
14674
|
* ```
|
14396
14675
|
* <script type="module">
|
14397
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
14676
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
14398
14677
|
* console.log(Monster.getVersion())
|
14399
14678
|
* </script>
|
14400
14679
|
* ```
|
@@ -14403,7 +14682,7 @@ var monsterVersion;
|
|
14403
14682
|
*
|
14404
14683
|
* ```
|
14405
14684
|
* <script type="module">
|
14406
|
-
* import {getVersion} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
14685
|
+
* import {getVersion} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/types/version.js';
|
14407
14686
|
* console.log(getVersion())
|
14408
14687
|
* </script>
|
14409
14688
|
* ```
|
@@ -14422,7 +14701,7 @@ function getVersion() {
|
|
14422
14701
|
/**#@+ dont touch, replaced by make with package.json version */
|
14423
14702
|
|
14424
14703
|
|
14425
|
-
monsterVersion = new Version('1.
|
14704
|
+
monsterVersion = new Version('1.28.1');
|
14426
14705
|
/**#@-*/
|
14427
14706
|
|
14428
14707
|
return monsterVersion;
|
@@ -14478,7 +14757,7 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
14478
14757
|
*
|
14479
14758
|
* ```
|
14480
14759
|
* <script type="module">
|
14481
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
14760
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
14482
14761
|
* new Monster.Util.Comparator()
|
14483
14762
|
* </script>
|
14484
14763
|
* ```
|
@@ -14487,7 +14766,7 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
14487
14766
|
*
|
14488
14767
|
* ```
|
14489
14768
|
* <script type="module">
|
14490
|
-
* import {Comparator} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
14769
|
+
* import {Comparator} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/util/comparator.js';
|
14491
14770
|
* console.log(new Comparator())
|
14492
14771
|
* </script>
|
14493
14772
|
* ```
|
@@ -14512,7 +14791,7 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
14512
14791
|
*
|
14513
14792
|
* @example
|
14514
14793
|
*
|
14515
|
-
* import {Comparator} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
14794
|
+
* import {Comparator} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/util/comparator.js';
|
14516
14795
|
*
|
14517
14796
|
* console.log(new Comparator().lessThanOrEqual(2, 5))
|
14518
14797
|
* // ↦ true
|
@@ -14725,7 +15004,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
14725
15004
|
*
|
14726
15005
|
* ```
|
14727
15006
|
* <script type="module">
|
14728
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
15007
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/monster.js';
|
14729
15008
|
* Monster.Util.deepFreeze({})
|
14730
15009
|
* </script>
|
14731
15010
|
* ```
|
@@ -14734,7 +15013,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
14734
15013
|
*
|
14735
15014
|
* ```
|
14736
15015
|
* <script type="module">
|
14737
|
-
* import {deepFreeze} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
15016
|
+
* import {deepFreeze} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.28.1/dist/modules/util/freeze.js';
|
14738
15017
|
* deepFreeze({})
|
14739
15018
|
* </script>
|
14740
15019
|
* ```
|
@@ -14857,12 +15136,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
14857
15136
|
/* harmony import */ var _dom_constants_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(33);
|
14858
15137
|
/* harmony import */ var _dom_customcontrol_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(34);
|
14859
15138
|
/* harmony import */ var _dom_customelement_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(35);
|
14860
|
-
/* harmony import */ var _dom_events_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(
|
15139
|
+
/* harmony import */ var _dom_events_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(42);
|
14861
15140
|
/* harmony import */ var _dom_locale_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(44);
|
14862
15141
|
/* harmony import */ var _dom_template_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(38);
|
14863
15142
|
/* harmony import */ var _dom_theme_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(39);
|
14864
15143
|
/* harmony import */ var _dom_updater_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(40);
|
14865
|
-
/* harmony import */ var _dom_util_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(
|
15144
|
+
/* harmony import */ var _dom_util_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(43);
|
14866
15145
|
/* harmony import */ var _i18n_locale_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(45);
|
14867
15146
|
/* harmony import */ var _i18n_provider_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(46);
|
14868
15147
|
/* harmony import */ var _i18n_providers_fetch_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(49);
|