@schukai/monster 3.118.0 → 3.119.0

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 CHANGED
@@ -2,6 +2,28 @@
2
2
 
3
3
 
4
4
 
5
+ ## [3.119.0] - 2025-05-06
6
+
7
+ ### Add Features
8
+
9
+ - **viewer:** extend setContent with mimetype [#309](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/309)
10
+ ### Bug Fixes
11
+
12
+ - restore removed funktion
13
+
14
+
15
+
16
+ ## [3.118.1] - 2025-05-02
17
+
18
+ ### Bug Fixes
19
+
20
+ - remove strange chars from toggle
21
+ ### Changes
22
+
23
+ - update import
24
+
25
+
26
+
5
27
  ## [3.118.0] - 2025-05-01
6
28
 
7
29
  ### Add Features
package/package.json CHANGED
@@ -1 +1 @@
1
- {"author":"schukai GmbH","dependencies":{"@floating-ui/dom":"^1.6.13","@popperjs/core":"^2.11.8","buffer":"^6.0.3"},"description":"Monster is a simple library for creating fast, robust and lightweight websites.","homepage":"https://monsterjs.org/","keywords":["framework","web","dom","css","sass","mobile-first","app","front-end","templates","schukai","core","shopcloud","alvine","monster","buildmap","stack","observer","observable","uuid","node","nodelist","css-in-js","logger","log","theme"],"license":"AGPL 3.0","main":"source/monster.mjs","module":"source/monster.mjs","name":"@schukai/monster","repository":{"type":"git","url":"https://gitlab.schukai.com/oss/libraries/javascript/monster.git"},"type":"module","version":"3.118.0"}
1
+ {"author":"schukai GmbH","dependencies":{"@floating-ui/dom":"^1.7.0","@popperjs/core":"^2.11.8","buffer":"^6.0.3"},"description":"Monster is a simple library for creating fast, robust and lightweight websites.","homepage":"https://monsterjs.org/","keywords":["framework","web","dom","css","sass","mobile-first","app","front-end","templates","schukai","core","shopcloud","alvine","monster","buildmap","stack","observer","observable","uuid","node","nodelist","css-in-js","logger","log","theme"],"license":"AGPL 3.0","main":"source/monster.mjs","module":"source/monster.mjs","name":"@schukai/monster","repository":{"type":"git","url":"https://gitlab.schukai.com/oss/libraries/javascript/monster.git"},"type":"module","version":"3.119.0"}
@@ -13,17 +13,18 @@
13
13
  */
14
14
 
15
15
  import {
16
- assembleMethodSymbol,
17
- CustomElement,
18
- registerCustomElement,
16
+ assembleMethodSymbol,
17
+ CustomElement,
18
+ registerCustomElement,
19
19
  } from "../../dom/customelement.mjs";
20
20
  import "../notify/notify.mjs";
21
- import { ViewerStyleSheet } from "./stylesheet/viewer.mjs";
22
- import { instanceSymbol } from "../../constants.mjs";
23
- import { isString } from "../../types/is.mjs";
24
- import { getGlobal } from "../../types/global.mjs";
21
+ import {ViewerStyleSheet} from "./stylesheet/viewer.mjs";
22
+ import {instanceSymbol} from "../../constants.mjs";
23
+ import {isString} from "../../types/is.mjs";
24
+ import {getGlobal} from "../../types/global.mjs";
25
+ import {MediaType, parseMediaType} from "../../types/mediatype.mjs";
25
26
 
26
- export { Viewer };
27
+ export {Viewer};
27
28
 
28
29
  /**
29
30
  * @private
@@ -44,178 +45,288 @@ const viewerElementSymbol = Symbol("viewerElement");
44
45
  * @summary A simple viewer component for PDF, HTML and images.
45
46
  */
46
47
  class Viewer extends CustomElement {
47
- /**
48
- * This method is called by the `instanceof` operator.
49
- * @return {symbol}
50
- */
51
- static get [instanceSymbol]() {
52
- return Symbol.for("@schukai/monster/components/content/viewer@@instance");
53
- }
54
-
55
- /**
56
- * To set the options via the HTML tag, the attribute `data-monster-options` must be used.
57
- * @see {@link https://monsterjs.org/en/doc/#configurate-a-monster-control}
58
- *
59
- * The individual configuration values can be found in the table.
60
- *
61
- * @property {Object} templates Template definitions
62
- * @property {string} templates.main Main template
63
- * @property {Object} classes Css classes
64
- * @property {Object} features Feature definitions
65
- */
66
- get defaults() {
67
- return Object.assign({}, super.defaults, {
68
- templates: {
69
- main: getTemplate(),
70
- },
71
- content: "<slot></slot>",
72
- classes: {
73
- viewer: "",
74
- },
75
- features: {},
76
- });
77
- }
78
-
79
- /**
80
- *
81
- * @param {string} content
82
- * @returns {Viewer}
83
- */
84
- setContent(content) {
85
- this.setOption("content", content);
86
- return this;
87
- }
88
-
89
- /**
90
- *
91
- * @param {Blob|URL|string} data
92
- * @param {boolean} navigation
93
- * @param {boolean} toolbar
94
- * @param {boolean} scrollbar
95
- */
96
- setPDF(data, navigation = true, toolbar = true, scrollbar = false) {
97
- const hashes =
98
- "#toolbar=" +
99
- (toolbar ? "1" : "0") +
100
- "&navpanes=" +
101
- (navigation ? "1" : "0") +
102
- "&scrollbar=" +
103
- (scrollbar ? "1" : "0");
104
-
105
- let pdfContent = "";
106
- if (isBlob(data)) {
107
- pdfContent = URL.createObjectURL(data);
108
- pdfContent += hashes;
109
- } else if (isURL(data)) {
110
- pdfContent = data;
111
- // check if the url already contains the hashes
112
- if (pdfContent.indexOf("#") === -1) {
113
- pdfContent += hashes;
114
- }
115
- } else if (isString(data)) {
116
- //URL.createObjectURL(data);
117
- const blobObj = new Blob([atob(data)], { type: "application/pdf" });
118
- const url = window.URL.createObjectURL(blobObj);
119
-
120
- pdfContent = data;
121
- } else {
122
- throw new Error("Blob or URL expected");
123
- }
124
-
125
- const html =
126
- '<object data="' +
127
- pdfContent +
128
- '" width="100%" height="100%" type="application/pdf"></object>';
129
- this.setContent(html);
130
- }
131
-
132
- /**
133
- *
134
- * @param {Blob|URL|string} data
135
- */
136
- setImage(data) {
137
- if (isBlob(data)) {
138
- data = URL.createObjectURL(data);
139
- } else if (isURL(data)) {
140
- // nothing to do
141
- } else if (isString(data)) {
142
- // nothing to do
143
- } else {
144
- throw new Error("Blob or URL expected");
145
- }
146
-
147
- const html = '<img src="' + data + '" alt="image" />';
148
- this.setContent(html);
149
- }
150
-
151
- /**
152
- *
153
- * if the data is a string, it is interpreted as HTML.
154
- * if the data is an url, the HTML is loaded from the url and set as content.
155
- * if the data is an HTMLElement, the outerHTML is used as content.
156
- *
157
- * @param {HTMLElement|URL|string|Blob} data
158
- */
159
- setHTML(data) {
160
- if (data instanceof Blob) {
161
- blobToText(data)
162
- .then((html) => {
163
- this.setHTML(html);
164
- })
165
- .catch((error) => {
166
- throw new Error(error);
167
- });
168
-
169
- return;
170
- } else if (data instanceof HTMLElement) {
171
- data = data.outerHTML;
172
- } else if (isString(data)) {
173
- // nothing to do
174
- } else if (isURL(data)) {
175
- // fetch element
176
- getGlobal()
177
- .fetch(data)
178
- .then((response) => {
179
- return response.text();
180
- })
181
- .then((html) => {
182
- this.setHTML(html);
183
- })
184
- .catch((error) => {
185
- throw new Error(error);
186
- });
187
- } else {
188
- throw new Error("HTMLElement or string expected");
189
- }
190
-
191
- this.setContent(data);
192
- }
193
-
194
- /**
195
- *
196
- * @return {Viewer}
197
- */
198
- [assembleMethodSymbol]() {
199
- super[assembleMethodSymbol]();
200
-
201
- initControlReferences.call(this);
202
- initEventHandler.call(this);
203
- }
204
-
205
- /**
206
- *
207
- * @return {string}
208
- */
209
- static getTag() {
210
- return "monster-viewer";
211
- }
212
-
213
- /**
214
- * @return {CSSStyleSheet[]}
215
- */
216
- static getCSSStyleSheet() {
217
- return [ViewerStyleSheet];
218
- }
48
+ /**
49
+ * This method is called by the `instanceof` operator.
50
+ * @return {symbol}
51
+ */
52
+ static get [instanceSymbol]() {
53
+ return Symbol.for("@schukai/monster/components/content/viewer@@instance");
54
+ }
55
+
56
+ /**
57
+ * To set the options via the HTML tag, the attribute `data-monster-options` must be used.
58
+ * @see {@link https://monsterjs.org/en/doc/#configurate-a-monster-control}
59
+ *
60
+ * The individual configuration values can be found in the table.
61
+ *
62
+ * @property {Object} templates Template definitions
63
+ * @property {string} templates.main Main template
64
+ * @property {string} content Content to be displayed in the viewer
65
+ * @property {Object} classes Css classes
66
+ * @property {string} classes.viewer Css class for the viewer
67
+ */
68
+ get defaults() {
69
+ return Object.assign({}, super.defaults, {
70
+ templates: {
71
+ main: getTemplate(),
72
+ },
73
+ content: "<slot></slot>",
74
+ classes: {
75
+ viewer: "",
76
+ }
77
+ });
78
+ }
79
+
80
+ /**
81
+ * Sets the content of an element based on the provided content and media type.
82
+ *
83
+ * @param {string} content - The content to be set.
84
+ * @param {string} [mediaType="text/plain"] - The media type of the content. Defaults to "text/plain" if not specified.
85
+ * @return {void} This method does not return a value.
86
+ * @throws {Error} Throws an error if shadowRoot is not defined.
87
+ */
88
+ setContent(content, mediaType = "text/plain") {
89
+
90
+ if (!this.shadowRoot) {
91
+ throw new Error("no shadow-root is defined");
92
+ }
93
+
94
+ let type;
95
+ try {
96
+ const m = new parseMediaType(mediaType)
97
+ switch (m.type) {
98
+ case "image":
99
+ return this.setImage(content)
100
+ }
101
+
102
+ mediaType = m.toString()
103
+
104
+ } catch (error) {
105
+ type = null
106
+ }
107
+
108
+ if (mediaType === undefined || mediaType === null || mediaType === "") {
109
+ mediaType = "text/plain";
110
+ }
111
+
112
+ switch (mediaType) {
113
+ case "text/html":
114
+ this.setHTML(content);
115
+ break;
116
+ case "text/plain":
117
+ this.setPlainText(content);
118
+ break;
119
+ case "application/pdf":
120
+ this.setPDF(content);
121
+ break;
122
+ case "image/png":
123
+ case "image/jpeg":
124
+ case "image/gif":
125
+ this.setImage(content);
126
+ break;
127
+ default:
128
+ this.setOption("content", content);
129
+ }
130
+
131
+ }
132
+
133
+ /**
134
+ * Configures and embeds a PDF document into the application with customizable display settings.
135
+ *
136
+ * @param {Blob|URL|string} data The PDF data to be embedded. Can be provided as a Blob, URL or base64 string.
137
+ * @param {boolean} [navigation=true] Determines whether the navigation pane is displayed in the PDF viewer.
138
+ * @param {boolean} [toolbar=true] Controls the visibility of the toolbar in the PDF viewer.
139
+ * @param {boolean} [scrollbar=false] Configures the display of the scrollbar in the PDF viewer.
140
+ * @return {void} This method returns nothing but sets the embedded PDF as the content.
141
+ */
142
+ setPDF(data, navigation = true, toolbar = true, scrollbar = false) {
143
+ const hashes =
144
+ "#toolbar=" +
145
+ (toolbar ? "1" : "0") +
146
+ "&navpanes=" +
147
+ (navigation ? "1" : "0") +
148
+ "&scrollbar=" +
149
+ (scrollbar ? "1" : "0");
150
+
151
+ let pdfURL = "";
152
+ if (isBlob(data)) {
153
+ pdfURL = URL.createObjectURL(data);
154
+ pdfURL += hashes;
155
+ } else if (isURL(data)) {
156
+ // check if the url already contains the hashes
157
+ if (data?.hash?.indexOf("#") === -1) {
158
+ pdfURL = data.toString() + hashes;
159
+ } else {
160
+ pdfURL = data.toString();
161
+ }
162
+
163
+
164
+ } else if (isString(data)) {
165
+ //URL.createObjectURL(data);
166
+ const blobObj = new Blob([atob(data)], {type: "application/pdf"});
167
+ const url = window.URL.createObjectURL(blobObj);
168
+
169
+ pdfURL = data;
170
+ } else {
171
+ throw new Error("Blob or URL expected");
172
+ }
173
+
174
+ const html =
175
+ '<object data="' +
176
+ pdfURL +
177
+ '" width="100%" height="100%" type="application/pdf"></object>';
178
+
179
+ this.setOption("content", html);
180
+
181
+ }
182
+
183
+ /**
184
+ * Sets an image for the target by accepting a blob, URL, or string representation of the image.
185
+ *
186
+ * @param {(Blob|string)} data - The image data, which can be a Blob, a valid URL, or a string representation of the image.
187
+ * @return {void} Does not return a value.
188
+ */
189
+ setImage(data) {
190
+ if (isBlob(data)) {
191
+ data = URL.createObjectURL(data);
192
+ } else if (isURL(data)) {
193
+ // nothing to do
194
+ } else if (isString(data)) {
195
+ // nothing to do
196
+ } else {
197
+ throw new Error("Blob or URL expected");
198
+ }
199
+
200
+ this.setOption("content", '<img src="' + data + '" alt="image" />');
201
+ }
202
+
203
+ /**
204
+ *
205
+ * if the data is a string, it is interpreted as HTML.
206
+ * if the data is an url, the HTML is loaded from the url and set as content.
207
+ * if the data is an HTMLElement, the outerHTML is used as content.
208
+ *
209
+ * @param {HTMLElement|URL|string|Blob} data
210
+ */
211
+ setHTML(data) {
212
+ if (data instanceof Blob) {
213
+ blobToText(data)
214
+ .then((html) => {
215
+ this.setOption("content", html);
216
+ })
217
+ .catch((error) => {
218
+ throw new Error(error);
219
+ });
220
+
221
+ return;
222
+ } else if (data instanceof HTMLElement) {
223
+ data = data.outerHTML;
224
+ } else if (isString(data)) {
225
+ // nothing to do
226
+ } else if (isURL(data)) {
227
+ // fetch element
228
+ getGlobal()
229
+ .fetch(data)
230
+ .then((response) => {
231
+ return response.text();
232
+ })
233
+ .then((html) => {
234
+ this.setOption("content", html);
235
+ })
236
+ .catch((error) => {
237
+ throw new Error(error);
238
+ });
239
+ } else {
240
+ throw new Error("HTMLElement or string expected");
241
+ }
242
+
243
+ this.setOption("content", data);
244
+
245
+ }
246
+
247
+ /**
248
+ * Sets the plain text content by processing the input data, which can be of various types, including Blob,
249
+ * HTMLElement, string, or a valid URL. The method extracts and sets the raw text content into a predefined option.
250
+ *
251
+ * @param {Blob|HTMLElement|string} data - The input data to be processed. It can be a Blob object, an HTMLElement,
252
+ * a plain string, or a string formatted as a valid URL. The method determines
253
+ * the data type and processes it accordingly.
254
+ * @return {void} - This method does not return any value. It processes the content and updates the relevant option
255
+ * property.
256
+ */
257
+ setPlainText(data) {
258
+ if (data instanceof Blob) {
259
+ blobToText(data)
260
+ .then((html) => {
261
+
262
+ const div = document.createElement("div");
263
+ div.innerHTML = html;
264
+ html = div.innerText
265
+
266
+ this.setOption("content", html);
267
+ })
268
+ .catch((error) => {
269
+ throw new Error(error);
270
+ });
271
+
272
+ return;
273
+ } else if (data instanceof HTMLElement) {
274
+ data = data.outerText
275
+ } else if (isString(data)) {
276
+ const div = document.createElement("div");
277
+ div.innerHTML = data;
278
+ data = div.innerText
279
+
280
+ } else if (isURL(data)) {
281
+ // fetch element
282
+ getGlobal()
283
+ .fetch(data)
284
+ .then((response) => {
285
+ return response.text();
286
+ })
287
+ .then((text) => {
288
+
289
+ const div = document.createElement("div");
290
+ div.innerHTML = text;
291
+ text = div.innerText
292
+
293
+ this.setOption("content", text);
294
+ })
295
+ .catch((error) => {
296
+ throw new Error(error);
297
+ });
298
+ } else {
299
+ throw new Error("HTMLElement or string expected");
300
+ }
301
+
302
+ this.setOption("content", data);
303
+ }
304
+
305
+ /**
306
+ *
307
+ * @return {Viewer}
308
+ */
309
+ [assembleMethodSymbol]() {
310
+ super[assembleMethodSymbol]();
311
+
312
+ initControlReferences.call(this);
313
+ initEventHandler.call(this);
314
+ }
315
+
316
+ /**
317
+ *
318
+ * @return {string}
319
+ */
320
+ static getTag() {
321
+ return "monster-viewer";
322
+ }
323
+
324
+ /**
325
+ * @return {CSSStyleSheet[]}
326
+ */
327
+ static getCSSStyleSheet() {
328
+ return [ViewerStyleSheet];
329
+ }
219
330
  }
220
331
 
221
332
  /**
@@ -224,12 +335,12 @@ class Viewer extends CustomElement {
224
335
  * @return {boolean}
225
336
  */
226
337
  function isURL(variable) {
227
- try {
228
- new URL(variable);
229
- return true;
230
- } catch (error) {
231
- return false;
232
- }
338
+ try {
339
+ new URL(variable);
340
+ return true;
341
+ } catch (error) {
342
+ return false;
343
+ }
233
344
  }
234
345
 
235
346
  /**
@@ -238,7 +349,7 @@ function isURL(variable) {
238
349
  * @return {boolean}
239
350
  */
240
351
  function isBlob(variable) {
241
- return variable instanceof Blob;
352
+ return variable instanceof Blob;
242
353
  }
243
354
 
244
355
  /**
@@ -247,12 +358,12 @@ function isBlob(variable) {
247
358
  * @return {Promise<unknown>}
248
359
  */
249
360
  function blobToText(blob) {
250
- return new Promise((resolve, reject) => {
251
- const reader = new FileReader();
252
- reader.onloadend = () => resolve(reader.result);
253
- reader.onerror = reject;
254
- reader.readAsText(blob);
255
- });
361
+ return new Promise((resolve, reject) => {
362
+ const reader = new FileReader();
363
+ reader.onloadend = () => resolve(reader.result);
364
+ reader.onerror = reject;
365
+ reader.readAsText(blob);
366
+ });
256
367
  }
257
368
 
258
369
  /**
@@ -261,18 +372,18 @@ function blobToText(blob) {
261
372
  * @throws {Error} no shadow-root is defined
262
373
  */
263
374
  function initControlReferences() {
264
- if (!this.shadowRoot) {
265
- throw new Error("no shadow-root is defined");
266
- }
375
+ if (!this.shadowRoot) {
376
+ throw new Error("no shadow-root is defined");
377
+ }
267
378
 
268
- this[viewerElementSymbol] = this.shadowRoot.getElementById("viewer");
379
+ this[viewerElementSymbol] = this.shadowRoot.getElementById("viewer");
269
380
  }
270
381
 
271
382
  /**
272
383
  * @private
273
384
  */
274
385
  function initEventHandler() {
275
- return this;
386
+ return this;
276
387
  }
277
388
 
278
389
  /**
@@ -280,9 +391,11 @@ function initEventHandler() {
280
391
  * @return {string}
281
392
  */
282
393
  function getTemplate() {
283
- // language=HTML
284
- return `
285
- <div id="viewer" data-monster-role="viewer" part="viewer" data-monster-replace="path:content" data-monster-attributes="class path:classes.viewer">
394
+ // language=HTML
395
+ return `
396
+ <div id="viewer" data-monster-role="viewer" part="viewer"
397
+ data-monster-replace="path:content"
398
+ data-monster-attributes="class path:classes.viewer">
286
399
  </div>`;
287
400
  }
288
401
 
@@ -16,7 +16,7 @@ import { instanceSymbol } from "../../constants.mjs";
16
16
  import { registerCustomElement } from "../../dom/customelement.mjs";
17
17
  import { CustomControl } from "../../dom/customcontrol.mjs";
18
18
  import { ContextHelpStyleSheet } from "./stylesheet/context-help.mjs";
19
- import { Popper } from "./popper.mjs";
19
+ import { Popper } from "../layout/popper.mjs";
20
20
 
21
21
  export { ContextHelp };
22
22
 
@@ -287,6 +287,9 @@ const FILTER_POSITION_INLINE = "inline";
287
287
  * @summary A beautiful select control that can make your life easier and also looks good.
288
288
  * @fires monster-change
289
289
  * @fires monster-changed
290
+ * @fires monster-options-set this event is fired when the options are set
291
+ * @fires monster-selection-removed
292
+ * @fires monster-selection-cleared
290
293
  */
291
294
  class Select extends CustomControl {
292
295
  /**
@@ -1817,11 +1820,12 @@ function formatURL(url, value) {
1817
1820
  }
1818
1821
 
1819
1822
  /**
1820
- * @private
1821
- * @param optionUrl
1822
- * @param value
1823
- * @param openPopper
1824
- * @returns {Promise<unknown>}
1823
+ * Formats a given URL by applying specific filters and markers.
1824
+ *
1825
+ * @param {string} optionUrl The URL to format.
1826
+ * @param {string} [value] The filter value to apply. If not provided, it attempts to retrieve a default value.
1827
+ * @param {boolean} [openPopper] Flag indicating whether to open the popper.
1828
+ * @return {string} The formatted URL with the applied filters and markers.
1825
1829
  */
1826
1830
  function filterFromRemoteByValue(optionUrl, value, openPopper) {
1827
1831
  return new Processing(() => {
@@ -104,7 +104,7 @@ class ToggleSwitch extends CustomControl {
104
104
  off: "off",
105
105
  },
106
106
  labels: {
107
- toggleSwitchOn: "✔��",
107
+ toggleSwitchOn: "",
108
108
  toggleSwitchOff: "×",
109
109
  },
110
110
  templates: {
@@ -625,9 +625,12 @@ function show(element) {
625
625
  if (id === reference) {
626
626
  node.classList.add("active");
627
627
 
628
- const openDelay = parseInt(this.getOption("features.openDelay"), 10);
628
+ const openDelay = Number.parseInt(
629
+ this.getOption("features.openDelay"),
630
+ 10,
631
+ );
629
632
 
630
- if (!isNaN(openDelay) && openDelay > 0) {
633
+ if (!Number.isNaN(openDelay) && openDelay > 0) {
631
634
  node.style.visibility = "hidden";
632
635
 
633
636
  setTimeout(() => {
@@ -31,7 +31,7 @@ const internal = Symbol("internal");
31
31
  */
32
32
 
33
33
  /**
34
- * You can create an object via the monster namespace `new Monster.Types.MediaType()`.
34
+ * You can create an object via the monster namespace `new MediaType()`.
35
35
  *
36
36
  * @license AGPLv3
37
37
  * @since 1.8.0
@@ -42,7 +42,7 @@ class MediaType extends Base {
42
42
  *
43
43
  * @param {String} type
44
44
  * @param {String} subtype
45
- * @param {Monster.Types.Parameter[]} parameter
45
+ * @param {Parameter[]} parameter
46
46
  */
47
47
  constructor(type, subtype, parameter) {
48
48
  super();
@@ -82,7 +82,7 @@ class MediaType extends Base {
82
82
  }
83
83
 
84
84
  // /**
85
- // * @return {Monster.Types.Parameter[]}
85
+ // * @return {Parameter[]}
86
86
  // */
87
87
  // get parameter() {
88
88
  // return this[internal].parameter;
@@ -127,12 +127,12 @@ class MediaType extends Base {
127
127
  }
128
128
 
129
129
  /**
130
- * You can call the function via the monster namespace `Monster.Types.parseMediaType()`.
130
+ * You can call the function via the monster namespace `parseMediaType()`.
131
131
  *
132
132
  * ```
133
133
  * <script type="module">
134
134
  * import {Monster} from '@schukai/monster/source/monster.mjs';
135
- * console.log(Monster.Types.parseMediaType())
135
+ * console.log(parseMediaType())
136
136
  * </script>
137
137
  * ```
138
138
  *
@@ -155,7 +155,7 @@ class MediaType extends Base {
155
155
  * ```
156
156
  *
157
157
  * @param {String} mediatype
158
- * @return {Monster.Types.MediaType}
158
+ * @return {MediaType}
159
159
  * @see https://datatracker.ietf.org/doc/html/rfc2045#section-5.1
160
160
  * @throws {TypeError} the mimetype can not be parsed
161
161
  * @throws {TypeError} blank value is not allowed
@@ -187,7 +187,7 @@ function parseMediaType(mediatype) {
187
187
  * @license AGPLv3
188
188
  * @since 1.18.0
189
189
  * @param {String} parameter
190
- * @return {Monster.Types.Parameter[]|undefined}
190
+ * @return {Parameter[]|undefined}
191
191
  */
192
192
  function parseParameter(parameter) {
193
193
  if (!isString(parameter)) {
@@ -167,14 +167,12 @@ describe('Select', function () {
167
167
  expect(optionHtml).contain.html('data-monster-insert-reference="options-1"');
168
168
  expect(optionHtml).contain.html('data-monster-insert-reference="options-2"');
169
169
  expect(optionHtml).contain.not.html('data-monster-insert-reference="options-3"');
170
+ done();
170
171
 
171
172
  } catch (e) {
172
173
  done(e)
173
- return;
174
- }
175
-
176
- done();
177
174
 
175
+ }
178
176
  }, 100)
179
177
  })
180
178
 
@@ -222,4 +220,4 @@ describe('Select', function () {
222
220
  });
223
221
 
224
222
 
225
- });
223
+ });