@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.
Files changed (96) hide show
  1. package/CHANGELOG.md +1400 -19
  2. package/package.json +1 -1
  3. package/source/components/accessibility/locale-picker.mjs +6 -6
  4. package/source/components/accessibility/locale-select.mjs +1 -1
  5. package/source/components/content/camera-capture.mjs +3 -3
  6. package/source/components/content/copy.mjs +1 -1
  7. package/source/components/content/fetch-box.mjs +1 -1
  8. package/source/components/content/image-editor.mjs +2 -4
  9. package/source/components/content/viewer/html.mjs +2 -2
  10. package/source/components/content/viewer/message.mjs +3 -3
  11. package/source/components/content/viewer/sanitize-html.mjs +1 -1
  12. package/source/components/data/kpi-tile.mjs +5 -5
  13. package/source/components/data/metric-graph.mjs +2 -2
  14. package/source/components/data/metric.mjs +1 -1
  15. package/source/components/datatable/change-button.mjs +1 -1
  16. package/source/components/datatable/columnbar.mjs +2 -2
  17. package/source/components/datatable/datasource/rest.mjs +2 -4
  18. package/source/components/datatable/datatable.mjs +3 -3
  19. package/source/components/datatable/filter/date-presets.mjs +1 -1
  20. package/source/components/datatable/filter/input.mjs +1 -1
  21. package/source/components/datatable/filter/range.mjs +1 -1
  22. package/source/components/datatable/filter/settings.mjs +1 -3
  23. package/source/components/datatable/filter/text-operator.mjs +1 -1
  24. package/source/components/datatable/filter.mjs +1 -1
  25. package/source/components/datatable/pagination.mjs +2 -4
  26. package/source/components/datatable/status.mjs +1 -1
  27. package/source/components/files/file-manager.mjs +1 -1
  28. package/source/components/form/action-button.mjs +1 -1
  29. package/source/components/form/api-bar.mjs +1 -1
  30. package/source/components/form/buy-box.mjs +1 -1
  31. package/source/components/form/cart-control.mjs +1 -1
  32. package/source/components/form/checklist.mjs +1 -1
  33. package/source/components/form/digits.mjs +4 -4
  34. package/source/components/form/dropzone.mjs +1 -1
  35. package/source/components/form/field-set.mjs +1 -1
  36. package/source/components/form/input-group.mjs +1 -1
  37. package/source/components/form/login.mjs +15 -15
  38. package/source/components/form/password.mjs +1 -1
  39. package/source/components/form/popper.mjs +1 -0
  40. package/source/components/form/repeat-field-set.mjs +1 -1
  41. package/source/components/form/select-link.mjs +3 -0
  42. package/source/components/form/select.mjs +33 -33
  43. package/source/components/form/sheet.mjs +3 -0
  44. package/source/components/form/tabs.mjs +1 -0
  45. package/source/components/form/toggle-switch.mjs +1 -1
  46. package/source/components/form/util/fetch.mjs +3 -3
  47. package/source/components/form/variant-select.mjs +1 -1
  48. package/source/components/form/wizard.mjs +1 -3
  49. package/source/components/host/collapse.mjs +1 -0
  50. package/source/components/host/config-manager.mjs +2 -2
  51. package/source/components/host/details.mjs +1 -0
  52. package/source/components/host/host.mjs +2 -2
  53. package/source/components/host/overlay.mjs +1 -0
  54. package/source/components/host/viewer.mjs +1 -0
  55. package/source/components/layout/board.mjs +1 -1
  56. package/source/components/layout/collapse.mjs +2 -2
  57. package/source/components/layout/details.mjs +1 -1
  58. package/source/components/layout/full-screen.mjs +2 -2
  59. package/source/components/layout/popper.mjs +1 -1
  60. package/source/components/layout/style/tabs.pcss +4 -1
  61. package/source/components/layout/stylesheet/tabs.mjs +9 -3
  62. package/source/components/layout/tabs.mjs +5 -8
  63. package/source/components/layout/utils/attach-tabs-hash-sync.mjs +1 -1
  64. package/source/components/layout/vertical-tabs.mjs +5 -8
  65. package/source/components/navigation/site-navigation.mjs +3 -3
  66. package/source/components/navigation/table-of-content.mjs +1 -1
  67. package/source/components/navigation/wizard-navigation.mjs +9 -11
  68. package/source/components/notify/monitor-attribute-errors.mjs +1 -1
  69. package/source/components/time/day.mjs +1 -1
  70. package/source/components/time/month-calendar.mjs +8 -8
  71. package/source/components/time/timeline/appointment.mjs +1 -1
  72. package/source/components/time/timeline/segment.mjs +1 -1
  73. package/source/components/tree-menu/tree-menu.mjs +0 -1
  74. package/source/data/datasource/dom.mjs +1 -0
  75. package/source/dom/customelement.mjs +13 -13
  76. package/source/dom/sanitize-html.mjs +1 -1
  77. package/source/i18n/internal.mjs +2 -2
  78. package/source/i18n/providers/embed.mjs +1 -1
  79. package/source/i18n/time-ago.mjs +1 -1
  80. package/source/text/formatter.mjs +1 -0
  81. package/source/types/dataurl.mjs +1 -0
  82. package/source/types/has.mjs +1 -1
  83. package/source/types/is.mjs +2 -2
  84. package/source/types/mediatype.mjs +1 -0
  85. package/source/types/observer.mjs +6 -6
  86. package/source/types/observerlist.mjs +1 -0
  87. package/source/types/proxyobserver.mjs +1 -0
  88. package/source/types/stack.mjs +1 -0
  89. package/source/types/tokenlist.mjs +1 -0
  90. package/source/types/uuid.mjs +1 -0
  91. package/source/util/accessiblecolor.mjs +2 -2
  92. package/source/util/comparator.mjs +3 -3
  93. package/source/util/deadmansswitch.mjs +3 -4
  94. package/source/util/processing.mjs +1 -1
  95. package/test/cases/components/datatable/drag-scroll.mjs +10 -0
  96. 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
