@schukai/monster 3.80.1 → 3.80.3
Sign up to get free protection for your applications and to get access to all the features.
- 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
package/source/dom/template.mjs
CHANGED
@@ -48,7 +48,7 @@ class Template extends Base {
|
|
48
48
|
|
49
49
|
/**
|
50
50
|
* This method is called by the `instanceof` operator.
|
51
|
-
* @
|
51
|
+
* @return {symbol}
|
52
52
|
* @since 2.1.0
|
53
53
|
*/
|
54
54
|
static get [instanceSymbol]() {
|
@@ -57,7 +57,7 @@ class Template extends Base {
|
|
57
57
|
|
58
58
|
/**
|
59
59
|
*
|
60
|
-
* @
|
60
|
+
* @return {HTMLTemplateElement}
|
61
61
|
*/
|
62
62
|
getTemplateElement() {
|
63
63
|
return this.template;
|
package/source/dom/theme.mjs
CHANGED
@@ -43,7 +43,7 @@ class Theme extends Base {
|
|
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]() {
|
@@ -52,7 +52,7 @@ class Theme extends Base {
|
|
52
52
|
|
53
53
|
/**
|
54
54
|
*
|
55
|
-
* @
|
55
|
+
* @return {string}
|
56
56
|
*/
|
57
57
|
getName() {
|
58
58
|
return this.name;
|
package/source/dom/updater.mjs
CHANGED
@@ -54,11 +54,11 @@ export { Updater, addObjectWithUpdaterToElement };
|
|
54
54
|
* to other values as well, you have to insert the attribute `data-monster-select-this`. This should be
|
55
55
|
* done with care, as it can reduce performance.
|
56
56
|
*
|
57
|
-
* @
|
57
|
+
* @example /examples/libraries/dom/updater/simple/ Simple example
|
58
|
+
*
|
58
59
|
* @license AGPLv3
|
59
60
|
* @since 1.8.0
|
60
61
|
* @copyright schukai GmbH
|
61
|
-
* @memberOf Monster.DOM
|
62
62
|
* @throws {Error} the value is not iterable
|
63
63
|
* @throws {Error} pipes are not allowed when cloning a node.
|
64
64
|
* @throws {Error} no template was found with the specified key.
|
@@ -149,7 +149,7 @@ class Updater extends Base {
|
|
149
149
|
/**
|
150
150
|
* With this method, the eventlisteners are hooked in and the magic begins.
|
151
151
|
*
|
152
|
-
* ```
|
152
|
+
* ```js
|
153
153
|
* updater.run().then(() => {
|
154
154
|
* updater.enableEventProcessing();
|
155
155
|
* });
|
@@ -198,7 +198,7 @@ class Updater extends Base {
|
|
198
198
|
* The run method must be called for the update to start working.
|
199
199
|
* The method ensures that changes are detected.
|
200
200
|
*
|
201
|
-
* ```
|
201
|
+
* ```js
|
202
202
|
* updater.run().then(() => {
|
203
203
|
* updater.enableEventProcessing();
|
204
204
|
* });
|
@@ -244,7 +244,7 @@ class Updater extends Base {
|
|
244
244
|
*
|
245
245
|
* @param {string} name
|
246
246
|
* @param {function} callback
|
247
|
-
* @
|
247
|
+
* @return {Transformer}
|
248
248
|
* @throws {TypeError} value is not a string
|
249
249
|
* @throws {TypeError} value is not a function
|
250
250
|
*/
|
@@ -317,7 +317,6 @@ function getControlEventHandler() {
|
|
317
317
|
* @throws {Error} the bind argument must start as a value with a path
|
318
318
|
* @param {HTMLElement} element
|
319
319
|
* @return void
|
320
|
-
* @memberOf Monster.DOM
|
321
320
|
* @private
|
322
321
|
*/
|
323
322
|
function retrieveAndSetValue(element) {
|
@@ -54,7 +54,7 @@ export { initOptionsFromAttributes };
|
|
54
54
|
* @param {Object} options - The options object to be initialized.
|
55
55
|
* @param {Object} mapping - A mapping between the attribute value and the property value.
|
56
56
|
* @param {string} prefix - The prefix of the attributes to be considered.
|
57
|
-
* @
|
57
|
+
* @return {Object} - The initialized options object.
|
58
58
|
* @this HTMLElement - The context of the DOM element.
|
59
59
|
*/
|
60
60
|
function initOptionsFromAttributes(
|
@@ -46,7 +46,7 @@ export { setOptionFromAttribute };
|
|
46
46
|
* @param {Object} options - The options object to be initialized.
|
47
47
|
* @param {Object} mapping - A mapping between the attribute value and the property value.
|
48
48
|
* @param {string} prefix - The prefix of the attributes to be considered.
|
49
|
-
* @
|
49
|
+
* @return {Object} - The initialized options object.
|
50
50
|
* @this HTMLElement - The context of the DOM element.
|
51
51
|
*/
|
52
52
|
function setOptionFromAttribute(
|
package/source/dom/util.mjs
CHANGED
@@ -55,7 +55,7 @@ export {
|
|
55
55
|
* }
|
56
56
|
* ```
|
57
57
|
*
|
58
|
-
* @
|
58
|
+
* @return {object}
|
59
59
|
* @license AGPLv3
|
60
60
|
* @since 1.6.0
|
61
61
|
* @copyright schukai GmbH
|
@@ -103,7 +103,7 @@ function getDocument() {
|
|
103
103
|
* }
|
104
104
|
* ```
|
105
105
|
*
|
106
|
-
* @
|
106
|
+
* @return {object}
|
107
107
|
* @license AGPLv3
|
108
108
|
* @since 1.6.0
|
109
109
|
* @copyright schukai GmbH
|
@@ -149,7 +149,7 @@ function getWindow() {
|
|
149
149
|
* }
|
150
150
|
* ```
|
151
151
|
*
|
152
|
-
* @
|
152
|
+
* @return {DocumentFragment}
|
153
153
|
* @license AGPLv3
|
154
154
|
* @since 1.6.0
|
155
155
|
* @copyright schukai GmbH
|
@@ -173,7 +173,7 @@ function getDocumentFragmentFromString(html) {
|
|
173
173
|
*
|
174
174
|
* @param {HTMLElement|ShadowRoot} element - The starting element or shadow root to search from.
|
175
175
|
* @param {string} targetId - The ID of the target element to find.
|
176
|
-
* @
|
176
|
+
* @return {HTMLElement|null} - The ancestor element with the specified ID, or null if not found.
|
177
177
|
* @memberOf Monster.DOM
|
178
178
|
* @since 3.29.0
|
179
179
|
* @license AGPLv3
|
@@ -222,7 +222,7 @@ function findElementWithIdUpwards(element, targetId) {
|
|
222
222
|
*
|
223
223
|
* @param {HTMLElement|ShadowRoot} element - The starting element or shadow root to search from.
|
224
224
|
* @param {string} selector - The selector of the target element to find.
|
225
|
-
* @
|
225
|
+
* @return {HTMLElement|null} - The ancestor element with the specified selector, or null if not found.
|
226
226
|
* @memberOf Monster.DOM
|
227
227
|
* @since 3.55.0
|
228
228
|
*/
|
@@ -259,7 +259,7 @@ function findElementWithSelectorUpwards(element, selector) {
|
|
259
259
|
/**
|
260
260
|
* @private
|
261
261
|
* @param {HTMLElement} element
|
262
|
-
* @
|
262
|
+
* @return {HTMLElement|null}
|
263
263
|
*/
|
264
264
|
function traverseShadowRoots(element) {
|
265
265
|
let currentRoot = element.shadowRoot;
|
@@ -296,7 +296,7 @@ function traverseShadowRoots(element) {
|
|
296
296
|
* Recursively searches upwards from a given element to find an ancestor element
|
297
297
|
*
|
298
298
|
* @param {HTMLElement} element
|
299
|
-
* @
|
299
|
+
* @return {*}
|
300
300
|
* @throws {Error} Invalid argument. Expected an HTMLElement.
|
301
301
|
* @memberOf Monster.DOM
|
302
302
|
* @since 3.36.0
|
@@ -318,10 +318,10 @@ function getContainingDocument(element) {
|
|
318
318
|
/**
|
319
319
|
* Returns a list of all registered custom elements in the current document.
|
320
320
|
*
|
321
|
-
* @
|
321
|
+
* @return {string[]}
|
322
322
|
* @since 4.0.0
|
323
323
|
* @memberOf Monster.DOM
|
324
|
-
* @
|
324
|
+
* @return {string[]}
|
325
325
|
*/
|
326
326
|
function getRegisteredCustomElements() {
|
327
327
|
const customElementTags = Array.from(document.querySelectorAll("*"))
|
@@ -30,11 +30,9 @@ const internalTranslationSymbol = Symbol("internalTranslation");
|
|
30
30
|
/**
|
31
31
|
* The Formatter extends the Text.Formatter with the possibility to replace the key by a translation.
|
32
32
|
*
|
33
|
-
* @externalExample ../../example/i18n/formatter.mjs
|
34
33
|
* @license AGPLv3
|
35
34
|
* @since 1.26.0
|
36
35
|
* @copyright schukai GmbH
|
37
|
-
* @memberOf Monster.I18n
|
38
36
|
*/
|
39
37
|
class Formatter extends TextFormatter {
|
40
38
|
/**
|
@@ -53,7 +51,7 @@ class Formatter extends TextFormatter {
|
|
53
51
|
|
54
52
|
/**
|
55
53
|
* This method is called by the `instanceof` operator.
|
56
|
-
* @
|
54
|
+
* @return {symbol}
|
57
55
|
* @since 3.27.0
|
58
56
|
*/
|
59
57
|
static get [instanceSymbol]() {
|
package/source/i18n/locale.mjs
CHANGED
@@ -20,14 +20,12 @@ import { clone } from "../util/clone.mjs";
|
|
20
20
|
export { Locale, parseLocale };
|
21
21
|
|
22
22
|
/**
|
23
|
-
* @memberOf Monster.I18n
|
24
23
|
* @type {symbol}
|
25
24
|
*/
|
26
25
|
const propertiesSymbol = Symbol("properties");
|
27
26
|
|
28
27
|
/**
|
29
28
|
* @type {symbol}
|
30
|
-
* @memberOf Monster.I18n
|
31
29
|
*/
|
32
30
|
const localeStringSymbol = Symbol("localeString");
|
33
31
|
|
@@ -111,7 +109,7 @@ class Locale extends Base {
|
|
111
109
|
|
112
110
|
/**
|
113
111
|
* This method is called by the `instanceof` operator.
|
114
|
-
* @
|
112
|
+
* @return {symbol}
|
115
113
|
* @since 3.27.0
|
116
114
|
*/
|
117
115
|
static get [instanceSymbol]() {
|
@@ -256,7 +254,7 @@ class Locale extends Base {
|
|
256
254
|
* ```
|
257
255
|
*
|
258
256
|
* @param {string} locale
|
259
|
-
* @
|
257
|
+
* @return {Locale}
|
260
258
|
* @license AGPLv3
|
261
259
|
* @since 1.14.0
|
262
260
|
* @copyright schukai GmbH
|
package/source/i18n/provider.mjs
CHANGED
@@ -26,7 +26,6 @@ import { Translations } from "./translations.mjs";
|
|
26
26
|
export { Provider, translationsLinkSymbol };
|
27
27
|
|
28
28
|
/**
|
29
|
-
* @memberOf Monster.I18n
|
30
29
|
* @type {symbol}
|
31
30
|
* @license AGPLv3
|
32
31
|
* @since 3.9.0
|
@@ -42,13 +41,12 @@ const translationsLinkSymbol = Symbol.for(
|
|
42
41
|
* @license AGPLv3
|
43
42
|
* @since 1.13.0
|
44
43
|
* @copyright schukai GmbH
|
45
|
-
* @memberOf Monster.I18n
|
46
44
|
* @see {@link https://datatracker.ietf.org/doc/html/rfc3066}
|
47
45
|
*/
|
48
46
|
class Provider extends BaseWithOptions {
|
49
47
|
/**
|
50
48
|
* This method is called by the `instanceof` operator.
|
51
|
-
* @
|
49
|
+
* @return {symbol}
|
52
50
|
* @since 3.27.0
|
53
51
|
*/
|
54
52
|
static get [instanceSymbol]() {
|
@@ -30,9 +30,7 @@ export { Embed };
|
|
30
30
|
* @license AGPLv3
|
31
31
|
* @since 1.13.0
|
32
32
|
* @copyright schukai GmbH
|
33
|
-
* @memberOf Monster.I18n.Providers
|
34
33
|
* @see {@link https://datatracker.ietf.org/doc/html/rfc3066}
|
35
|
-
* @tutorial i18n-locale-and-formatter
|
36
34
|
*/
|
37
35
|
class Embed extends Provider {
|
38
36
|
/**
|
@@ -148,7 +146,7 @@ class Embed extends Provider {
|
|
148
146
|
* `script[data-monster-role=translations]` is searched for and the translations are assigned to the element.
|
149
147
|
*
|
150
148
|
* @param element
|
151
|
-
* @returns {Promise<Awaited<unknown>[]>}
|
149
|
+
* @returns {Promise<Awaited<*[]>>|Promise<Awaited<unknown>[]>}
|
152
150
|
*/
|
153
151
|
static assignTranslationsToElement(element) {
|
154
152
|
const d = getDocument();
|
@@ -35,7 +35,6 @@ export { Translations, getDocumentTranslations };
|
|
35
35
|
* @license AGPLv3
|
36
36
|
* @since 1.13.0
|
37
37
|
* @copyright schukai GmbH
|
38
|
-
* @memberOf Monster.I18n
|
39
38
|
* @see https://datatracker.ietf.org/doc/html/rfc3066
|
40
39
|
*/
|
41
40
|
class Translations extends Base {
|
@@ -57,7 +56,7 @@ class Translations extends Base {
|
|
57
56
|
|
58
57
|
/**
|
59
58
|
* This method is called by the `instanceof` operator.
|
60
|
-
* @
|
59
|
+
* @return {symbol}
|
61
60
|
* @since 3.27.0
|
62
61
|
*/
|
63
62
|
static get [instanceSymbol]() {
|
@@ -215,7 +214,7 @@ class Translations extends Base {
|
|
215
214
|
* Returns the translations for the current document.
|
216
215
|
*
|
217
216
|
* @param {HTMLElement|undefined} [element] - Element to search for translations. Default: element with objectlink @schukai/monster/i18n/translations@@link.
|
218
|
-
* @
|
217
|
+
* @return {Translations}
|
219
218
|
* @throws {Error} Element is not an HTMLElement.
|
220
219
|
* @throws {Error} Cannot find the element with translations. Add the translation object to the document.
|
221
220
|
* @throws {Error} This element has no translations.
|
@@ -25,7 +25,6 @@ export { ConsoleHandler };
|
|
25
25
|
* @license AGPLv3
|
26
26
|
* @since 1.5.0
|
27
27
|
* @copyright schukai GmbH
|
28
|
-
* @memberOf Monster.Logging.Handler
|
29
28
|
*/
|
30
29
|
class ConsoleHandler extends Handler {
|
31
30
|
/**
|
@@ -35,7 +34,7 @@ class ConsoleHandler extends Handler {
|
|
35
34
|
* ALL > TRACE > DEBUG > INFO > WARN > ERROR > FATAL > OFF (ALL = 0xff;OFF = 0x00;
|
36
35
|
*
|
37
36
|
* @param {LogEntry} entry
|
38
|
-
* @
|
37
|
+
* @return {boolean}
|
39
38
|
*/
|
40
39
|
log(entry) {
|
41
40
|
if (super.log(entry)) {
|
@@ -25,7 +25,6 @@ export { Handler };
|
|
25
25
|
* @license AGPLv3
|
26
26
|
* @since 1.5.0
|
27
27
|
* @copyright schukai GmbH
|
28
|
-
* @memberOf Monster.Logging
|
29
28
|
*/
|
30
29
|
class Handler extends Base {
|
31
30
|
constructor() {
|
@@ -46,7 +45,7 @@ class Handler extends Base {
|
|
46
45
|
* ALL > TRACE > DEBUG > INFO > WARN > ERROR > FATAL > OFF (ALL = 0xff;OFF = 0x00;
|
47
46
|
*
|
48
47
|
* @param {LogEntry} entry
|
49
|
-
* @
|
48
|
+
* @return {boolean}
|
50
49
|
*/
|
51
50
|
log(entry) {
|
52
51
|
validateInstance(entry, LogEntry);
|
@@ -62,7 +61,7 @@ class Handler extends Base {
|
|
62
61
|
* set loglevel
|
63
62
|
*
|
64
63
|
* @param {integer} loglevel
|
65
|
-
* @
|
64
|
+
* @return {Handler}
|
66
65
|
* @since 1.5.0
|
67
66
|
*/
|
68
67
|
setLogLevel(loglevel) {
|
@@ -74,7 +73,7 @@ class Handler extends Base {
|
|
74
73
|
/**
|
75
74
|
* get loglevel
|
76
75
|
*
|
77
|
-
* @
|
76
|
+
* @return {integer}
|
78
77
|
* @since 1.5.0
|
79
78
|
*/
|
80
79
|
getLogLevel() {
|
@@ -84,7 +83,7 @@ class Handler extends Base {
|
|
84
83
|
/**
|
85
84
|
* Set log level to All
|
86
85
|
*
|
87
|
-
* @
|
86
|
+
* @return {Handler}
|
88
87
|
* @since 1.5.0
|
89
88
|
*/
|
90
89
|
setAll() {
|
@@ -95,7 +94,7 @@ class Handler extends Base {
|
|
95
94
|
/**
|
96
95
|
* Set log level to Trace
|
97
96
|
*
|
98
|
-
* @
|
97
|
+
* @return {Handler}
|
99
98
|
* @since 1.5.0
|
100
99
|
*/
|
101
100
|
setTrace() {
|
@@ -106,7 +105,7 @@ class Handler extends Base {
|
|
106
105
|
/**
|
107
106
|
* Set log level to Debug
|
108
107
|
*
|
109
|
-
* @
|
108
|
+
* @return {Handler}
|
110
109
|
* @since 1.5.0
|
111
110
|
*/
|
112
111
|
setDebug() {
|
@@ -117,7 +116,7 @@ class Handler extends Base {
|
|
117
116
|
/**
|
118
117
|
* Set log level to Info
|
119
118
|
*
|
120
|
-
* @
|
119
|
+
* @return {Handler}
|
121
120
|
* @since 1.5.0
|
122
121
|
*/
|
123
122
|
setInfo() {
|
@@ -128,7 +127,7 @@ class Handler extends Base {
|
|
128
127
|
/**
|
129
128
|
* Set log level to Warn
|
130
129
|
*
|
131
|
-
* @
|
130
|
+
* @return {undefined}
|
132
131
|
* @since 1.5.0
|
133
132
|
*/
|
134
133
|
setWarn() {
|
@@ -139,7 +138,7 @@ class Handler extends Base {
|
|
139
138
|
/**
|
140
139
|
* Set log level to Error
|
141
140
|
*
|
142
|
-
* @
|
141
|
+
* @return {Handler}
|
143
142
|
* @since 1.5.0
|
144
143
|
*/
|
145
144
|
setError() {
|
@@ -150,7 +149,7 @@ class Handler extends Base {
|
|
150
149
|
/**
|
151
150
|
* Set log level to Fatal
|
152
151
|
*
|
153
|
-
* @
|
152
|
+
* @return {Handler}
|
154
153
|
* @since 1.5.0
|
155
154
|
*/
|
156
155
|
setFatal() {
|
@@ -161,7 +160,7 @@ class Handler extends Base {
|
|
161
160
|
/**
|
162
161
|
* Set log level to Off
|
163
162
|
*
|
164
|
-
* @
|
163
|
+
* @return {Handler}
|
165
164
|
* @since 1.5.0
|
166
165
|
*/
|
167
166
|
setOff() {
|
@@ -41,7 +41,7 @@ class LogEntry extends Base {
|
|
41
41
|
|
42
42
|
/**
|
43
43
|
*
|
44
|
-
* @
|
44
|
+
* @return {integerr}
|
45
45
|
*/
|
46
46
|
getLogLevel() {
|
47
47
|
return this.loglevel;
|
@@ -49,7 +49,7 @@ class LogEntry extends Base {
|
|
49
49
|
|
50
50
|
/**
|
51
51
|
*
|
52
|
-
* @
|
52
|
+
* @return {array}
|
53
53
|
*/
|
54
54
|
getArguments() {
|
55
55
|
return this.arguments;
|
@@ -12,8 +12,8 @@
|
|
12
12
|
* SPDX-License-Identifier: AGPL-3.0
|
13
13
|
*/
|
14
14
|
|
15
|
-
import { Handler } from "
|
16
|
-
import { LogEntry } from "
|
15
|
+
import { Handler } from "./handler.mjs";
|
16
|
+
import { LogEntry } from "./logentry.mjs";
|
17
17
|
|
18
18
|
import { Base } from "../types/base.mjs";
|
19
19
|
import {
|
@@ -27,49 +27,41 @@ export { Logger, ALL, TRACE, DEBUG, INFO, WARN, ERROR, FATAL, OFF };
|
|
27
27
|
/**
|
28
28
|
* ALL > TRACE > DEBUG > INFO > WARN > ERROR > FATAL > OFF
|
29
29
|
* @type {number}
|
30
|
-
* @memberOf Monster.Logging
|
31
30
|
*/
|
32
31
|
const ALL = 255;
|
33
32
|
/**
|
34
33
|
* ALL > TRACE > DEBUG > INFO > WARN > ERROR > FATAL > OFF
|
35
34
|
* @type {number}
|
36
|
-
* @memberOf Monster.Logging
|
37
35
|
*/
|
38
36
|
const TRACE = 64;
|
39
37
|
/**
|
40
38
|
* ALL > TRACE > DEBUG > INFO > WARN > ERROR > FATAL > OFF
|
41
39
|
* @type {number}
|
42
|
-
* @memberOf Monster.Logging
|
43
40
|
*/
|
44
41
|
const DEBUG = 32;
|
45
42
|
/**
|
46
43
|
* ALL > TRACE > DEBUG > INFO > WARN > ERROR > FATAL > OFF
|
47
44
|
* @type {number}
|
48
|
-
* @memberOf Monster.Logging
|
49
45
|
*/
|
50
46
|
const INFO = 16;
|
51
47
|
/**
|
52
48
|
* ALL > TRACE > DEBUG > INFO > WARN > ERROR > FATAL > OFF
|
53
49
|
* @type {number}
|
54
|
-
* @memberOf Monster.Logging
|
55
50
|
*/
|
56
51
|
const WARN = 8;
|
57
52
|
/**
|
58
53
|
* ALL > TRACE > DEBUG > INFO > WARN > ERROR > FATAL > OFF
|
59
54
|
* @type {number}
|
60
|
-
* @memberOf Monster.Logging
|
61
55
|
*/
|
62
56
|
const ERROR = 4;
|
63
57
|
/**
|
64
58
|
* ALL > TRACE > DEBUG > INFO > WARN > ERROR > FATAL > OFF
|
65
59
|
* @type {number}
|
66
|
-
* @memberOf Monster.Logging
|
67
60
|
*/
|
68
61
|
const FATAL = 2;
|
69
62
|
/**
|
70
63
|
* ALL > TRACE > DEBUG > INFO > WARN > ERROR > FATAL > OFF
|
71
64
|
* @type {number}
|
72
|
-
* @memberOf Monster.Logging
|
73
65
|
*/
|
74
66
|
const OFF = 0;
|
75
67
|
|
@@ -79,7 +71,6 @@ const OFF = 0;
|
|
79
71
|
* @license AGPLv3
|
80
72
|
* @since 1.5.0
|
81
73
|
* @copyright schukai GmbH
|
82
|
-
* @memberOf Monster.Logging
|
83
74
|
*/
|
84
75
|
class Logger extends Base {
|
85
76
|
/**
|
@@ -93,7 +84,7 @@ class Logger extends Base {
|
|
93
84
|
/**
|
94
85
|
*
|
95
86
|
* @param {Handler} handler
|
96
|
-
* @
|
87
|
+
* @return {Logger}
|
97
88
|
* @throws {Error} the handler must be an instance of Handler
|
98
89
|
*/
|
99
90
|
addHandler(handler) {
|
@@ -109,7 +100,7 @@ class Logger extends Base {
|
|
109
100
|
/**
|
110
101
|
*
|
111
102
|
* @param {Handler} handler
|
112
|
-
* @
|
103
|
+
* @return {Logger}
|
113
104
|
* @throws {Error} the handler must be an instance of Handler
|
114
105
|
*/
|
115
106
|
removeHandler(handler) {
|
@@ -128,7 +119,7 @@ class Logger extends Base {
|
|
128
119
|
* ALL > TRACE > DEBUG > INFO > WARN > ERROR > FATAL > OFF (ALL = 0xff;OFF = 0x00;
|
129
120
|
*
|
130
121
|
* @param {*} arguments
|
131
|
-
* @
|
122
|
+
* @return {Logger}
|
132
123
|
* @since 1.5.0
|
133
124
|
*/
|
134
125
|
logTrace(...args) {
|
@@ -146,7 +137,7 @@ class Logger extends Base {
|
|
146
137
|
* ALL > TRACE > DEBUG > INFO > WARN > ERROR > FATAL > OFF (ALL = 0xff;OFF = 0x00;
|
147
138
|
*
|
148
139
|
* @param {*} arguments
|
149
|
-
* @
|
140
|
+
* @return {Logger}
|
150
141
|
* @since 1.5.0
|
151
142
|
*/
|
152
143
|
logDebug(...args) {
|
@@ -165,7 +156,7 @@ class Logger extends Base {
|
|
165
156
|
*
|
166
157
|
*
|
167
158
|
* @param {*} arguments
|
168
|
-
* @
|
159
|
+
* @return {Logger}
|
169
160
|
* @since 1.5.0
|
170
161
|
*/
|
171
162
|
logInfo(...args) {
|
@@ -183,7 +174,7 @@ class Logger extends Base {
|
|
183
174
|
* ALL > TRACE > DEBUG > INFO > WARN > ERROR > FATAL > OFF (ALL = 0xff;OFF = 0x00;
|
184
175
|
*
|
185
176
|
* @param {*} arguments
|
186
|
-
* @
|
177
|
+
* @return {Logger}
|
187
178
|
* @since 1.5.0
|
188
179
|
*/
|
189
180
|
logWarn(...args) {
|
@@ -201,7 +192,7 @@ class Logger extends Base {
|
|
201
192
|
* ALL > TRACE > DEBUG > INFO > WARN > ERROR > FATAL > OFF (ALL = 0xff;OFF = 0x00;
|
202
193
|
*
|
203
194
|
* @param {*} arguments
|
204
|
-
* @
|
195
|
+
* @return {Logger}
|
205
196
|
* @since 1.5.0
|
206
197
|
*/
|
207
198
|
logError(...args) {
|
@@ -219,7 +210,7 @@ class Logger extends Base {
|
|
219
210
|
* ALL > TRACE > DEBUG > INFO > WARN > ERROR > FATAL > OFF (ALL = 0xff;OFF = 0x00;
|
220
211
|
*
|
221
212
|
* @param {*} arguments
|
222
|
-
* @
|
213
|
+
* @return {Logger}
|
223
214
|
* @since 1.5.0
|
224
215
|
*/
|
225
216
|
logFatal(...args) {
|
@@ -235,7 +226,7 @@ class Logger extends Base {
|
|
235
226
|
* Labels
|
236
227
|
*
|
237
228
|
* @param {integer} level
|
238
|
-
* @
|
229
|
+
* @return {string}
|
239
230
|
*/
|
240
231
|
getLabel(level) {
|
241
232
|
validateInteger(level);
|
@@ -256,7 +247,7 @@ class Logger extends Base {
|
|
256
247
|
* Level
|
257
248
|
*
|
258
249
|
* @param {string} label
|
259
|
-
* @
|
250
|
+
* @return {integer}
|
260
251
|
*/
|
261
252
|
getLevel(label) {
|
262
253
|
validateString(label);
|
@@ -279,7 +270,7 @@ class Logger extends Base {
|
|
279
270
|
*
|
280
271
|
* @param {integer} loglevel
|
281
272
|
* @param {*} args
|
282
|
-
* @
|
273
|
+
* @return {Logger}
|
283
274
|
* @private
|
284
275
|
*/
|
285
276
|
function triggerLog(loglevel, ...args) {
|
package/source/math/random.mjs
CHANGED
@@ -21,7 +21,7 @@ export { random };
|
|
21
21
|
*
|
22
22
|
* @param {number} min starting value of the definition set (default is 0)
|
23
23
|
* @param {number} max end value of the definition set (default is 1000000000)
|
24
|
-
* @
|
24
|
+
* @return {number}
|
25
25
|
* @memberOf Monster.Math
|
26
26
|
* @throws {Error} missing crypt
|
27
27
|
* @throws {Error} we cannot generate numbers larger than 53 bits.
|
@@ -62,7 +62,7 @@ Math.log2 =
|
|
62
62
|
*
|
63
63
|
* @param {number} min
|
64
64
|
* @param {number} max
|
65
|
-
* @
|
65
|
+
* @return {number}
|
66
66
|
* @private
|
67
67
|
* @throws {Error} missing crypt
|
68
68
|
* @throws {Error} we cannot generate numbers larger than 53 bits.
|
package/source/monster.mjs
CHANGED
@@ -106,6 +106,7 @@ export * from "./util/deadmansswitch.mjs";
|
|
106
106
|
export * from "./util/comparator.mjs";
|
107
107
|
export * from "./util/freeze.mjs";
|
108
108
|
export * from "./util/clone.mjs";
|
109
|
+
export * from "./util/processing/callback.mjs";
|
109
110
|
export * from "./logging/handler/console.mjs";
|
110
111
|
export * from "./logging/logger.mjs";
|
111
112
|
export * from "./logging/handler.mjs";
|