@schukai/monster 3.80.1 → 3.80.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +26 -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/style/space.pcss +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 -2
- 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 -26
- package/source/dom/customelement.mjs +36 -75
- 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 -3
- package/source/i18n/locale.mjs +2 -4
- package/source/i18n/provider.mjs +1 -3
- package/source/i18n/providers/embed.mjs +1 -3
- package/source/i18n/translations.mjs +2 -3
- package/source/logging/handler/console.mjs +1 -2
- package/source/logging/handler.mjs +11 -12
- package/source/logging/logentry.mjs +2 -2
- package/source/logging/logger.mjs +13 -22
- package/source/math/random.mjs +2 -2
- package/source/monster.mjs +1 -0
- package/source/net/webconnect/message.mjs +3 -4
- 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 -5
- 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/noderecursiveiterator.mjs +1 -5
- package/source/types/observablequeue.mjs +7 -11
- package/source/types/observer.mjs +6 -9
- package/source/types/observerlist.mjs +0 -2
- package/source/types/proxyobserver.mjs +8 -8
- package/source/types/queue.mjs +3 -4
- 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/callback.mjs +56 -0
- package/source/util/processing.mjs +4 -42
- package/source/util/runtime.mjs +1 -1
|
@@ -25,7 +25,6 @@ const dataSymbol = Symbol("@@data");
|
|
|
25
25
|
* @license AGPLv3
|
|
26
26
|
* @since 3.4.0
|
|
27
27
|
* @copyright schukai GmbH
|
|
28
|
-
* @memberOf Monster.Net.WebSocket
|
|
29
28
|
* @summary The Message class encapsulates a WebSocket message.
|
|
30
29
|
*/
|
|
31
30
|
class Message extends Base {
|
|
@@ -41,14 +40,14 @@ class Message extends Base {
|
|
|
41
40
|
/**
|
|
42
41
|
* Returns the raw message.
|
|
43
42
|
*
|
|
44
|
-
* @
|
|
43
|
+
* @return {object}
|
|
45
44
|
*/
|
|
46
45
|
getData() {
|
|
47
46
|
return this[dataSymbol];
|
|
48
47
|
}
|
|
49
48
|
|
|
50
49
|
/**
|
|
51
|
-
* @
|
|
50
|
+
* @return {*}
|
|
52
51
|
*/
|
|
53
52
|
toJSON() {
|
|
54
53
|
return this[dataSymbol];
|
|
@@ -56,7 +55,7 @@ class Message extends Base {
|
|
|
56
55
|
|
|
57
56
|
/**
|
|
58
57
|
* @param {string} json
|
|
59
|
-
* @
|
|
58
|
+
* @return {Message}
|
|
60
59
|
* @throws {TypeError} value is not a string
|
|
61
60
|
*/
|
|
62
61
|
static fromJSON(json) {
|
|
@@ -209,7 +209,7 @@ class WebConnect extends BaseWithOptions {
|
|
|
209
209
|
|
|
210
210
|
/**
|
|
211
211
|
*
|
|
212
|
-
* @
|
|
212
|
+
* @return {Promise}
|
|
213
213
|
*/
|
|
214
214
|
connect() {
|
|
215
215
|
return new Promise((resolve, reject) => {
|
|
@@ -218,7 +218,7 @@ class WebConnect extends BaseWithOptions {
|
|
|
218
218
|
}
|
|
219
219
|
|
|
220
220
|
/**
|
|
221
|
-
* @
|
|
221
|
+
* @return {boolean}
|
|
222
222
|
*/
|
|
223
223
|
isConnected() {
|
|
224
224
|
return this[connectionSymbol]?.socket?.readyState === 1;
|
|
@@ -226,7 +226,7 @@ class WebConnect extends BaseWithOptions {
|
|
|
226
226
|
|
|
227
227
|
/**
|
|
228
228
|
* This method is called by the `instanceof` operator.
|
|
229
|
-
* @
|
|
229
|
+
* @return {symbol}
|
|
230
230
|
*/
|
|
231
231
|
static get [instanceSymbol]() {
|
|
232
232
|
return Symbol.for("@schukai/monster/net/webconnect");
|
|
@@ -259,7 +259,7 @@ class WebConnect extends BaseWithOptions {
|
|
|
259
259
|
*
|
|
260
260
|
* @param {Number} [code=1000] The close code.
|
|
261
261
|
* @param {String} [reason=""] The close reason.
|
|
262
|
-
* @
|
|
262
|
+
* @return {Promise}
|
|
263
263
|
* @see https://www.rfc-editor.org/rfc/rfc6455.html#section-7.4.1
|
|
264
264
|
*/
|
|
265
265
|
close(statusCode, reason) {
|
|
@@ -286,7 +286,7 @@ class WebConnect extends BaseWithOptions {
|
|
|
286
286
|
/**
|
|
287
287
|
* Polls the receive queue for new messages.
|
|
288
288
|
*
|
|
289
|
-
* @
|
|
289
|
+
* @return {Message}
|
|
290
290
|
*/
|
|
291
291
|
poll() {
|
|
292
292
|
return this[receiveQueueSymbol].poll();
|
|
@@ -295,7 +295,7 @@ class WebConnect extends BaseWithOptions {
|
|
|
295
295
|
/**
|
|
296
296
|
* Are there any messages in the receive queue?
|
|
297
297
|
*
|
|
298
|
-
* @
|
|
298
|
+
* @return {boolean}
|
|
299
299
|
*/
|
|
300
300
|
dataReceived() {
|
|
301
301
|
return !this[receiveQueueSymbol].isEmpty();
|
|
@@ -304,7 +304,7 @@ class WebConnect extends BaseWithOptions {
|
|
|
304
304
|
/**
|
|
305
305
|
* Get Message from the receive queue, but do not remove it.
|
|
306
306
|
*
|
|
307
|
-
* @
|
|
307
|
+
* @return {Object}
|
|
308
308
|
*/
|
|
309
309
|
peek() {
|
|
310
310
|
return this[receiveQueueSymbol].peek();
|
|
@@ -314,7 +314,7 @@ class WebConnect extends BaseWithOptions {
|
|
|
314
314
|
* Attach a new observer
|
|
315
315
|
*
|
|
316
316
|
* @param {Observer} observer
|
|
317
|
-
* @
|
|
317
|
+
* @return {ProxyObserver}
|
|
318
318
|
*/
|
|
319
319
|
attachObserver(observer) {
|
|
320
320
|
this[receiveQueueSymbol].attachObserver(observer);
|
|
@@ -325,7 +325,7 @@ class WebConnect extends BaseWithOptions {
|
|
|
325
325
|
* Detach a observer
|
|
326
326
|
*
|
|
327
327
|
* @param {Observer} observer
|
|
328
|
-
* @
|
|
328
|
+
* @return {ProxyObserver}
|
|
329
329
|
*/
|
|
330
330
|
detachObserver(observer) {
|
|
331
331
|
this[receiveQueueSymbol].detachObserver(observer);
|
|
@@ -334,7 +334,7 @@ class WebConnect extends BaseWithOptions {
|
|
|
334
334
|
|
|
335
335
|
/**
|
|
336
336
|
* @param {Observer} observer
|
|
337
|
-
* @
|
|
337
|
+
* @return {boolean}
|
|
338
338
|
*/
|
|
339
339
|
containsObserver(observer) {
|
|
340
340
|
return this[receiveQueueSymbol].containsObserver(observer);
|
|
@@ -48,7 +48,7 @@ export { parseBracketedKeyValueHash, createBracketedKeyValueHash };
|
|
|
48
48
|
*
|
|
49
49
|
* @since 3.37.0
|
|
50
50
|
* @param {string} hashString - The string to parse, containing bracketed key-value pairs.
|
|
51
|
-
* @
|
|
51
|
+
* @return {Object} - An object representing the parsed result, with keys representing the selectors and values representing the key-value pairs associated with each selector.
|
|
52
52
|
* - Returns an empty object if there was an error during parsing. */
|
|
53
53
|
function parseBracketedKeyValueHash(hashString) {
|
|
54
54
|
const selectors = {};
|
|
@@ -207,7 +207,7 @@ function parseBracketedKeyValueHash(hashString) {
|
|
|
207
207
|
*
|
|
208
208
|
* @param {Object} object - The object containing selectors and key-value pairs.
|
|
209
209
|
* @param {boolean} addHashPrefix - Whether to add the hash prefix # to the beginning of the string.
|
|
210
|
-
* @
|
|
210
|
+
* @return {string} The hash selector string.
|
|
211
211
|
* @since 3.37.0
|
|
212
212
|
*/
|
|
213
213
|
function createBracketedKeyValueHash(object, addHashPrefix = true) {
|
|
@@ -58,7 +58,7 @@ export { generateRangeComparisonExpression };
|
|
|
58
58
|
* @param {string} [options.eqOp='=='] - The comparison operator for equality to use.
|
|
59
59
|
* @param {string} [options.geOp='>='] - The comparison operator for greater than or equal to to use.
|
|
60
60
|
* @param {string} [options.leOp='<='] - The comparison operator for less than or equal to to use.
|
|
61
|
-
* @
|
|
61
|
+
* @return {string} The generated comparison expression.
|
|
62
62
|
* @throws {Error} If the input is invalid.
|
|
63
63
|
* @memberOf Monster.Text
|
|
64
64
|
* @summary Generates a comparison expression based on a range of values.
|
package/source/types/base.mjs
CHANGED
|
@@ -43,7 +43,7 @@ export { Base };
|
|
|
43
43
|
*/
|
|
44
44
|
class Base extends Object {
|
|
45
45
|
/**
|
|
46
|
-
* @
|
|
46
|
+
* @return {string}
|
|
47
47
|
*/
|
|
48
48
|
toString() {
|
|
49
49
|
return JSON.stringify(this);
|
|
@@ -51,7 +51,7 @@ class Base extends Object {
|
|
|
51
51
|
|
|
52
52
|
/**
|
|
53
53
|
* This method is called by the `instanceof` operator.
|
|
54
|
-
* @
|
|
54
|
+
* @return {symbol}
|
|
55
55
|
* @since 2.1.0
|
|
56
56
|
*/
|
|
57
57
|
static get [instanceSymbol]() {
|
|
@@ -61,7 +61,7 @@ class Base extends Object {
|
|
|
61
61
|
/**
|
|
62
62
|
* This method is called by the `instanceof` operator.
|
|
63
63
|
* @param that
|
|
64
|
-
* @
|
|
64
|
+
* @return {boolean}
|
|
65
65
|
* @since 2.1.0
|
|
66
66
|
*/
|
|
67
67
|
static [Symbol.hasInstance](that) {
|
|
@@ -96,7 +96,7 @@ class Base extends Object {
|
|
|
96
96
|
*
|
|
97
97
|
* @private
|
|
98
98
|
* @param obj
|
|
99
|
-
* @
|
|
99
|
+
* @return {boolean|any|boolean}
|
|
100
100
|
* @since 2.1.0
|
|
101
101
|
*/
|
|
102
102
|
function checkInstanceSymbol(obj) {
|
|
@@ -26,14 +26,12 @@ export { BaseWithOptions };
|
|
|
26
26
|
* This class is actually only used as a base class.
|
|
27
27
|
*
|
|
28
28
|
* Classes that require the possibility of options can be derived directly from this class.
|
|
29
|
-
* Derived classes almost always override the `
|
|
29
|
+
* Derived classes almost always override the `default` getter with their own values.
|
|
30
30
|
*
|
|
31
|
-
* @externalExample ../../example/types/basewithoptions.mjs
|
|
32
31
|
* @license AGPLv3
|
|
33
32
|
* @since 1.13.0
|
|
34
33
|
* @copyright schukai GmbH
|
|
35
|
-
* @
|
|
36
|
-
* @deprecated since 3.15.0 use {@link Monster.Types.Base} with {@link Monster.Types.equipWithInternal} instead.
|
|
34
|
+
* @deprecated since 3.15.0
|
|
37
35
|
*/
|
|
38
36
|
class BaseWithOptions extends Base {
|
|
39
37
|
/**
|
|
@@ -52,7 +50,7 @@ class BaseWithOptions extends Base {
|
|
|
52
50
|
|
|
53
51
|
/**
|
|
54
52
|
* This getter provides the options. Derived classes overwrite
|
|
55
|
-
* this getter with their own values. It is good karma to always include
|
|
53
|
+
* this getter with their own values. It is a good karma to always include
|
|
56
54
|
* the values from the parent class.
|
|
57
55
|
*
|
|
58
56
|
* ```javascript
|
package/source/types/dataurl.mjs
CHANGED
|
@@ -30,12 +30,11 @@ export { DataUrl, parseDataURL };
|
|
|
30
30
|
const internal = Symbol("internal");
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
|
-
* You can create an object via the monster namespace `new
|
|
33
|
+
* You can create an object via the monster namespace `new DataUrl()`.
|
|
34
34
|
*
|
|
35
35
|
* @license AGPLv3
|
|
36
36
|
* @since 1.8.0
|
|
37
37
|
* @copyright schukai GmbH
|
|
38
|
-
* @memberOf Monster.Types
|
|
39
38
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs
|
|
40
39
|
* @see https://datatracker.ietf.org/doc/html/rfc2397
|
|
41
40
|
*/
|
|
@@ -43,7 +42,7 @@ class DataUrl extends Base {
|
|
|
43
42
|
/**
|
|
44
43
|
*
|
|
45
44
|
* @param {String} content
|
|
46
|
-
* @param {String|
|
|
45
|
+
* @param {String|MediaType} mediatype
|
|
47
46
|
* @param {boolean} base64=true
|
|
48
47
|
*/
|
|
49
48
|
constructor(content, mediatype, base64) {
|
|
@@ -62,7 +61,7 @@ class DataUrl extends Base {
|
|
|
62
61
|
|
|
63
62
|
/**
|
|
64
63
|
* This method is called by the `instanceof` operator.
|
|
65
|
-
* @
|
|
64
|
+
* @return {symbol}
|
|
66
65
|
* @since 2.1.0
|
|
67
66
|
*/
|
|
68
67
|
static get [instanceSymbol]() {
|
|
@@ -98,7 +97,7 @@ class DataUrl extends Base {
|
|
|
98
97
|
}
|
|
99
98
|
|
|
100
99
|
/**
|
|
101
|
-
* You can call the function via the monster namespace `
|
|
100
|
+
* You can call the function via the monster namespace `parseDataURL()`.
|
|
102
101
|
*
|
|
103
102
|
* Specification:
|
|
104
103
|
*
|
|
@@ -109,13 +108,12 @@ class DataUrl extends Base {
|
|
|
109
108
|
* parameter := attribute "=" value
|
|
110
109
|
* ```
|
|
111
110
|
*
|
|
112
|
-
* @param {String} dataurl
|
|
113
|
-
* @return {Monster.Types.DataUrl}
|
|
114
111
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs
|
|
115
112
|
* @see https://datatracker.ietf.org/doc/html/rfc2397
|
|
116
113
|
* @throws {TypeError} incorrect or missing data protocol
|
|
117
114
|
* @throws {TypeError} malformed data url
|
|
118
|
-
* @
|
|
115
|
+
* @param {string} dataurl
|
|
116
|
+
* @return {DataUrl}
|
|
119
117
|
*/
|
|
120
118
|
function parseDataURL(dataurl) {
|
|
121
119
|
validateString(dataurl);
|
package/source/types/global.mjs
CHANGED
|
@@ -74,7 +74,7 @@ let globalReference;
|
|
|
74
74
|
* @license AGPLv3
|
|
75
75
|
* @since 1.6.0
|
|
76
76
|
* @memberOf Monster.Types
|
|
77
|
-
* @
|
|
77
|
+
* @return {object} globalThis
|
|
78
78
|
*/
|
|
79
79
|
function getGlobal() {
|
|
80
80
|
return globalReference;
|
|
@@ -107,7 +107,7 @@ function getGlobal() {
|
|
|
107
107
|
* @since 1.6.0
|
|
108
108
|
* @memberOf Monster.Types
|
|
109
109
|
* @param {string} name
|
|
110
|
-
* @
|
|
110
|
+
* @return {object}
|
|
111
111
|
* @throws {Error} the object is not defined
|
|
112
112
|
* @throws {TypeError} value is not a object
|
|
113
113
|
* @throws {TypeError} value is not a string
|
|
@@ -63,7 +63,7 @@ function equipWithInternal() {
|
|
|
63
63
|
* Attach a new observer
|
|
64
64
|
*
|
|
65
65
|
* @param {Observer} observer
|
|
66
|
-
* @
|
|
66
|
+
* @return {ProxyObserver}
|
|
67
67
|
*/
|
|
68
68
|
this["attachInternalObserver"] = (observer) => {
|
|
69
69
|
this[internalSymbol].attachObserver(observer);
|
|
@@ -74,7 +74,7 @@ function equipWithInternal() {
|
|
|
74
74
|
* Detach a observer
|
|
75
75
|
*
|
|
76
76
|
* @param {Observer} observer
|
|
77
|
-
* @
|
|
77
|
+
* @return {ProxyObserver}
|
|
78
78
|
*/
|
|
79
79
|
this["detachInternalObserver"] = (observer) => {
|
|
80
80
|
this[internalSymbol].detachObserver(observer);
|
|
@@ -85,7 +85,7 @@ function equipWithInternal() {
|
|
|
85
85
|
* Check if a observer is attached
|
|
86
86
|
*
|
|
87
87
|
* @param {Observer} observer
|
|
88
|
-
* @
|
|
88
|
+
* @return {boolean}
|
|
89
89
|
*/
|
|
90
90
|
this["containsInternalObserver"] = (observer) => {
|
|
91
91
|
return this[internalSymbol].containsObserver(observer);
|
package/source/types/is.mjs
CHANGED
|
@@ -34,11 +34,10 @@ export {
|
|
|
34
34
|
*
|
|
35
35
|
* @externalExample ../../example/types/is-1.mjs
|
|
36
36
|
* @param {*} value
|
|
37
|
-
* @
|
|
37
|
+
* @return {boolean}
|
|
38
38
|
* @license AGPLv3
|
|
39
39
|
* @since 1.2.0
|
|
40
40
|
* @copyright schukai GmbH
|
|
41
|
-
* @memberOf Monster.Types
|
|
42
41
|
*/
|
|
43
42
|
function isIterable(value) {
|
|
44
43
|
if (value === undefined) return false;
|
|
@@ -53,11 +52,10 @@ function isIterable(value) {
|
|
|
53
52
|
*
|
|
54
53
|
* @externalExample ../../example/types/is-2.mjs
|
|
55
54
|
* @param {*} value
|
|
56
|
-
* @
|
|
55
|
+
* @return {boolean}
|
|
57
56
|
* @license AGPLv3
|
|
58
57
|
* @since 1.0.0
|
|
59
58
|
* @copyright schukai GmbH
|
|
60
|
-
* @memberOf Monster.Types
|
|
61
59
|
*/
|
|
62
60
|
function isPrimitive(value) {
|
|
63
61
|
var type;
|
|
@@ -87,11 +85,10 @@ function isPrimitive(value) {
|
|
|
87
85
|
*
|
|
88
86
|
* @externalExample ../../example/types/is-3.mjs
|
|
89
87
|
* @param {*} value
|
|
90
|
-
* @
|
|
88
|
+
* @return {boolean}
|
|
91
89
|
* @license AGPLv3
|
|
92
90
|
* @since 1.9.0
|
|
93
91
|
* @copyright schukai GmbH
|
|
94
|
-
* @memberOf Monster.Types
|
|
95
92
|
*/
|
|
96
93
|
function isSymbol(value) {
|
|
97
94
|
return "symbol" === typeof value ? true : false;
|
|
@@ -104,11 +101,10 @@ function isSymbol(value) {
|
|
|
104
101
|
*
|
|
105
102
|
* @externalExample ../../example/types/is-4.mjs
|
|
106
103
|
* @param {*} value
|
|
107
|
-
* @
|
|
104
|
+
* @return {boolean}
|
|
108
105
|
* @license AGPLv3
|
|
109
106
|
* @since 1.0.0
|
|
110
107
|
* @copyright schukai GmbH
|
|
111
|
-
* @memberOf Monster.Types
|
|
112
108
|
*/
|
|
113
109
|
function isBoolean(value) {
|
|
114
110
|
if (value === true || value === false) {
|
|
@@ -125,11 +121,10 @@ function isBoolean(value) {
|
|
|
125
121
|
*
|
|
126
122
|
* @externalExample ../../example/types/is-5.mjs
|
|
127
123
|
* @param {*} value
|
|
128
|
-
* @
|
|
124
|
+
* @return {boolean}
|
|
129
125
|
* @license AGPLv3
|
|
130
126
|
* @since 1.0.0
|
|
131
127
|
* @copyright schukai GmbH
|
|
132
|
-
* @memberOf Monster.Types
|
|
133
128
|
*/
|
|
134
129
|
function isString(value) {
|
|
135
130
|
if (value === undefined || typeof value !== "string") {
|
|
@@ -145,11 +140,10 @@ function isString(value) {
|
|
|
145
140
|
*
|
|
146
141
|
* @externalExample ../../example/types/is-6.mjs
|
|
147
142
|
* @param {*} value
|
|
148
|
-
* @
|
|
143
|
+
* @return {boolean}
|
|
149
144
|
* @license AGPLv3
|
|
150
145
|
* @since 1.0.0
|
|
151
146
|
* @copyright schukai GmbH
|
|
152
|
-
* @memberOf Monster.Types
|
|
153
147
|
*/
|
|
154
148
|
function isObject(value) {
|
|
155
149
|
if (isArray(value)) return false;
|
|
@@ -170,11 +164,10 @@ function isObject(value) {
|
|
|
170
164
|
* @externalExample ../../example/types/is-7.mjs
|
|
171
165
|
* @param {*} value
|
|
172
166
|
* @param {*} instance
|
|
173
|
-
* @
|
|
167
|
+
* @return {boolean}
|
|
174
168
|
* @license AGPLv3
|
|
175
169
|
* @since 1.5.0
|
|
176
170
|
* @copyright schukai GmbH
|
|
177
|
-
* @memberOf Monster.Types
|
|
178
171
|
*/
|
|
179
172
|
function isInstance(value, instance) {
|
|
180
173
|
if (!isObject(value)) return false;
|
|
@@ -190,11 +183,10 @@ function isInstance(value, instance) {
|
|
|
190
183
|
*
|
|
191
184
|
* @externalExample ../../example/types/is-8.mjs
|
|
192
185
|
* @param {*} value
|
|
193
|
-
* @
|
|
186
|
+
* @return {boolean}
|
|
194
187
|
* @license AGPLv3
|
|
195
188
|
* @since 1.0.0
|
|
196
189
|
* @copyright schukai GmbH
|
|
197
|
-
* @memberOf Monster.Types
|
|
198
190
|
* @see https://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray
|
|
199
191
|
*/
|
|
200
192
|
function isArray(value) {
|
|
@@ -208,11 +200,10 @@ function isArray(value) {
|
|
|
208
200
|
*
|
|
209
201
|
* @externalExample ../../example/types/is-9.mjs
|
|
210
202
|
* @param {*} value
|
|
211
|
-
* @
|
|
203
|
+
* @return {boolean}
|
|
212
204
|
* @license AGPLv3
|
|
213
205
|
* @since 1.0.0
|
|
214
206
|
* @copyright schukai GmbH
|
|
215
|
-
* @memberOf Monster.Types
|
|
216
207
|
*/
|
|
217
208
|
function isFunction(value) {
|
|
218
209
|
if (isArray(value)) return false;
|
|
@@ -232,11 +223,10 @@ function isFunction(value) {
|
|
|
232
223
|
*
|
|
233
224
|
* @externalExample ../../example/types/is-10.mjs
|
|
234
225
|
* @param {*} value
|
|
235
|
-
* @
|
|
226
|
+
* @return {boolean}
|
|
236
227
|
* @license AGPLv3
|
|
237
228
|
* @since 1.4.0
|
|
238
229
|
* @copyright schukai GmbH
|
|
239
|
-
* @memberOf Monster.Types
|
|
240
230
|
*/
|
|
241
231
|
function isInteger(value) {
|
|
242
232
|
return Number.isInteger(value);
|
package/source/types/node.mjs
CHANGED
|
@@ -49,7 +49,7 @@ class NodeList extends Set {
|
|
|
49
49
|
|
|
50
50
|
/**
|
|
51
51
|
* This method is called by the `instanceof` operator.
|
|
52
|
-
* @
|
|
52
|
+
* @return {symbol}
|
|
53
53
|
* @since 2.1.0
|
|
54
54
|
*/
|
|
55
55
|
static get [instanceSymbol]() {
|
|
@@ -68,7 +68,7 @@ class NodeList extends Set {
|
|
|
68
68
|
|
|
69
69
|
/**
|
|
70
70
|
* @param {Node} node
|
|
71
|
-
* @
|
|
71
|
+
* @return {NodeList}
|
|
72
72
|
*/
|
|
73
73
|
remove(node) {
|
|
74
74
|
super.delete(validateInstance(node, Node));
|
|
@@ -77,14 +77,14 @@ class NodeList extends Set {
|
|
|
77
77
|
|
|
78
78
|
/**
|
|
79
79
|
* @param {Node} node
|
|
80
|
-
* @
|
|
80
|
+
* @return {boolean}
|
|
81
81
|
*/
|
|
82
82
|
has(node) {
|
|
83
83
|
return super.has(validateInstance(node, Node));
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
/**
|
|
87
|
-
* @
|
|
87
|
+
* @return {NodeList}
|
|
88
88
|
*/
|
|
89
89
|
clear() {
|
|
90
90
|
super.clear();
|
|
@@ -92,21 +92,21 @@ class NodeList extends Set {
|
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
/**
|
|
95
|
-
* @
|
|
95
|
+
* @return {NodeList}
|
|
96
96
|
*/
|
|
97
97
|
toArray() {
|
|
98
98
|
return Array.from(this);
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
/**
|
|
102
|
-
* @
|
|
102
|
+
* @return {NodeList}
|
|
103
103
|
*/
|
|
104
104
|
toJSON() {
|
|
105
105
|
return this.toArray();
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
/**
|
|
109
|
-
* @
|
|
109
|
+
* @return {NodeList}
|
|
110
110
|
*/
|
|
111
111
|
toString() {
|
|
112
112
|
const parts = [];
|
|
@@ -31,11 +31,7 @@ const isNodeListSymbol = Symbol("isNodeList");
|
|
|
31
31
|
/**
|
|
32
32
|
* Represents a recursive iterator for traversing nodes in a DOM tree.
|
|
33
33
|
*
|
|
34
|
-
* @externalExample ../../example/types/noderecursiveiterator.mjs
|
|
35
|
-
* @license AGPLv3
|
|
36
34
|
* @since 1.26.0
|
|
37
|
-
* @copyright schukai GmbH
|
|
38
|
-
* @memberOf Monster.Types
|
|
39
35
|
* @summary An iterator to run recursively through a tree of nodes
|
|
40
36
|
* @extends Base
|
|
41
37
|
*/
|
|
@@ -91,7 +87,7 @@ class NodeRecursiveIterator extends Base {
|
|
|
91
87
|
|
|
92
88
|
/**
|
|
93
89
|
* @param {function} callback
|
|
94
|
-
* @return {
|
|
90
|
+
* @return {NodeRecursiveIterator}
|
|
95
91
|
*/
|
|
96
92
|
forEach(callback) {
|
|
97
93
|
for (const node of this) {
|
|
@@ -23,11 +23,8 @@ export { ObservableQueue };
|
|
|
23
23
|
*
|
|
24
24
|
* `Queue.add()` and `Queue.clear()` notify all observers.
|
|
25
25
|
*
|
|
26
|
-
* @externalExample ../../example/types/queue.mjs
|
|
27
|
-
* @license AGPLv3
|
|
28
26
|
* @since 3.3.0
|
|
29
27
|
* @copyright schukai GmbH
|
|
30
|
-
* @memberOf Monster.Types
|
|
31
28
|
* @summary An observable Queue (Fifo)
|
|
32
29
|
*/
|
|
33
30
|
class ObservableQueue extends Queue {
|
|
@@ -43,8 +40,7 @@ class ObservableQueue extends Queue {
|
|
|
43
40
|
|
|
44
41
|
/**
|
|
45
42
|
* This method is called by the `instanceof` operator.
|
|
46
|
-
* @
|
|
47
|
-
* @since 2.1.0
|
|
43
|
+
* @return {symbol}
|
|
48
44
|
*/
|
|
49
45
|
static get [instanceSymbol]() {
|
|
50
46
|
return Symbol.for("@schukai/monster/types/observablequeue");
|
|
@@ -54,7 +50,7 @@ class ObservableQueue extends Queue {
|
|
|
54
50
|
* Add a new element to the end of the queue.
|
|
55
51
|
*
|
|
56
52
|
* @param {*} value
|
|
57
|
-
* @
|
|
53
|
+
* @return {Queue}
|
|
58
54
|
*/
|
|
59
55
|
add(value) {
|
|
60
56
|
super.add(value);
|
|
@@ -65,7 +61,7 @@ class ObservableQueue extends Queue {
|
|
|
65
61
|
/**
|
|
66
62
|
* remove all entries
|
|
67
63
|
*
|
|
68
|
-
* @
|
|
64
|
+
* @return {Queue}
|
|
69
65
|
*/
|
|
70
66
|
clear() {
|
|
71
67
|
super.clear();
|
|
@@ -77,7 +73,7 @@ class ObservableQueue extends Queue {
|
|
|
77
73
|
* Attach a new observer
|
|
78
74
|
*
|
|
79
75
|
* @param {Observer} observer
|
|
80
|
-
* @
|
|
76
|
+
* @return {ProxyObserver}
|
|
81
77
|
*/
|
|
82
78
|
attachObserver(observer) {
|
|
83
79
|
this[internalSymbol].observers.attach(observer);
|
|
@@ -88,7 +84,7 @@ class ObservableQueue extends Queue {
|
|
|
88
84
|
* Detach a observer
|
|
89
85
|
*
|
|
90
86
|
* @param {Observer} observer
|
|
91
|
-
* @
|
|
87
|
+
* @return {ProxyObserver}
|
|
92
88
|
*/
|
|
93
89
|
detachObserver(observer) {
|
|
94
90
|
this[internalSymbol].observers.detach(observer);
|
|
@@ -98,7 +94,7 @@ class ObservableQueue extends Queue {
|
|
|
98
94
|
/**
|
|
99
95
|
* Notify all observer
|
|
100
96
|
*
|
|
101
|
-
* @
|
|
97
|
+
* @return {Promise}
|
|
102
98
|
*/
|
|
103
99
|
notifyObservers() {
|
|
104
100
|
return this[internalSymbol].observers.notify(this);
|
|
@@ -106,7 +102,7 @@ class ObservableQueue extends Queue {
|
|
|
106
102
|
|
|
107
103
|
/**
|
|
108
104
|
* @param {Observer} observer
|
|
109
|
-
* @
|
|
105
|
+
* @return {boolean}
|
|
110
106
|
*/
|
|
111
107
|
containsObserver(observer) {
|
|
112
108
|
return this[internalSymbol].observers.contains(observer);
|
|
@@ -53,11 +53,8 @@ export { Observer };
|
|
|
53
53
|
*
|
|
54
54
|
* The callback function must have as many parameters as arguments are given.
|
|
55
55
|
*
|
|
56
|
-
* @externalExample ../../example/types/observer.mjs
|
|
57
56
|
* @license AGPLv3
|
|
58
57
|
* @since 1.0.0
|
|
59
|
-
* @copyright schukai GmbH
|
|
60
|
-
* @memberOf Monster.Types
|
|
61
58
|
*/
|
|
62
59
|
class Observer extends Base {
|
|
63
60
|
/**
|
|
@@ -80,7 +77,7 @@ class Observer extends Base {
|
|
|
80
77
|
|
|
81
78
|
/**
|
|
82
79
|
* This method is called by the `instanceof` operator.
|
|
83
|
-
* @
|
|
80
|
+
* @return {symbol}
|
|
84
81
|
* @since 2.1.0
|
|
85
82
|
*/
|
|
86
83
|
static get [instanceSymbol]() {
|
|
@@ -90,7 +87,7 @@ class Observer extends Base {
|
|
|
90
87
|
/**
|
|
91
88
|
*
|
|
92
89
|
* @param {string} tag
|
|
93
|
-
* @
|
|
90
|
+
* @return {Observer}
|
|
94
91
|
*/
|
|
95
92
|
addTag(tag) {
|
|
96
93
|
this.tags.add(tag);
|
|
@@ -100,7 +97,7 @@ class Observer extends Base {
|
|
|
100
97
|
/**
|
|
101
98
|
*
|
|
102
99
|
* @param {string} tag
|
|
103
|
-
* @
|
|
100
|
+
* @return {Observer}
|
|
104
101
|
*/
|
|
105
102
|
removeTag(tag) {
|
|
106
103
|
this.tags.remove(tag);
|
|
@@ -109,7 +106,7 @@ class Observer extends Base {
|
|
|
109
106
|
|
|
110
107
|
/**
|
|
111
108
|
*
|
|
112
|
-
* @
|
|
109
|
+
* @return {Array}
|
|
113
110
|
*/
|
|
114
111
|
getTags() {
|
|
115
112
|
return this.tags.entries();
|
|
@@ -118,7 +115,7 @@ class Observer extends Base {
|
|
|
118
115
|
/**
|
|
119
116
|
*
|
|
120
117
|
* @param {string} tag
|
|
121
|
-
* @
|
|
118
|
+
* @return {boolean}
|
|
122
119
|
*/
|
|
123
120
|
hasTag(tag) {
|
|
124
121
|
return this.tags.contains(tag);
|
|
@@ -127,7 +124,7 @@ class Observer extends Base {
|
|
|
127
124
|
/**
|
|
128
125
|
*
|
|
129
126
|
* @param {object} subject
|
|
130
|
-
* @
|
|
127
|
+
* @return {Promise}
|
|
131
128
|
*/
|
|
132
129
|
update(subject) {
|
|
133
130
|
const self = this;
|