- * @returns {string} The sanitized HTML string.
5
+ * @return {string} The sanitized HTML string.
6
6
  */
7
7
  export function sanitizeHtml(htmlString, options = {}) {
8
8
  const parser = new DOMParser();
@@ -23,7 +23,7 @@ getInternalTranslations();
23
23
 
24
24
  /**
25
25
  *
26
- * @returns {*|Translations}
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
- * @returns {string}
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
- * @returns {Promise<Awaited<*[]>>|Promise<Awaited<unknown>[]>}
150
+ * @return {Promise<Awaited<*[]>>|Promise<Awaited<unknown>[]>}
151
151
  */
152
152
  static assignTranslationsToElement(element) {
153
153
  const d = getDocument();
@@ -19,7 +19,7 @@ export { formatTimeAgo };
19
19
  *
20
20
  * @param date
21
21
  * @param locale
22
- * @returns {string}
22
+ * @return {string}
23
23
  */
24
24
  function formatTimeAgo(date, locale) {
25
25
  const now = new Date(Math.floor(new Date().getTime() / 1000) * 1000);
@@ -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
  /**
@@ -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
  /**
@@ -19,7 +19,7 @@ export { hasImplementation };
19
19
  *
20
20
  * @param object
21
21
  * @param methods
22
- * @returns {boolean}
22
+ * @return {boolean}
23
23
  */
24
24
  function hasImplementation(object, methods) {
25
25
  return methods.every((method) => typeof object[method] === "function");
@@ -33,7 +33,7 @@ export {
33
33
  /**
34
34
  * Checks whether the value passed is a DOM Element.
35
35
  * @param {*} value
36
- * @returns {boolean}
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
- * @returns {boolean}
49
+ * @return {boolean}
50
50
  */
51
51
  function isProxy(value) {
52
52
  return value?.[proxyInstanceMarker] === proxyInstanceMarker;
@@ -36,6 +36,7 @@ const internal = Symbol("internal");
36
36
  * @license AGPLv3
37
37
  * @since 1.8.0
38
38
  * @copyright Volker Schukai
39
+ * @summary Parses and represents media types and their parameters.
39
40
  */
40
41
  class MediaType extends Base {
41
42
  /**
@@ -75,7 +75,7 @@ class Observer extends Base {
75
75
 
76
76
  /**
77
77
  * This method is called by the `instanceof` operator.
78
- * @returns {symbol}
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
- * @returns {Promise<*>} A promise that resolves with the return value of the callback,
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
- * @returns {Observer}
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
- * @returns {Observer}
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
- * @returns {string[]}
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
- * @returns {boolean}
157
+ * @return {boolean}
158
158
  */
159
159
  hasTag(tag) {
160
160
  return this.#tags.contains(tag);
@@ -23,6 +23,7 @@ export { ObserverList };
23
23
  *
24
24
  * @license AGPLv3
25
25
  * @since 1.0.0
26
+ * @summary Manages a collection of Observer instances.
26
27
  */
27
28
  class ObserverList extends Base {
28
29
  /**
@@ -33,6 +33,7 @@ export { ProxyObserver };
33
33
  * @license AGPLv3
34
34
  * @since 1.0.0
35
35
  * @copyright Volker Schukai
36
+ * @summary Observes nested object changes through a proxy.
36
37
  */
37
38
  class ProxyObserver extends Base {
38
39
  /**
@@ -22,6 +22,7 @@ export { Stack };
22
22
  * @license AGPLv3
23
23
  * @since 1.4.0
24
24
  * @copyright Volker Schukai
25
+ * @summary Provides a last-in, first-out collection.
25
26
  */
26
27
  class Stack extends Base {
27
28
  /**
@@ -28,6 +28,7 @@ export { TokenList };
28
28
  * @license AGPLv3
29
29
  * @since 1.2.0
30
30
  * @copyright Volker Schukai
31
+ * @summary Manages a whitespace-separated set of string tokens.
31
32
  */
32
33
  class TokenList extends Base {
33
34
  /**
@@ -27,6 +27,7 @@ export { UUID };
27
27
  * @since 1.25.0
28
28
  * @copyright Volker Schukai
29
29
  * @throws {Error} unsupported
30
+ * @summary Creates and retrieves stable UUIDs for objects.
30
31
  */
31
32
  class UUID extends Base {
32
33
  /**
@@ -91,7 +91,7 @@
91
91
  *
92
92
  * @param color
93
93
  * @param minContrast
94
- * @returns {string|string}
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
- * @returns {number} The contrast ratio, a value ranging from 1 to 21.
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
- * @throw {TypeError} unsupported type
51
- * @throw {TypeError} impractical comparison
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
- * @throw {TypeError} the arguments must be either integer or functions
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
- * @returns {DeadMansSwitch}
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
- * @returns {DeadMansSwitch}
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
- * @throw {TypeError} the arguments must be either integer or functions
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
  );