@schukai/monster 4.154.1 → 4.154.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 +1400 -19
- package/package.json +1 -1
- package/source/components/accessibility/locale-picker.mjs +6 -6
- package/source/components/accessibility/locale-select.mjs +1 -1
- package/source/components/content/camera-capture.mjs +3 -3
- package/source/components/content/copy.mjs +1 -1
- package/source/components/content/fetch-box.mjs +1 -1
- package/source/components/content/image-editor.mjs +2 -4
- package/source/components/content/viewer/html.mjs +2 -2
- package/source/components/content/viewer/message.mjs +3 -3
- package/source/components/content/viewer/sanitize-html.mjs +1 -1
- package/source/components/data/kpi-tile.mjs +5 -5
- package/source/components/data/metric-graph.mjs +2 -2
- package/source/components/data/metric.mjs +1 -1
- package/source/components/datatable/change-button.mjs +1 -1
- package/source/components/datatable/columnbar.mjs +2 -2
- package/source/components/datatable/datasource/rest.mjs +2 -4
- package/source/components/datatable/datatable.mjs +3 -3
- package/source/components/datatable/filter/date-presets.mjs +1 -1
- package/source/components/datatable/filter/input.mjs +1 -1
- package/source/components/datatable/filter/range.mjs +1 -1
- package/source/components/datatable/filter/settings.mjs +1 -3
- package/source/components/datatable/filter/text-operator.mjs +1 -1
- package/source/components/datatable/filter.mjs +1 -1
- package/source/components/datatable/pagination.mjs +2 -4
- package/source/components/datatable/status.mjs +1 -1
- package/source/components/files/file-manager.mjs +1 -1
- package/source/components/form/action-button.mjs +1 -1
- package/source/components/form/api-bar.mjs +1 -1
- package/source/components/form/buy-box.mjs +1 -1
- package/source/components/form/cart-control.mjs +1 -1
- package/source/components/form/checklist.mjs +1 -1
- package/source/components/form/digits.mjs +4 -4
- package/source/components/form/dropzone.mjs +1 -1
- package/source/components/form/field-set.mjs +1 -1
- package/source/components/form/input-group.mjs +1 -1
- package/source/components/form/login.mjs +15 -15
- package/source/components/form/password.mjs +1 -1
- package/source/components/form/popper.mjs +1 -0
- package/source/components/form/repeat-field-set.mjs +1 -1
- package/source/components/form/select-link.mjs +3 -0
- package/source/components/form/select.mjs +33 -33
- package/source/components/form/sheet.mjs +3 -0
- package/source/components/form/tabs.mjs +1 -0
- package/source/components/form/toggle-switch.mjs +1 -1
- package/source/components/form/util/fetch.mjs +3 -3
- package/source/components/form/variant-select.mjs +1 -1
- package/source/components/form/wizard.mjs +1 -3
- package/source/components/host/collapse.mjs +1 -0
- package/source/components/host/config-manager.mjs +2 -2
- package/source/components/host/details.mjs +1 -0
- package/source/components/host/host.mjs +2 -2
- package/source/components/host/overlay.mjs +1 -0
- package/source/components/host/viewer.mjs +1 -0
- package/source/components/layout/board.mjs +1 -1
- package/source/components/layout/collapse.mjs +2 -2
- package/source/components/layout/details.mjs +1 -1
- package/source/components/layout/full-screen.mjs +2 -2
- package/source/components/layout/popper.mjs +1 -1
- package/source/components/layout/style/tabs.pcss +4 -1
- package/source/components/layout/stylesheet/tabs.mjs +9 -3
- package/source/components/layout/tabs.mjs +5 -8
- package/source/components/layout/utils/attach-tabs-hash-sync.mjs +1 -1
- package/source/components/layout/vertical-tabs.mjs +5 -8
- package/source/components/navigation/site-navigation.mjs +3 -3
- package/source/components/navigation/table-of-content.mjs +1 -1
- package/source/components/navigation/wizard-navigation.mjs +9 -11
- package/source/components/notify/monitor-attribute-errors.mjs +1 -1
- package/source/components/time/day.mjs +1 -1
- package/source/components/time/month-calendar.mjs +8 -8
- package/source/components/time/timeline/appointment.mjs +1 -1
- package/source/components/time/timeline/segment.mjs +1 -1
- package/source/components/tree-menu/tree-menu.mjs +0 -1
- package/source/data/datasource/dom.mjs +1 -0
- package/source/dom/customelement.mjs +13 -13
- package/source/dom/sanitize-html.mjs +1 -1
- package/source/i18n/internal.mjs +2 -2
- package/source/i18n/providers/embed.mjs +1 -1
- package/source/i18n/time-ago.mjs +1 -1
- package/source/text/formatter.mjs +1 -0
- package/source/types/dataurl.mjs +1 -0
- package/source/types/has.mjs +1 -1
- package/source/types/is.mjs +2 -2
- package/source/types/mediatype.mjs +1 -0
- package/source/types/observer.mjs +6 -6
- package/source/types/observerlist.mjs +1 -0
- package/source/types/proxyobserver.mjs +1 -0
- package/source/types/stack.mjs +1 -0
- package/source/types/tokenlist.mjs +1 -0
- package/source/types/uuid.mjs +1 -0
- package/source/util/accessiblecolor.mjs +2 -2
- package/source/util/comparator.mjs +3 -3
- package/source/util/deadmansswitch.mjs +3 -4
- package/source/util/processing.mjs +1 -1
- package/test/cases/components/datatable/drag-scroll.mjs +10 -0
- package/test/cases/components/layout/tabs.mjs +2 -0
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Helper function to sanitize HTML content by removing potentially dangerous content.
|
|
3
3
|
* @param {string} htmlString - The HTML string to sanitize.
|
|
4
4
|
* @param {Object} [options={}] - Optional configuration options.
|
|
5
|
-
* @
|
|
5
|
+
* @return {string} The sanitized HTML string.
|
|
6
6
|
*/
|
|
7
7
|
export function sanitizeHtml(htmlString, options = {}) {
|
|
8
8
|
const parser = new DOMParser();
|
package/source/i18n/internal.mjs
CHANGED
|
@@ -23,7 +23,7 @@ getInternalTranslations();
|
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
25
|
*
|
|
26
|
-
* @
|
|
26
|
+
* @return {*|Translations}
|
|
27
27
|
*/
|
|
28
28
|
function getInternalTranslations() {
|
|
29
29
|
if (internalTranslations) {
|
|
@@ -170,7 +170,7 @@ function getInternalTranslations() {
|
|
|
170
170
|
/**
|
|
171
171
|
* Returns the internal localization message.
|
|
172
172
|
* @param message
|
|
173
|
-
* @
|
|
173
|
+
* @return {string}
|
|
174
174
|
*/
|
|
175
175
|
|
|
176
176
|
function getInternalLocalizationMessage(message) {
|
|
@@ -147,7 +147,7 @@ class Embed extends Provider {
|
|
|
147
147
|
* `script[data-monster-role=translations]` is searched for and the translations are assigned to the element.
|
|
148
148
|
*
|
|
149
149
|
* @param element
|
|
150
|
-
* @
|
|
150
|
+
* @return {Promise<Awaited<*[]>>|Promise<Awaited<unknown>[]>}
|
|
151
151
|
*/
|
|
152
152
|
static assignTranslationsToElement(element) {
|
|
153
153
|
const d = getDocument();
|
package/source/i18n/time-ago.mjs
CHANGED
|
@@ -121,6 +121,7 @@ const workingDataSymbol = Symbol("workingData");
|
|
|
121
121
|
* @license AGPLv3
|
|
122
122
|
* @since 1.12.0
|
|
123
123
|
* @copyright Volker Schukai
|
|
124
|
+
* @summary Formats placeholder-based messages from structured values and pipes.
|
|
124
125
|
*/
|
|
125
126
|
class Formatter extends BaseWithOptions {
|
|
126
127
|
/**
|
package/source/types/dataurl.mjs
CHANGED
|
@@ -37,6 +37,7 @@ const internal = Symbol("internal");
|
|
|
37
37
|
* @copyright Volker Schukai
|
|
38
38
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs
|
|
39
39
|
* @see https://datatracker.ietf.org/doc/html/rfc2397
|
|
40
|
+
* @summary Parses and represents data URLs with media type and content.
|
|
40
41
|
*/
|
|
41
42
|
class DataUrl extends Base {
|
|
42
43
|
/**
|
package/source/types/has.mjs
CHANGED
package/source/types/is.mjs
CHANGED
|
@@ -33,7 +33,7 @@ export {
|
|
|
33
33
|
/**
|
|
34
34
|
* Checks whether the value passed is a DOM Element.
|
|
35
35
|
* @param {*} value
|
|
36
|
-
* @
|
|
36
|
+
* @return {boolean}
|
|
37
37
|
*/
|
|
38
38
|
function isElement(value) {
|
|
39
39
|
if (typeof Element === "undefined") {
|
|
@@ -46,7 +46,7 @@ function isElement(value) {
|
|
|
46
46
|
* Checks whether the value passed is a Proxy.
|
|
47
47
|
*
|
|
48
48
|
* @param {*} value
|
|
49
|
-
* @
|
|
49
|
+
* @return {boolean}
|
|
50
50
|
*/
|
|
51
51
|
function isProxy(value) {
|
|
52
52
|
return value?.[proxyInstanceMarker] === proxyInstanceMarker;
|
|
@@ -75,7 +75,7 @@ class Observer extends Base {
|
|
|
75
75
|
|
|
76
76
|
/**
|
|
77
77
|
* This method is called by the `instanceof` operator.
|
|
78
|
-
* @
|
|
78
|
+
* @return {symbol}
|
|
79
79
|
* @since 2.1.0
|
|
80
80
|
*/
|
|
81
81
|
static get [instanceSymbol]() {
|
|
@@ -97,7 +97,7 @@ class Observer extends Base {
|
|
|
97
97
|
* the callback is only executed once. All callers will receive the same promise.
|
|
98
98
|
*
|
|
99
99
|
* @param {object} subject The subject object that triggered the update.
|
|
100
|
-
* @
|
|
100
|
+
* @return {Promise<*>} A promise that resolves with the return value of the callback,
|
|
101
101
|
* or rejects if the callback throws an error.
|
|
102
102
|
*/
|
|
103
103
|
update(subject) {
|
|
@@ -129,7 +129,7 @@ class Observer extends Base {
|
|
|
129
129
|
|
|
130
130
|
/**
|
|
131
131
|
* @param {string} tag
|
|
132
|
-
* @
|
|
132
|
+
* @return {Observer}
|
|
133
133
|
*/
|
|
134
134
|
addTag(tag) {
|
|
135
135
|
this.#tags.add(tag);
|
|
@@ -138,7 +138,7 @@ class Observer extends Base {
|
|
|
138
138
|
|
|
139
139
|
/**
|
|
140
140
|
* @param {string} tag
|
|
141
|
-
* @
|
|
141
|
+
* @return {Observer}
|
|
142
142
|
*/
|
|
143
143
|
removeTag(tag) {
|
|
144
144
|
this.#tags.remove(tag);
|
|
@@ -146,7 +146,7 @@ class Observer extends Base {
|
|
|
146
146
|
}
|
|
147
147
|
|
|
148
148
|
/**
|
|
149
|
-
* @
|
|
149
|
+
* @return {string[]}
|
|
150
150
|
*/
|
|
151
151
|
getTags() {
|
|
152
152
|
return this.#tags.entries();
|
|
@@ -154,7 +154,7 @@ class Observer extends Base {
|
|
|
154
154
|
|
|
155
155
|
/**
|
|
156
156
|
* @param {string} tag
|
|
157
|
-
* @
|
|
157
|
+
* @return {boolean}
|
|
158
158
|
*/
|
|
159
159
|
hasTag(tag) {
|
|
160
160
|
return this.#tags.contains(tag);
|
package/source/types/stack.mjs
CHANGED
package/source/types/uuid.mjs
CHANGED
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
*
|
|
92
92
|
* @param color
|
|
93
93
|
* @param minContrast
|
|
94
|
-
* @
|
|
94
|
+
* @return {string|string}
|
|
95
95
|
* @summary This function generates a color that meets the WCAG contrast ratio requirements against a given base color.
|
|
96
96
|
*/
|
|
97
97
|
export function accessibleColor(color, minContrast = 4.5) {
|
|
@@ -187,7 +187,7 @@ function luminance(hex) {
|
|
|
187
187
|
*
|
|
188
188
|
* @param {number} l1 - The relative luminance of the lighter element.
|
|
189
189
|
* @param {number} l2 - The relative luminance of the darker element.
|
|
190
|
-
* @
|
|
190
|
+
* @return {number} The contrast ratio, a value ranging from 1 to 21.
|
|
191
191
|
*/
|
|
192
192
|
const contrastRatio = (l1, l2) =>
|
|
193
193
|
(Math.max(l1, l2) + 0.05) / (Math.min(l1, l2) + 0.05);
|
|
@@ -38,17 +38,17 @@ export { Comparator };
|
|
|
38
38
|
* }).equal({v: 2}, {v: 2}); // ↦ true
|
|
39
39
|
* ```
|
|
40
40
|
*
|
|
41
|
-
* @example /example/comparator/simple/ Simple example
|
|
42
41
|
* @license AGPLv3
|
|
43
42
|
* @since 1.3.0
|
|
43
|
+
* @summary Wraps customizable comparison operations for arbitrary values.
|
|
44
44
|
*/
|
|
45
45
|
class Comparator extends Base {
|
|
46
46
|
/**
|
|
47
47
|
* create new comparator
|
|
48
48
|
*
|
|
49
49
|
* @param {Monster.Util~exampleCallback} [callback] Comparator callback
|
|
50
|
-
* @
|
|
51
|
-
* @
|
|
50
|
+
* @throws {TypeError} unsupported type
|
|
51
|
+
* @throws {TypeError} impractical comparison
|
|
52
52
|
*/
|
|
53
53
|
constructor(callback) {
|
|
54
54
|
super();
|
|
@@ -24,7 +24,6 @@ export { DeadMansSwitch };
|
|
|
24
24
|
* The dead man's switch allows setting a timer which can be reset again
|
|
25
25
|
* and again within a defined period of time.
|
|
26
26
|
*
|
|
27
|
-
* @example /example/util/deadmansswitch/simple/ Simple example
|
|
28
27
|
* @copyright Volker Schukai
|
|
29
28
|
* @license AGPLv3
|
|
30
29
|
* @since 1.29.0
|
|
@@ -36,7 +35,7 @@ class DeadMansSwitch extends Base {
|
|
|
36
35
|
*
|
|
37
36
|
* @param {Integer} delay
|
|
38
37
|
* @param {function} callback
|
|
39
|
-
* @
|
|
38
|
+
* @throws {TypeError} the arguments must be either integer or functions
|
|
40
39
|
* @throws {TypeError} value is not an integer
|
|
41
40
|
*/
|
|
42
41
|
constructor(delay, callback) {
|
|
@@ -47,7 +46,7 @@ class DeadMansSwitch extends Base {
|
|
|
47
46
|
|
|
48
47
|
/**
|
|
49
48
|
* @param delay
|
|
50
|
-
* @
|
|
49
|
+
* @return {DeadMansSwitch}
|
|
51
50
|
* @throws {Error} has already run
|
|
52
51
|
* @throws {Error} unsupported argument
|
|
53
52
|
*/
|
|
@@ -70,7 +69,7 @@ class DeadMansSwitch extends Base {
|
|
|
70
69
|
|
|
71
70
|
/**
|
|
72
71
|
* @throws {Error} has already run
|
|
73
|
-
* @
|
|
72
|
+
* @return {DeadMansSwitch}
|
|
74
73
|
*/
|
|
75
74
|
defuse() {
|
|
76
75
|
if (this[internalSymbol]["isAlreadyRun"] === true) {
|
|
@@ -54,7 +54,7 @@ class Processing extends Base {
|
|
|
54
54
|
*
|
|
55
55
|
* So the execution time is timeout1+timeout1+timeout1+timeout2
|
|
56
56
|
*
|
|
57
|
-
* @
|
|
57
|
+
* @throws {TypeError} the arguments must be either integer or functions
|
|
58
58
|
* @param {...(int|function)} args
|
|
59
59
|
*/
|
|
60
60
|
constructor(...args) {
|
|
@@ -702,6 +702,16 @@ describe("Datatable drag scroll", function () {
|
|
|
702
702
|
expect(firstResizeObserver).to.exist;
|
|
703
703
|
expect(secondResizeObserver).to.exist;
|
|
704
704
|
|
|
705
|
+
// Drain initialization work from the module-level shared frame before
|
|
706
|
+
// replacing requestAnimationFrame. Otherwise a slow renderer can still
|
|
707
|
+
// have that frame pending and the observer updates correctly join it,
|
|
708
|
+
// leaving the spy below with no newly scheduled callback.
|
|
709
|
+
await new Promise((resolve) => {
|
|
710
|
+
window.requestAnimationFrame(() =>
|
|
711
|
+
window.requestAnimationFrame(resolve),
|
|
712
|
+
);
|
|
713
|
+
});
|
|
714
|
+
|
|
705
715
|
const scheduledCallbacks = [];
|
|
706
716
|
window.requestAnimationFrame = (callback) => {
|
|
707
717
|
scheduledCallbacks.push(callback);
|
|
@@ -351,6 +351,8 @@ describe("Tabs", function () {
|
|
|
351
351
|
expect(cssText).to.contain("--monster-tabs-nav-background-color");
|
|
352
352
|
expect(cssText).to.contain("--monster-tabs-nav-align-items");
|
|
353
353
|
expect(cssText).to.contain("--monster-tabs-button-color");
|
|
354
|
+
expect(cssText).to.contain("--monster-tabs-icon-color");
|
|
355
|
+
expect(cssText).to.contain("var(--monster-color-red-4)");
|
|
354
356
|
expect(cssText).to.contain(
|
|
355
357
|
"--monster-tabs-button-active-background-color",
|
|
356
358
|
);
|