@schukai/monster 3.80.2 → 3.80.3
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +15 -0
- package/package.json +1 -1
- package/source/components/content/copy.mjs +7 -4
- package/source/components/datatable/change-button.mjs +1 -1
- package/source/components/datatable/columnbar.mjs +1 -1
- package/source/components/datatable/dataset.mjs +3 -3
- package/source/components/datatable/datasource/dom.mjs +2 -2
- package/source/components/datatable/datasource/rest.mjs +7 -7
- package/source/components/datatable/datasource.mjs +3 -3
- package/source/components/datatable/datatable/header.mjs +11 -11
- package/source/components/datatable/datatable.mjs +15 -15
- package/source/components/datatable/embedded-pagination.mjs +2 -2
- package/source/components/datatable/filter/date-range.mjs +5 -5
- package/source/components/datatable/filter/input.mjs +2 -2
- package/source/components/datatable/filter/range.mjs +3 -3
- package/source/components/datatable/filter/settings.mjs +5 -5
- package/source/components/datatable/filter/util.mjs +3 -3
- package/source/components/datatable/filter-button.mjs +1 -1
- package/source/components/datatable/filter.mjs +11 -11
- package/source/components/datatable/pagination.mjs +3 -3
- package/source/components/datatable/save-button.mjs +1 -1
- package/source/components/datatable/status.mjs +1 -1
- package/source/components/form/action-button.mjs +2 -2
- package/source/components/form/api-button.mjs +1 -1
- package/source/components/form/button-bar.mjs +3 -3
- package/source/components/form/confirm-button.mjs +4 -4
- package/source/components/form/context-error.mjs +4 -4
- package/source/components/form/context-help.mjs +1 -1
- package/source/components/form/field-set.mjs +2 -2
- package/source/components/form/form.mjs +3 -3
- package/source/components/form/message-state-button.mjs +6 -6
- package/source/components/form/popper-button.mjs +1 -1
- package/source/components/form/reload.mjs +5 -22
- package/source/components/form/select.mjs +11 -10
- package/source/components/form/shadow-reload.mjs +1 -1
- package/source/components/form/state-button.mjs +1 -1
- package/source/components/form/template.mjs +4 -4
- package/source/components/form/toggle-switch.mjs +1 -1
- package/source/components/form/tree-select.mjs +1 -1
- package/source/components/form/util/floating-ui.mjs +1 -1
- package/source/components/host/call-button.mjs +1 -1
- package/source/components/host/config-manager.mjs +6 -6
- package/source/components/host/host.mjs +8 -8
- package/source/components/host/overlay.mjs +13 -13
- package/source/components/host/toggle-button.mjs +1 -1
- package/source/components/host/util.mjs +1 -1
- package/source/components/host/viewer.mjs +5 -5
- package/source/components/layout/collapse.mjs +20 -19
- package/source/components/layout/details.mjs +5 -5
- package/source/components/layout/iframe.mjs +2 -2
- package/source/components/layout/panel.mjs +3 -3
- package/source/components/layout/popper.mjs +1 -1
- package/source/components/layout/slider.mjs +6 -6
- package/source/components/layout/split-panel.mjs +3 -3
- package/source/components/layout/tabs.mjs +3 -9
- package/source/components/layout/width-toggle.mjs +4 -4
- package/source/components/navigation/table-of-content.mjs +3 -3
- package/source/components/notify/message.mjs +0 -1
- package/source/components/state/log/entry.mjs +6 -6
- package/source/components/state/log.mjs +3 -39
- package/source/components/state/state.mjs +1 -1
- package/source/components/tree-menu/dragable-tree-menu.mjs +2 -2
- package/source/components/tree-menu/tree-menu.mjs +1 -1
- package/source/constraints/abstract.mjs +2 -2
- package/source/constraints/abstractoperator.mjs +1 -1
- package/source/constraints/andoperator.mjs +5 -5
- package/source/constraints/invalid.mjs +5 -5
- package/source/constraints/isarray.mjs +5 -5
- package/source/constraints/isobject.mjs +5 -5
- package/source/constraints/oroperator.mjs +5 -5
- package/source/constraints/valid.mjs +4 -4
- package/source/data/buildmap.mjs +2 -1
- package/source/data/datasource/dom.mjs +1 -1
- package/source/data/datasource/server/restapi/data-fetch-error.mjs +1 -1
- package/source/data/datasource/server/restapi/writeerror.mjs +1 -1
- package/source/data/datasource/server/restapi.mjs +2 -2
- package/source/data/datasource/server/webconnect.mjs +4 -4
- package/source/data/datasource/server.mjs +5 -5
- package/source/data/datasource/storage/localstorage.mjs +1 -1
- package/source/data/datasource/storage/sessionstorage.mjs +1 -1
- package/source/data/datasource/storage.mjs +1 -1
- package/source/data/datasource.mjs +4 -5
- package/source/data/pathfinder.mjs +10 -9
- package/source/data/pipe.mjs +5 -4
- package/source/data/transformer.mjs +23 -11
- package/source/dom/assembler.mjs +2 -2
- package/source/dom/attributes.mjs +2 -2
- package/source/dom/customcontrol.mjs +1 -1
- package/source/dom/customelement.mjs +36 -67
- package/source/dom/dimension.mjs +3 -3
- package/source/dom/focusmanager.mjs +1 -1
- package/source/dom/locale.mjs +1 -1
- package/source/dom/resource/data.mjs +1 -1
- package/source/dom/resource/link/stylesheet.mjs +1 -1
- package/source/dom/resource/link.mjs +1 -1
- package/source/dom/resource/script.mjs +1 -1
- package/source/dom/template.mjs +2 -2
- package/source/dom/theme.mjs +2 -2
- package/source/dom/updater.mjs +5 -6
- package/source/dom/util/extract-keys.mjs +1 -1
- package/source/dom/util/init-options-from-attributes.mjs +1 -1
- package/source/dom/util/set-option-from-attribute.mjs +1 -1
- package/source/dom/util.mjs +9 -9
- package/source/i18n/formatter.mjs +1 -1
- package/source/i18n/locale.mjs +2 -2
- package/source/i18n/provider.mjs +1 -1
- package/source/i18n/providers/embed.mjs +1 -3
- package/source/i18n/translations.mjs +2 -2
- package/source/logging/handler/console.mjs +1 -1
- package/source/logging/handler.mjs +11 -11
- package/source/logging/logentry.mjs +2 -2
- package/source/logging/logger.mjs +11 -11
- package/source/math/random.mjs +2 -2
- package/source/monster.mjs +1 -0
- package/source/net/webconnect/message.mjs +3 -3
- package/source/net/webconnect.mjs +10 -10
- package/source/text/bracketed-key-value-hash.mjs +2 -2
- package/source/text/generate-range-comparison-expression.mjs +1 -1
- package/source/types/base.mjs +4 -4
- package/source/types/basewithoptions.mjs +3 -4
- package/source/types/dataurl.mjs +6 -8
- package/source/types/global.mjs +2 -2
- package/source/types/internal.mjs +3 -3
- package/source/types/is.mjs +10 -20
- package/source/types/mediatype.mjs +1 -1
- package/source/types/node.mjs +1 -1
- package/source/types/nodelist.mjs +7 -7
- package/source/types/observablequeue.mjs +7 -7
- package/source/types/observer.mjs +6 -6
- package/source/types/proxyobserver.mjs +8 -8
- package/source/types/queue.mjs +3 -3
- package/source/types/stack.mjs +3 -3
- package/source/types/tokenlist.mjs +12 -12
- package/source/types/uniquequeue.mjs +2 -2
- package/source/types/version.mjs +4 -4
- package/source/util/clone.mjs +2 -2
- package/source/util/comparator.mjs +1 -2
- package/source/util/deadmansswitch.mjs +7 -5
- package/source/util/freeze.mjs +1 -1
- package/source/util/processing.mjs +2 -2
- package/source/util/runtime.mjs +1 -1
@@ -55,7 +55,7 @@ class Entry extends Base {
|
|
55
55
|
|
56
56
|
/**
|
57
57
|
* This method is called by the `instanceof` operator.
|
58
|
-
* @
|
58
|
+
* @return {symbol}
|
59
59
|
*/
|
60
60
|
static get [instanceSymbol]() {
|
61
61
|
return Symbol.for("@schukai/component-state/log/entry");
|
@@ -63,7 +63,7 @@ class Entry extends Base {
|
|
63
63
|
|
64
64
|
/**
|
65
65
|
*
|
66
|
-
* @
|
66
|
+
* @return {object}
|
67
67
|
*/
|
68
68
|
get internalDefaults() {
|
69
69
|
return {
|
@@ -75,7 +75,7 @@ class Entry extends Base {
|
|
75
75
|
}
|
76
76
|
|
77
77
|
/**
|
78
|
-
* @
|
78
|
+
* @return {string}
|
79
79
|
*/
|
80
80
|
get title() {
|
81
81
|
return this.getInternal("title");
|
@@ -89,7 +89,7 @@ class Entry extends Base {
|
|
89
89
|
}
|
90
90
|
|
91
91
|
/**
|
92
|
-
* @
|
92
|
+
* @return {string}
|
93
93
|
*/
|
94
94
|
get message() {
|
95
95
|
return this.getInternal("message");
|
@@ -103,7 +103,7 @@ class Entry extends Base {
|
|
103
103
|
}
|
104
104
|
|
105
105
|
/**
|
106
|
-
* @
|
106
|
+
* @return {string}
|
107
107
|
*/
|
108
108
|
get user() {
|
109
109
|
return this.getInternal("user");
|
@@ -117,7 +117,7 @@ class Entry extends Base {
|
|
117
117
|
}
|
118
118
|
|
119
119
|
/**
|
120
|
-
* @
|
120
|
+
* @return {Date}
|
121
121
|
*/
|
122
122
|
get date() {
|
123
123
|
return this.getInternal("date");
|
@@ -38,47 +38,11 @@ const logElementSymbol = Symbol("logElement");
|
|
38
38
|
*/
|
39
39
|
const emptyStateElementSymbol = Symbol("emptyStateElement");
|
40
40
|
|
41
|
-
/**
|
42
|
-
* Log is a control to show a log message.
|
43
|
-
*
|
44
|
-
* <img src="./images/log.png">
|
45
|
-
*
|
46
|
-
* Dependencies: the system uses functions of the [monsterjs](https://monsterjs.org/) library
|
47
|
-
*
|
48
|
-
* You can create this control either by specifying the HTML tag <monster-state />` directly in the HTML or using
|
49
|
-
* Javascript via the `document.createElement('monster-state');` method.
|
50
|
-
*
|
51
|
-
* ```html
|
52
|
-
* <monster-log></monster-log>
|
53
|
-
* ```
|
54
|
-
*
|
55
|
-
* Or you can create this CustomControl directly in Javascript:
|
56
|
-
*
|
57
|
-
* ```js
|
58
|
-
* import {Log} from '@schukai/component-state/source/log.js';
|
59
|
-
* document.createElement('monster-log');
|
60
|
-
* ```
|
61
|
-
*
|
62
|
-
* @externalExample ../../../example/components/state/log.mjs
|
63
|
-
* @startuml log.png
|
64
|
-
* skinparam monochrome true
|
65
|
-
* skinparam shadowing false
|
66
|
-
* HTMLElement <|-- CustomElement
|
67
|
-
* CustomElement <|-- Log
|
68
|
-
* @enduml
|
69
|
-
*
|
70
|
-
* @copyright schukai GmbH
|
71
|
-
* @memberOf Monster.Components.State
|
72
|
-
* @summary Log is a control to show a log message.
|
73
|
-
*/
|
74
|
-
|
75
41
|
/**
|
76
42
|
* A Log component
|
77
43
|
*
|
78
44
|
* @fragments /fragments/components/layout/collapse/
|
79
45
|
*
|
80
|
-
* @example /examples/components/layout/collapse-simple
|
81
|
-
*
|
82
46
|
* @since 3.74.0
|
83
47
|
* @copyright schukai GmbH
|
84
48
|
* @summary A Log component to show a log message.
|
@@ -96,7 +60,7 @@ class Log extends CustomElement {
|
|
96
60
|
|
97
61
|
/**
|
98
62
|
* This method is called by the `instanceof` operator.
|
99
|
-
* @
|
63
|
+
* @return {symbol}
|
100
64
|
*/
|
101
65
|
static get [instanceSymbol]() {
|
102
66
|
return Symbol.for("@schukai/monster/components/state/log@@instance");
|
@@ -153,7 +117,7 @@ class Log extends CustomElement {
|
|
153
117
|
/**
|
154
118
|
* Add an entry to the log
|
155
119
|
* @param entry
|
156
|
-
* @
|
120
|
+
* @return {Log}
|
157
121
|
*/
|
158
122
|
addEntry(entry) {
|
159
123
|
validateInstance(entry, Entry);
|
@@ -171,7 +135,7 @@ class Log extends CustomElement {
|
|
171
135
|
* Add a log message
|
172
136
|
* @param message
|
173
137
|
* @param date
|
174
|
-
* @
|
138
|
+
* @return {Log}
|
175
139
|
*/
|
176
140
|
addMessage(message, date) {
|
177
141
|
if (!date) {
|
@@ -50,7 +50,7 @@ class State extends CustomControl {
|
|
50
50
|
|
51
51
|
/**
|
52
52
|
* This method is called by the `instanceof` operator.
|
53
|
-
* @
|
53
|
+
* @return {symbol}
|
54
54
|
*/
|
55
55
|
static get [instanceSymbol]() {
|
56
56
|
return Symbol.for("@schukai/monster/components/state/state@@instance");
|
@@ -128,7 +128,7 @@
|
|
128
128
|
// * @copyright schukai GmbH
|
129
129
|
// * @memberOf Monster.Components.TreeMenu
|
130
130
|
// * @summary A TreeMenu control
|
131
|
-
// * @fires
|
131
|
+
// * @fires monster-fetched
|
132
132
|
// */
|
133
133
|
// class TreeMenu extends CustomElement {
|
134
134
|
// /**
|
@@ -613,7 +613,7 @@
|
|
613
613
|
// // * @throws {Error} request failed
|
614
614
|
// // * @throws {Error} not found
|
615
615
|
// // * @throws {Error} undefined status or type
|
616
|
-
// // * @fires
|
616
|
+
// // * @fires monster-fetched
|
617
617
|
// // */
|
618
618
|
// // function initIntersectionObserver() {
|
619
619
|
// // const self = this;
|
@@ -80,7 +80,7 @@ const openEntryEventHandlerSymbol = Symbol("openEntryEventHandler");
|
|
80
80
|
class TreeMenu extends CustomElement {
|
81
81
|
/**
|
82
82
|
* This method is called by the `instanceof` operator.
|
83
|
-
* @
|
83
|
+
* @return {symbol}
|
84
84
|
*/
|
85
85
|
static get [instanceSymbol]() {
|
86
86
|
return Symbol.for("@schukai/monster/components/tree-menu@@instance");
|
@@ -37,7 +37,7 @@ class AbstractConstraint extends Base {
|
|
37
37
|
* this method must return a promise containing the result of the check.
|
38
38
|
*
|
39
39
|
* @param {*} value
|
40
|
-
* @
|
40
|
+
* @return {Promise}
|
41
41
|
*/
|
42
42
|
isValid(value) {
|
43
43
|
return Promise.reject(value);
|
@@ -45,7 +45,7 @@ class AbstractConstraint extends Base {
|
|
45
45
|
|
46
46
|
/**
|
47
47
|
* This method is called by the `instanceof` operator.
|
48
|
-
* @
|
48
|
+
* @return {symbol}
|
49
49
|
* @since 2.1.0
|
50
50
|
*/
|
51
51
|
static get [instanceSymbol]() {
|
@@ -23,19 +23,19 @@ export { AndOperator };
|
|
23
23
|
*
|
24
24
|
* The AndOperator is used to link several constraints. The constraint is fulfilled if all constraints of the operators are fulfilled.
|
25
25
|
*
|
26
|
-
* @
|
26
|
+
* @example /examples/libraries/constraints/andoperator/ A simple example
|
27
|
+
*
|
27
28
|
* @license AGPLv3
|
28
29
|
* @since 1.3.0
|
29
30
|
* @copyright schukai GmbH
|
30
|
-
* @memberOf Monster.Constraints
|
31
31
|
* @summary A and operator constraint
|
32
32
|
*/
|
33
33
|
class AndOperator extends AbstractOperator {
|
34
34
|
/**
|
35
|
-
*
|
35
|
+
* This method returns a promise containing the result of the check.
|
36
36
|
*
|
37
37
|
* @param {*} value
|
38
|
-
* @
|
38
|
+
* @return {Promise}
|
39
39
|
*/
|
40
40
|
isValid(value) {
|
41
41
|
return Promise.all([
|
@@ -46,7 +46,7 @@ class AndOperator extends AbstractOperator {
|
|
46
46
|
|
47
47
|
/**
|
48
48
|
* This method is called by the `instanceof` operator.
|
49
|
-
* @
|
49
|
+
* @return {symbol}
|
50
50
|
* @since 2.1.0
|
51
51
|
*/
|
52
52
|
static get [instanceSymbol]() {
|
@@ -23,19 +23,19 @@ export { Invalid };
|
|
23
23
|
*
|
24
24
|
* The invalid constraint allows an always invalid query to be performed. this constraint is mainly intended for testing.
|
25
25
|
*
|
26
|
-
* @
|
26
|
+
* @example /examples/libraries/constraints/invalid/ A simple example
|
27
|
+
*
|
27
28
|
* @license AGPLv3
|
28
29
|
* @since 1.3.0
|
29
30
|
* @copyright schukai GmbH
|
30
|
-
* @memberOf Monster.Constraints
|
31
31
|
* @summary A constraint that always invalid
|
32
32
|
*/
|
33
33
|
class Invalid extends AbstractConstraint {
|
34
34
|
/**
|
35
|
-
* this method
|
35
|
+
* this method returns a rejected promise
|
36
36
|
*
|
37
37
|
* @param {*} value
|
38
|
-
* @
|
38
|
+
* @return {Promise}
|
39
39
|
*/
|
40
40
|
isValid(value) {
|
41
41
|
return Promise.reject(value);
|
@@ -43,7 +43,7 @@ class Invalid extends AbstractConstraint {
|
|
43
43
|
|
44
44
|
/**
|
45
45
|
* This method is called by the `instanceof` operator.
|
46
|
-
* @
|
46
|
+
* @return {symbol}
|
47
47
|
* @since 2.1.0
|
48
48
|
*/
|
49
49
|
static get [instanceSymbol]() {
|
@@ -22,19 +22,19 @@ export { IsArray };
|
|
22
22
|
*
|
23
23
|
* The uniform API of the constraints allows chains to be formed.
|
24
24
|
*
|
25
|
-
* @
|
25
|
+
* @example /examples/libraries/constraints/isarray/ A simple example
|
26
|
+
*
|
26
27
|
* @license AGPLv3
|
27
28
|
* @since 1.3.0
|
28
29
|
* @copyright schukai GmbH
|
29
|
-
* @memberOf Monster.Constraints
|
30
30
|
* @summary A constraint to check if a value is an array
|
31
31
|
*/
|
32
32
|
class IsArray extends AbstractConstraint {
|
33
33
|
/**
|
34
|
-
* this method
|
34
|
+
* this method returns a promise containing the result of the check.
|
35
35
|
*
|
36
36
|
* @param {*} value
|
37
|
-
* @
|
37
|
+
* @return {Promise}
|
38
38
|
*/
|
39
39
|
isValid(value) {
|
40
40
|
if (isArray(value)) {
|
@@ -46,7 +46,7 @@ class IsArray extends AbstractConstraint {
|
|
46
46
|
|
47
47
|
/**
|
48
48
|
* This method is called by the `instanceof` operator.
|
49
|
-
* @
|
49
|
+
* @return {symbol}
|
50
50
|
* @since 2.1.0
|
51
51
|
*/
|
52
52
|
static get [instanceSymbol]() {
|
@@ -22,19 +22,19 @@ export { IsObject };
|
|
22
22
|
*
|
23
23
|
* The uniform API of the constraints allows chains to be formed.
|
24
24
|
*
|
25
|
-
* @
|
25
|
+
* @example /examples/libraries/constraints/isobject/ A simple example
|
26
|
+
*
|
26
27
|
* @license AGPLv3
|
27
28
|
* @since 1.3.0
|
28
29
|
* @copyright schukai GmbH
|
29
|
-
* @memberOf Monster.Constraints
|
30
30
|
* @summary A constraint to check if a value is an object
|
31
31
|
*/
|
32
32
|
class IsObject extends AbstractConstraint {
|
33
33
|
/**
|
34
|
-
* this method
|
34
|
+
* this method returns a promise containing the result of the check.
|
35
35
|
*
|
36
36
|
* @param {*} value
|
37
|
-
* @
|
37
|
+
* @return {Promise}
|
38
38
|
*/
|
39
39
|
isValid(value) {
|
40
40
|
if (isObject(value)) {
|
@@ -46,7 +46,7 @@ class IsObject extends AbstractConstraint {
|
|
46
46
|
|
47
47
|
/**
|
48
48
|
* This method is called by the `instanceof` operator.
|
49
|
-
* @
|
49
|
+
* @return {symbol}
|
50
50
|
* @since 2.1.0
|
51
51
|
*/
|
52
52
|
static get [instanceSymbol]() {
|
@@ -23,19 +23,19 @@ export { OrOperator };
|
|
23
23
|
*
|
24
24
|
* The OrOperator is used to link several constraints. The constraint is fulfilled if one of the constraints is fulfilled.
|
25
25
|
*
|
26
|
-
* @
|
26
|
+
* @example /examples/libraries/constraints/oroperator/ A simple example
|
27
|
+
*
|
27
28
|
* @license AGPLv3
|
28
29
|
* @since 1.3.0
|
29
30
|
* @copyright schukai GmbH
|
30
|
-
* @memberOf Monster.Constraints
|
31
31
|
* @summary A or operator
|
32
32
|
*/
|
33
33
|
class OrOperator extends AbstractOperator {
|
34
34
|
/**
|
35
|
-
* this method
|
35
|
+
* this method returns a promise containing the result of the check.
|
36
36
|
*
|
37
37
|
* @param {*} value
|
38
|
-
* @
|
38
|
+
* @return {Promise}
|
39
39
|
*/
|
40
40
|
isValid(value) {
|
41
41
|
var self = this;
|
@@ -74,7 +74,7 @@ class OrOperator extends AbstractOperator {
|
|
74
74
|
|
75
75
|
/**
|
76
76
|
* This method is called by the `instanceof` operator.
|
77
|
-
* @
|
77
|
+
* @return {symbol}
|
78
78
|
* @since 2.1.0
|
79
79
|
*/
|
80
80
|
static get [instanceSymbol]() {
|
@@ -23,11 +23,11 @@ export { Valid };
|
|
23
23
|
*
|
24
24
|
* The valid constraint allows an always valid query to be performed. this constraint is mainly intended for testing.
|
25
25
|
*
|
26
|
-
* @
|
26
|
+
* @example /examples/libraries/constraints/valid/ A simple example
|
27
|
+
*
|
27
28
|
* @license AGPLv3
|
28
29
|
* @since 1.3.0
|
29
30
|
* @copyright schukai GmbH
|
30
|
-
* @memberOf Monster.Constraints
|
31
31
|
* @summary A constraint that always valid
|
32
32
|
*/
|
33
33
|
class Valid extends AbstractConstraint {
|
@@ -35,7 +35,7 @@ class Valid extends AbstractConstraint {
|
|
35
35
|
* this method return a promise containing the result of the check.
|
36
36
|
*
|
37
37
|
* @param {*} value
|
38
|
-
* @
|
38
|
+
* @return {Promise}
|
39
39
|
*/
|
40
40
|
isValid(value) {
|
41
41
|
return Promise.resolve(value);
|
@@ -43,7 +43,7 @@ class Valid extends AbstractConstraint {
|
|
43
43
|
|
44
44
|
/**
|
45
45
|
* This method is called by the `instanceof` operator.
|
46
|
-
* @
|
46
|
+
* @return {symbol}
|
47
47
|
* @since 2.1.0
|
48
48
|
*/
|
49
49
|
static get [instanceSymbol]() {
|
package/source/data/buildmap.mjs
CHANGED
@@ -33,9 +33,10 @@ const PARENT = "^";
|
|
33
33
|
* The templates determine the appearance of the keys and the value of the map. Either a single value
|
34
34
|
* id can be taken or a composite key ${id} ${name} can be used.
|
35
35
|
*
|
36
|
-
* If you want to access values of the parent data set, you have to use the ^ character, for example ${id} ${^.name}.
|
36
|
+
* If you want to access the values of the parent data set, you have to use the ^ character, for example, ${id} ${^.name}.
|
37
37
|
*
|
38
38
|
* @externalExample ../../example/data/buildmap.mjs
|
39
|
+
*
|
39
40
|
* @param {*} subject - The data object from which the map will be created
|
40
41
|
* @param {string|Monster.Data~exampleSelectorCallback} selector - The path to the data object, or a callback that returns a map.
|
41
42
|
* @param {string} [valueTemplate] - A template for the value of the map.
|
@@ -40,7 +40,7 @@ class DomStorage extends Datasource {
|
|
40
40
|
|
41
41
|
/**
|
42
42
|
* This method is called by the `instanceof` operator.
|
43
|
-
* @
|
43
|
+
* @return {symbol}
|
44
44
|
*/
|
45
45
|
static get [instanceSymbol]() {
|
46
46
|
return Symbol.for("@schukai/monster/data/datasource/storage/dom-storage");
|
@@ -56,7 +56,7 @@ class RestAPI extends Server {
|
|
56
56
|
|
57
57
|
/**
|
58
58
|
* This method is called by the `instanceof` operator.
|
59
|
-
* @
|
59
|
+
* @return {symbol}
|
60
60
|
* @since 2.1.0
|
61
61
|
*/
|
62
62
|
static get [instanceSymbol]() {
|
@@ -189,7 +189,7 @@ class RestAPI extends Server {
|
|
189
189
|
* @param init
|
190
190
|
* @param key
|
191
191
|
* @param callback
|
192
|
-
* @
|
192
|
+
* @return {Promise<string>}
|
193
193
|
*/
|
194
194
|
function fetchData(init, key, callback) {
|
195
195
|
let response;
|
@@ -67,14 +67,14 @@ class WebConnect extends Server {
|
|
67
67
|
|
68
68
|
/**
|
69
69
|
*
|
70
|
-
* @
|
70
|
+
* @return {Promise}
|
71
71
|
*/
|
72
72
|
connect() {
|
73
73
|
return this[webConnectSymbol].connect();
|
74
74
|
}
|
75
75
|
|
76
76
|
/**
|
77
|
-
* @
|
77
|
+
* @return {boolean}
|
78
78
|
*/
|
79
79
|
isConnected() {
|
80
80
|
return this[webConnectSymbol].isConnected();
|
@@ -82,7 +82,7 @@ class WebConnect extends Server {
|
|
82
82
|
|
83
83
|
/**
|
84
84
|
* This method is called by the `instanceof` operator.
|
85
|
-
* @
|
85
|
+
* @return {symbol}
|
86
86
|
*/
|
87
87
|
static get [instanceSymbol]() {
|
88
88
|
return Symbol.for("@schukai/monster/data/datasource/server/webconnect");
|
@@ -142,7 +142,7 @@ class WebConnect extends Server {
|
|
142
142
|
/**
|
143
143
|
* This method closes the connection.
|
144
144
|
*
|
145
|
-
* @
|
145
|
+
* @return {Promise}
|
146
146
|
*/
|
147
147
|
close() {
|
148
148
|
return this[webConnectSymbol].close();
|
@@ -39,7 +39,7 @@ const serverVersionSymbol = Symbol("serverVersion");
|
|
39
39
|
class Server extends Datasource {
|
40
40
|
/**
|
41
41
|
* This method is called by the `instanceof` operator.
|
42
|
-
* @
|
42
|
+
* @return {symbol}
|
43
43
|
*/
|
44
44
|
static get [instanceSymbol]() {
|
45
45
|
return Symbol.for("@schukai/monster/data/datasource/server");
|
@@ -51,7 +51,7 @@ class Server extends Datasource {
|
|
51
51
|
*
|
52
52
|
* @private
|
53
53
|
* @param {Object} payload
|
54
|
-
* @
|
54
|
+
* @return {Object}
|
55
55
|
*/
|
56
56
|
transformServerPayload(payload) {
|
57
57
|
payload = doTransform.call(this, "read", payload);
|
@@ -70,7 +70,7 @@ class Server extends Datasource {
|
|
70
70
|
*
|
71
71
|
* @private
|
72
72
|
* @param {Object} payload
|
73
|
-
* @
|
73
|
+
* @return {Object}
|
74
74
|
*/
|
75
75
|
prepareServerPayload(payload) {
|
76
76
|
payload = doTransform.call(this, "write", payload);
|
@@ -92,7 +92,7 @@ class Server extends Datasource {
|
|
92
92
|
/**
|
93
93
|
*
|
94
94
|
* @param obj
|
95
|
-
* @
|
95
|
+
* @return {*}
|
96
96
|
*/
|
97
97
|
function doDiff(obj) {
|
98
98
|
if (
|
@@ -122,7 +122,7 @@ function doDiff(obj) {
|
|
122
122
|
* @private
|
123
123
|
* @param {string} type
|
124
124
|
* @param {Object} obj
|
125
|
-
* @
|
125
|
+
* @return {Object}
|
126
126
|
*/
|
127
127
|
function doTransform(type, obj) {
|
128
128
|
const transformation = this.getOption(`${type}.mapping.transformer`);
|
@@ -52,7 +52,6 @@ const internalDataSymbol = Symbol.for(
|
|
52
52
|
* @license AGPLv3
|
53
53
|
* @since 1.22.0
|
54
54
|
* @copyright schukai GmbH
|
55
|
-
* @memberOf Monster.Data
|
56
55
|
* @summary The datasource class encapsulates the access to data objects.
|
57
56
|
*/
|
58
57
|
class Datasource extends Base {
|
@@ -74,7 +73,7 @@ class Datasource extends Base {
|
|
74
73
|
* attach a new observer
|
75
74
|
*
|
76
75
|
* @param {Observer} observer
|
77
|
-
* @
|
76
|
+
* @return {Datasource}
|
78
77
|
*/
|
79
78
|
attachObserver(observer) {
|
80
79
|
this[internalDataSymbol].attachObserver(observer);
|
@@ -85,7 +84,7 @@ class Datasource extends Base {
|
|
85
84
|
* detach a observer
|
86
85
|
*
|
87
86
|
* @param {Observer} observer
|
88
|
-
* @
|
87
|
+
* @return {Datasource}
|
89
88
|
*/
|
90
89
|
detachObserver(observer) {
|
91
90
|
this[internalDataSymbol].detachObserver(observer);
|
@@ -94,7 +93,7 @@ class Datasource extends Base {
|
|
94
93
|
|
95
94
|
/**
|
96
95
|
* @param {Observer} observer
|
97
|
-
* @
|
96
|
+
* @return {boolean}
|
98
97
|
*/
|
99
98
|
containsObserver(observer) {
|
100
99
|
return this[internalDataSymbol].containsObserver(observer);
|
@@ -204,7 +203,7 @@ class Datasource extends Base {
|
|
204
203
|
|
205
204
|
/**
|
206
205
|
* This method is called by the `instanceof` operator.
|
207
|
-
* @
|
206
|
+
* @return {symbol}
|
208
207
|
* @since 2.1.0
|
209
208
|
*/
|
210
209
|
static get [instanceSymbol]() {
|
@@ -81,12 +81,13 @@ const WILDCARD = "*";
|
|
81
81
|
* new Pathfinder(obj).setVia('a.b.0.c', true); // ↦ {a:{b:[{c:true}]}}
|
82
82
|
* ```
|
83
83
|
*
|
84
|
-
* @
|
85
|
-
* @
|
84
|
+
* @example /examples/libraries/pathfinder/example-1/ Example 1
|
85
|
+
* @example /examples/libraries/pathfinder/example-2/ Example 2
|
86
|
+
*
|
86
87
|
* @license AGPLv3
|
87
88
|
* @since 1.4.0
|
88
89
|
* @copyright schukai GmbH
|
89
|
-
* @
|
90
|
+
* @summary Pathfinder is a class to find a path to an object.
|
90
91
|
*/
|
91
92
|
class Pathfinder extends Base {
|
92
93
|
/**
|
@@ -124,7 +125,7 @@ class Pathfinder extends Base {
|
|
124
125
|
*
|
125
126
|
* @param {string|array} path
|
126
127
|
* @since 1.4.0
|
127
|
-
* @
|
128
|
+
* @return {*}
|
128
129
|
* @throws {TypeError} unsupported type
|
129
130
|
* @throws {Error} the journey is not at its end
|
130
131
|
* @throws {TypeError} value is not a string
|
@@ -139,7 +140,7 @@ class Pathfinder extends Base {
|
|
139
140
|
*
|
140
141
|
* @param {string|array} path
|
141
142
|
* @param {*} value
|
142
|
-
* @
|
143
|
+
* @return {Pathfinder}
|
143
144
|
* @since 1.4.0
|
144
145
|
* @throws {TypeError} unsupported type
|
145
146
|
* @throws {TypeError} value is not a string
|
@@ -155,7 +156,7 @@ class Pathfinder extends Base {
|
|
155
156
|
* Delete Via Path
|
156
157
|
*
|
157
158
|
* @param {string|array} path
|
158
|
-
* @
|
159
|
+
* @return {Pathfinder}
|
159
160
|
* @since 1.6.0
|
160
161
|
* @throws {TypeError} unsupported type
|
161
162
|
* @throws {TypeError} value is not a string
|
@@ -226,7 +227,7 @@ function iterate(subject, path, check) {
|
|
226
227
|
* @param subject
|
227
228
|
* @param path
|
228
229
|
* @param check
|
229
|
-
* @
|
230
|
+
* @return {V|*|Map}
|
230
231
|
* @throws {TypeError} unsupported type
|
231
232
|
* @throws {Error} the journey is not at its end
|
232
233
|
* @throws {Error} unsupported action for this data type
|
@@ -306,7 +307,7 @@ function getValueViaPath(subject, path, check) {
|
|
306
307
|
* @param {object} subject
|
307
308
|
* @param {string|array} path
|
308
309
|
* @param {*} value
|
309
|
-
* @
|
310
|
+
* @return {void}
|
310
311
|
* @throws {TypeError} unsupported type
|
311
312
|
* @throws {TypeError} unsupported type
|
312
313
|
* @throws {Error} the journey is not at its end
|
@@ -405,7 +406,7 @@ function assignProperty(object, key, value) {
|
|
405
406
|
*
|
406
407
|
* @param {object} subject
|
407
408
|
* @param {string} path
|
408
|
-
* @
|
409
|
+
* @return {void}
|
409
410
|
* @throws {TypeError} unsupported type
|
410
411
|
* @throws {TypeError} unsupported type
|
411
412
|
* @throws {Error} the journey is not at its end
|