@schukai/monster 3.86.0 → 3.86.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (27) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/package.json +1 -1
  3. package/source/components/content/copy.mjs +357 -359
  4. package/source/components/datatable/columnbar.mjs +5 -8
  5. package/source/components/datatable/datasource/dom.mjs +0 -1
  6. package/source/components/datatable/datatable.mjs +741 -741
  7. package/source/components/datatable/style/column-bar.pcss +27 -19
  8. package/source/components/datatable/style/datatable.pcss +6 -1
  9. package/source/components/datatable/stylesheet/column-bar.mjs +1 -1
  10. package/source/components/datatable/stylesheet/datatable.mjs +14 -7
  11. package/source/components/datatable/util.mjs +0 -1
  12. package/source/components/form/button-bar.mjs +1 -3
  13. package/source/components/form/style/field-set.pcss +41 -56
  14. package/source/components/form/stylesheet/button-bar.mjs +13 -6
  15. package/source/components/form/stylesheet/button.mjs +13 -6
  16. package/source/components/form/stylesheet/confirm-button.mjs +13 -6
  17. package/source/components/form/stylesheet/field-set.mjs +1 -1
  18. package/source/components/form/stylesheet/message-state-button.mjs +13 -6
  19. package/source/components/form/stylesheet/popper-button.mjs +13 -6
  20. package/source/components/form/stylesheet/select.mjs +13 -6
  21. package/source/components/form/stylesheet/state-button.mjs +13 -6
  22. package/source/components/layout/details.mjs +2 -2
  23. package/source/components/layout/stylesheet/panel.mjs +13 -6
  24. package/source/types/version.mjs +1 -1
  25. package/test/cases/monster.mjs +1 -1
  26. package/test/web/test.html +2 -2
  27. package/test/web/tests.js +192 -270
@@ -12,28 +12,28 @@
12
12
  * SPDX-License-Identifier: AGPL-3.0
13
13
  */
14
14
 
15
- import {instanceSymbol} from "../../constants.mjs";
15
+ import { instanceSymbol } from "../../constants.mjs";
16
16
  import {
17
- addAttributeToken,
18
- removeAttributeToken,
17
+ addAttributeToken,
18
+ removeAttributeToken,
19
19
  } from "../../dom/attributes.mjs";
20
20
  import {
21
- ATTRIBUTE_ERRORMESSAGE,
22
- ATTRIBUTE_ROLE,
21
+ ATTRIBUTE_ERRORMESSAGE,
22
+ ATTRIBUTE_ROLE,
23
23
  } from "../../dom/constants.mjs";
24
- import {CustomElement} from "../../dom/customelement.mjs";
24
+ import { CustomElement } from "../../dom/customelement.mjs";
25
25
  import {
26
- assembleMethodSymbol,
27
- registerCustomElement,
26
+ assembleMethodSymbol,
27
+ registerCustomElement,
28
28
  } from "../../dom/customelement.mjs";
29
- import {getDocument} from "../../dom/util.mjs";
30
- import {STYLE_DISPLAY_MODE_BLOCK} from "../form/constants.mjs";
31
- import {CopyStyleSheet} from "./stylesheet/copy.mjs";
32
- import {fireCustomEvent} from "../../dom/events.mjs";
33
- import {positionPopper} from "../form/util/floating-ui.mjs";
34
- import {DeadMansSwitch} from "../../util/deadmansswitch.mjs";
29
+ import { getDocument } from "../../dom/util.mjs";
30
+ import { STYLE_DISPLAY_MODE_BLOCK } from "../form/constants.mjs";
31
+ import { CopyStyleSheet } from "./stylesheet/copy.mjs";
32
+ import { fireCustomEvent } from "../../dom/events.mjs";
33
+ import { positionPopper } from "../form/util/floating-ui.mjs";
34
+ import { DeadMansSwitch } from "../../util/deadmansswitch.mjs";
35
35
 
36
- export {Copy};
36
+ export { Copy };
37
37
 
38
38
  /**
39
39
  * @private
@@ -91,265 +91,263 @@ const resizeObserverSymbol = Symbol("resizeObserver");
91
91
  * @summary A beautiful Copy that can make your life easier and also looks good.
92
92
  */
93
93
  class Copy extends CustomElement {
94
- /**
95
- * This method is called by the `instanceof` operator.
96
- * @return {symbol}
97
- */
98
- static get [instanceSymbol]() {
99
- return Symbol.for("@schukai/monster/components/content/copy@@instance");
100
- }
101
-
102
- /**
103
- *
104
- * @return {Components.Content.Copy
105
- * @fires monster-copy-clicked This event is fired when the copy button is clicked.
106
- * @fires monster-copy-success This event is fired when the copy action is successful.
107
- * @fires monster-copy-error This event is fired when the copy action fails.
108
- */
109
- [assembleMethodSymbol]() {
110
- super[assembleMethodSymbol]();
111
- initControlReferences.call(this);
112
- initEventHandler.call(this);
113
- return this;
114
- }
115
-
116
- /**
117
- * This method is called when the element is connected to the dom.
118
- *
119
- * @return {void}
120
- */
121
- connectedCallback() {
122
- super.connectedCallback();
123
-
124
- const document = getDocument();
125
-
126
- for (const [, type] of Object.entries(["click", "touch"])) {
127
- // close on outside ui-events
128
- document.addEventListener(type, this[closeEventHandler]);
129
- }
130
-
131
- updatePopper.call(this);
132
- attachResizeObserver.call(this);
133
- }
134
-
135
- /**
136
- * This method is called when the element is disconnected from the dom.
137
- *
138
- * @return {void}
139
- */
140
- disconnectedCallback() {
141
- super.disconnectedCallback();
142
-
143
- // close on outside ui-events
144
- for (const [, type] of Object.entries(["click", "touch"])) {
145
- document.removeEventListener(type, this[closeEventHandler]);
146
- }
147
-
148
- disconnectResizeObserver.call(this);
149
- }
150
-
151
- /**
152
- * To set the options via the HTML Tag, the attribute `data-monster-options` must be used.
153
- * @see {@link https://monsterjs.org/en/doc/#configurate-a-monster-control}
154
- *
155
- * The individual configuration values can be found in the table.
156
- *
157
- * @property {Object} templates Template definitions
158
- * @property {string} templates.main Main template
159
- * @property {Object} actions Callbacks
160
- * @property {string} actions.click="throw Error" Callback when clicked
161
- * @property {Object} features Features
162
- * @property {boolean} features.stripTags=true Strip tags from the copied text
163
- * @property {boolean} features.preventOpenEventSent=false Prevent open event from being sent
164
- * @property {Object} popper Popper configuration
165
- * @property {string} popper.placement="top" Popper placement
166
- * @property {string[]} popper.middleware=["autoPlacement", "shift", "offset:15", "arrow"] Popper middleware
167
- * @property {boolean} disabled=false Disabled state
168
- */
169
- get defaults() {
170
- return Object.assign({}, super.defaults, {
171
- templates: {
172
- main: getTemplate(),
173
- },
174
- disabled: false,
175
- features: {
176
- stripTags: true,
177
- preventOpenEventSent: false,
178
- },
179
- popper: {
180
- placement: "top",
181
- middleware: ["autoPlacement", "offset:-1", "arrow"],
182
- },
183
- });
184
- }
185
-
186
- /**
187
- * @return {string}
188
- */
189
- static getTag() {
190
- return "monster-copy";
191
- }
192
-
193
- /**
194
- * @return {CSSStyleSheet[]}
195
- */
196
- static getCSSStyleSheet() {
197
- return [CopyStyleSheet];
198
- }
199
-
200
- /**
201
- * With this method, you can show the popper.
202
- *
203
- * @return {Copy}
204
- */
205
- showDialog() {
206
- if (this[timerDelaySymbol] instanceof DeadMansSwitch) {
207
- try {
208
- this[timerDelaySymbol].defuse();
209
- } catch (e) {
210
- }
211
- }
212
-
213
- this[timerDelaySymbol] = new DeadMansSwitch(500, () => {
214
- show.call(this);
215
- });
216
-
217
- return this;
218
- }
219
-
220
- /**
221
- * With this method, you can hide the popper.
222
- *
223
- * @return {Copy}
224
- */
225
- hideDialog() {
226
- if (this[timerDelaySymbol] instanceof DeadMansSwitch) {
227
- try {
228
- this[timerDelaySymbol].defuse();
229
- } catch (e) {
230
- }
231
- }
232
-
233
- hide.call(this);
234
- return this;
235
- }
236
-
237
- /**
238
- * With this method, you can toggle the popper.
239
- *
240
- * @return {Copy}
241
- */
242
- toggleDialog() {
243
- if (this[popperElementSymbol].style.display === STYLE_DISPLAY_MODE_BLOCK) {
244
- this.hideDialog();
245
- } else {
246
- this.showDialog();
247
- }
248
- return this;
249
- }
94
+ /**
95
+ * This method is called by the `instanceof` operator.
96
+ * @return {symbol}
97
+ */
98
+ static get [instanceSymbol]() {
99
+ return Symbol.for("@schukai/monster/components/content/copy@@instance");
100
+ }
101
+
102
+ /**
103
+ *
104
+ * @return {Components.Content.Copy
105
+ * @fires monster-copy-clicked This event is fired when the copy button is clicked.
106
+ * @fires monster-copy-success This event is fired when the copy action is successful.
107
+ * @fires monster-copy-error This event is fired when the copy action fails.
108
+ */
109
+ [assembleMethodSymbol]() {
110
+ super[assembleMethodSymbol]();
111
+ initControlReferences.call(this);
112
+ initEventHandler.call(this);
113
+ return this;
114
+ }
115
+
116
+ /**
117
+ * This method is called when the element is connected to the dom.
118
+ *
119
+ * @return {void}
120
+ */
121
+ connectedCallback() {
122
+ super.connectedCallback();
123
+
124
+ const document = getDocument();
125
+
126
+ for (const [, type] of Object.entries(["click", "touch"])) {
127
+ // close on outside ui-events
128
+ document.addEventListener(type, this[closeEventHandler]);
129
+ }
130
+
131
+ updatePopper.call(this);
132
+ attachResizeObserver.call(this);
133
+ }
134
+
135
+ /**
136
+ * This method is called when the element is disconnected from the dom.
137
+ *
138
+ * @return {void}
139
+ */
140
+ disconnectedCallback() {
141
+ super.disconnectedCallback();
142
+
143
+ // close on outside ui-events
144
+ for (const [, type] of Object.entries(["click", "touch"])) {
145
+ document.removeEventListener(type, this[closeEventHandler]);
146
+ }
147
+
148
+ disconnectResizeObserver.call(this);
149
+ }
150
+
151
+ /**
152
+ * To set the options via the HTML Tag, the attribute `data-monster-options` must be used.
153
+ * @see {@link https://monsterjs.org/en/doc/#configurate-a-monster-control}
154
+ *
155
+ * The individual configuration values can be found in the table.
156
+ *
157
+ * @property {Object} templates Template definitions
158
+ * @property {string} templates.main Main template
159
+ * @property {Object} actions Callbacks
160
+ * @property {string} actions.click="throw Error" Callback when clicked
161
+ * @property {Object} features Features
162
+ * @property {boolean} features.stripTags=true Strip tags from the copied text
163
+ * @property {boolean} features.preventOpenEventSent=false Prevent open event from being sent
164
+ * @property {Object} popper Popper configuration
165
+ * @property {string} popper.placement="top" Popper placement
166
+ * @property {string[]} popper.middleware=["autoPlacement", "shift", "offset:15", "arrow"] Popper middleware
167
+ * @property {boolean} disabled=false Disabled state
168
+ */
169
+ get defaults() {
170
+ return Object.assign({}, super.defaults, {
171
+ templates: {
172
+ main: getTemplate(),
173
+ },
174
+ disabled: false,
175
+ features: {
176
+ stripTags: true,
177
+ preventOpenEventSent: false,
178
+ },
179
+ popper: {
180
+ placement: "top",
181
+ middleware: ["autoPlacement", "offset:-1", "arrow"],
182
+ },
183
+ });
184
+ }
185
+
186
+ /**
187
+ * @return {string}
188
+ */
189
+ static getTag() {
190
+ return "monster-copy";
191
+ }
192
+
193
+ /**
194
+ * @return {CSSStyleSheet[]}
195
+ */
196
+ static getCSSStyleSheet() {
197
+ return [CopyStyleSheet];
198
+ }
199
+
200
+ /**
201
+ * With this method, you can show the popper.
202
+ *
203
+ * @return {Copy}
204
+ */
205
+ showDialog() {
206
+ if (this[timerDelaySymbol] instanceof DeadMansSwitch) {
207
+ try {
208
+ this[timerDelaySymbol].defuse();
209
+ } catch (e) {}
210
+ }
211
+
212
+ this[timerDelaySymbol] = new DeadMansSwitch(500, () => {
213
+ show.call(this);
214
+ });
215
+
216
+ return this;
217
+ }
218
+
219
+ /**
220
+ * With this method, you can hide the popper.
221
+ *
222
+ * @return {Copy}
223
+ */
224
+ hideDialog() {
225
+ if (this[timerDelaySymbol] instanceof DeadMansSwitch) {
226
+ try {
227
+ this[timerDelaySymbol].defuse();
228
+ } catch (e) {}
229
+ }
230
+
231
+ hide.call(this);
232
+ return this;
233
+ }
234
+
235
+ /**
236
+ * With this method, you can toggle the popper.
237
+ *
238
+ * @return {Copy}
239
+ */
240
+ toggleDialog() {
241
+ if (this[popperElementSymbol].style.display === STYLE_DISPLAY_MODE_BLOCK) {
242
+ this.hideDialog();
243
+ } else {
244
+ this.showDialog();
245
+ }
246
+ return this;
247
+ }
250
248
  }
251
249
 
252
250
  /**
253
251
  * @private
254
252
  */
255
253
  function attachResizeObserver() {
256
- // against flickering
257
- this[resizeObserverSymbol] = new ResizeObserver((entries) => {
258
- if (this[timerCallbackSymbol] instanceof DeadMansSwitch) {
259
- try {
260
- this[timerCallbackSymbol].touch();
261
- return;
262
- } catch (e) {
263
- delete this[timerCallbackSymbol];
264
- }
265
- }
266
-
267
- this[timerCallbackSymbol] = new DeadMansSwitch(200, () => {
268
- updatePopper.call(this);
269
- });
270
- });
271
-
272
- this[resizeObserverSymbol].observe(this.parentElement);
254
+ // against flickering
255
+ this[resizeObserverSymbol] = new ResizeObserver((entries) => {
256
+ if (this[timerCallbackSymbol] instanceof DeadMansSwitch) {
257
+ try {
258
+ this[timerCallbackSymbol].touch();
259
+ return;
260
+ } catch (e) {
261
+ delete this[timerCallbackSymbol];
262
+ }
263
+ }
264
+
265
+ this[timerCallbackSymbol] = new DeadMansSwitch(200, () => {
266
+ updatePopper.call(this);
267
+ });
268
+ });
269
+
270
+ this[resizeObserverSymbol].observe(this.parentElement);
273
271
  }
274
272
 
275
273
  /**
276
274
  * @private
277
275
  */
278
276
  function disconnectResizeObserver() {
279
- if (this[resizeObserverSymbol] instanceof ResizeObserver) {
280
- this[resizeObserverSymbol].disconnect();
281
- }
277
+ if (this[resizeObserverSymbol] instanceof ResizeObserver) {
278
+ this[resizeObserverSymbol].disconnect();
279
+ }
282
280
  }
283
281
 
284
282
  /**
285
283
  * @private
286
284
  */
287
285
  function hide() {
288
- const self = this;
286
+ const self = this;
289
287
 
290
- fireCustomEvent(self, "monster-popper-hide", {
291
- self,
292
- });
288
+ fireCustomEvent(self, "monster-popper-hide", {
289
+ self,
290
+ });
293
291
 
294
- self[popperElementSymbol].style.display = "none";
295
- removeAttributeToken(self[controlElementSymbol], "class", "open");
292
+ self[popperElementSymbol].style.display = "none";
293
+ removeAttributeToken(self[controlElementSymbol], "class", "open");
296
294
 
297
- setTimeout(() => {
298
- fireCustomEvent(self, "monster-popper-hidden", {
299
- self,
300
- });
301
- }, 0);
295
+ setTimeout(() => {
296
+ fireCustomEvent(self, "monster-popper-hidden", {
297
+ self,
298
+ });
299
+ }, 0);
302
300
  }
303
301
 
304
302
  /**
305
303
  * @private
306
304
  */
307
305
  function show() {
308
- const self = this;
306
+ const self = this;
309
307
 
310
- if (self.getOption("disabled", false) === true) {
311
- return;
312
- }
308
+ if (self.getOption("disabled", false) === true) {
309
+ return;
310
+ }
313
311
 
314
- if (self[popperElementSymbol].style.display === STYLE_DISPLAY_MODE_BLOCK) {
315
- return;
316
- }
312
+ if (self[popperElementSymbol].style.display === STYLE_DISPLAY_MODE_BLOCK) {
313
+ return;
314
+ }
317
315
 
318
- fireCustomEvent(self, "monster-popper-open", {
319
- self,
320
- });
316
+ fireCustomEvent(self, "monster-popper-open", {
317
+ self,
318
+ });
321
319
 
322
- self[popperElementSymbol].style.visibility = "hidden";
323
- self[popperElementSymbol].style.display = STYLE_DISPLAY_MODE_BLOCK;
320
+ self[popperElementSymbol].style.visibility = "hidden";
321
+ self[popperElementSymbol].style.display = STYLE_DISPLAY_MODE_BLOCK;
324
322
 
325
- addAttributeToken(self[controlElementSymbol], "class", "open");
326
- updatePopper.call(self);
323
+ addAttributeToken(self[controlElementSymbol], "class", "open");
324
+ updatePopper.call(self);
327
325
 
328
- setTimeout(() => {
329
- fireCustomEvent(self, "monster-popper-opened", {
330
- self,
331
- });
332
- }, 0);
326
+ setTimeout(() => {
327
+ fireCustomEvent(self, "monster-popper-opened", {
328
+ self,
329
+ });
330
+ }, 0);
333
331
  }
334
332
 
335
333
  /**
336
334
  * @private
337
335
  */
338
336
  function updatePopper() {
339
- if (this[popperElementSymbol].style.display !== STYLE_DISPLAY_MODE_BLOCK) {
340
- return;
341
- }
342
-
343
- if (this.getOption("disabled", false) === true) {
344
- return;
345
- }
346
-
347
- positionPopper.call(
348
- this,
349
- this[controlElementSymbol],
350
- this[popperElementSymbol],
351
- this.getOption("popper", {}),
352
- );
337
+ if (this[popperElementSymbol].style.display !== STYLE_DISPLAY_MODE_BLOCK) {
338
+ return;
339
+ }
340
+
341
+ if (this.getOption("disabled", false) === true) {
342
+ return;
343
+ }
344
+
345
+ positionPopper.call(
346
+ this,
347
+ this[controlElementSymbol],
348
+ this[popperElementSymbol],
349
+ this.getOption("popper", {}),
350
+ );
353
351
  }
354
352
 
355
353
  /**
@@ -357,90 +355,90 @@ function updatePopper() {
357
355
  * @return {initEventHandler}
358
356
  */
359
357
  function initEventHandler() {
360
- const self = this;
361
-
362
- this[closeEventHandler] = (event) => {
363
- const path = event.composedPath();
364
-
365
- for (const [, element] of Object.entries(path)) {
366
- if (element === this) {
367
- return;
368
- }
369
- }
370
- hide.call(this);
371
- };
372
-
373
- const type = "click";
374
-
375
- this[controlElementSymbol].addEventListener("mouseenter", (event) => {
376
- if (this.getOption("features.preventOpenEventSent") === true) {
377
- event.preventDefault();
378
- }
379
- this.showDialog();
380
- });
381
-
382
- this[controlElementSymbol].addEventListener("mouseleave", (event) => {
383
- if (this.getOption("features.preventOpenEventSent") === true) {
384
- event.preventDefault();
385
- }
386
- this.hideDialog();
387
- });
388
-
389
- this[controlElementSymbol].addEventListener("focus", (event) => {
390
- if (this.getOption("features.preventOpenEventSent") === true) {
391
- event.preventDefault();
392
- }
393
- this.showDialog();
394
- });
395
- this[controlElementSymbol].addEventListener("blur", (event) => {
396
- if (this.getOption("features.preventOpenEventSent") === true) {
397
- event.preventDefault();
398
- }
399
- this.hideDialog();
400
- });
401
-
402
- this[copyButtonElementSymbol].addEventListener(type, function (event) {
403
- fireCustomEvent(self, "monster-copy-clicked", {
404
- element: self,
405
- });
406
-
407
- const text = getSlottedCopyContent.call(self);
408
-
409
- navigator.clipboard
410
- .writeText(text)
411
- .then(function () {
412
- self[copyButtonElementSymbol]
413
- .querySelector("use")
414
- .setAttribute("href", "#copy-success");
415
- setTimeout(() => {
416
- self[copyButtonElementSymbol]
417
- .querySelector("use")
418
- .setAttribute("href", "#copy");
419
- }, 2000);
420
-
421
- fireCustomEvent(self, "monster-copy-success", {
422
- element: self,
423
- });
424
- })
425
- .catch(function (e) {
426
- self[copyButtonElementSymbol]
427
- .querySelector("use")
428
- .setAttribute("href", "#copy-error");
429
- setTimeout(() => {
430
- self[copyButtonElementSymbol]
431
- .querySelector("use")
432
- .setAttribute("href", "#copy");
433
- }, 2000);
434
-
435
- fireCustomEvent(self, "monster-copy-error", {
436
- element: self,
437
- });
438
-
439
- addAttributeToken(self, ATTRIBUTE_ERRORMESSAGE, "" + e);
440
- });
441
- });
442
-
443
- return this;
358
+ const self = this;
359
+
360
+ this[closeEventHandler] = (event) => {
361
+ const path = event.composedPath();
362
+
363
+ for (const [, element] of Object.entries(path)) {
364
+ if (element === this) {
365
+ return;
366
+ }
367
+ }
368
+ hide.call(this);
369
+ };
370
+
371
+ const type = "click";
372
+
373
+ this[controlElementSymbol].addEventListener("mouseenter", (event) => {
374
+ if (this.getOption("features.preventOpenEventSent") === true) {
375
+ event.preventDefault();
376
+ }
377
+ this.showDialog();
378
+ });
379
+
380
+ this[controlElementSymbol].addEventListener("mouseleave", (event) => {
381
+ if (this.getOption("features.preventOpenEventSent") === true) {
382
+ event.preventDefault();
383
+ }
384
+ this.hideDialog();
385
+ });
386
+
387
+ this[controlElementSymbol].addEventListener("focus", (event) => {
388
+ if (this.getOption("features.preventOpenEventSent") === true) {
389
+ event.preventDefault();
390
+ }
391
+ this.showDialog();
392
+ });
393
+ this[controlElementSymbol].addEventListener("blur", (event) => {
394
+ if (this.getOption("features.preventOpenEventSent") === true) {
395
+ event.preventDefault();
396
+ }
397
+ this.hideDialog();
398
+ });
399
+
400
+ this[copyButtonElementSymbol].addEventListener(type, function (event) {
401
+ fireCustomEvent(self, "monster-copy-clicked", {
402
+ element: self,
403
+ });
404
+
405
+ const text = getSlottedCopyContent.call(self);
406
+
407
+ navigator.clipboard
408
+ .writeText(text)
409
+ .then(function () {
410
+ self[copyButtonElementSymbol]
411
+ .querySelector("use")
412
+ .setAttribute("href", "#copy-success");
413
+ setTimeout(() => {
414
+ self[copyButtonElementSymbol]
415
+ .querySelector("use")
416
+ .setAttribute("href", "#copy");
417
+ }, 2000);
418
+
419
+ fireCustomEvent(self, "monster-copy-success", {
420
+ element: self,
421
+ });
422
+ })
423
+ .catch(function (e) {
424
+ self[copyButtonElementSymbol]
425
+ .querySelector("use")
426
+ .setAttribute("href", "#copy-error");
427
+ setTimeout(() => {
428
+ self[copyButtonElementSymbol]
429
+ .querySelector("use")
430
+ .setAttribute("href", "#copy");
431
+ }, 2000);
432
+
433
+ fireCustomEvent(self, "monster-copy-error", {
434
+ element: self,
435
+ });
436
+
437
+ addAttributeToken(self, ATTRIBUTE_ERRORMESSAGE, "" + e);
438
+ });
439
+ });
440
+
441
+ return this;
444
442
  }
445
443
 
446
444
  /**
@@ -448,35 +446,35 @@ function initEventHandler() {
448
446
  * @returns {Set<any>|string}
449
447
  */
450
448
  function getSlottedCopyContent() {
451
- const self = this;
452
- const result = new Set();
453
-
454
- if (!(this.shadowRoot instanceof ShadowRoot)) {
455
- return result;
456
- }
457
-
458
- const slots = this.shadowRoot.querySelectorAll("slot");
459
-
460
- let text = "";
461
- for (const [, slot] of Object.entries(slots)) {
462
- slot.assignedNodes().forEach(function (node) {
463
- if (
464
- node instanceof HTMLElement ||
465
- node instanceof SVGElement ||
466
- node instanceof MathMLElement
467
- ) {
468
- if (self.getOption("features.stripTags")) {
469
- text += node.textContent.trim();
470
- } else {
471
- text += node.outerHTML.trim();
472
- }
473
- } else {
474
- text += node.textContent.trim();
475
- }
476
- });
477
- }
478
-
479
- return text;
449
+ const self = this;
450
+ const result = new Set();
451
+
452
+ if (!(this.shadowRoot instanceof ShadowRoot)) {
453
+ return result;
454
+ }
455
+
456
+ const slots = this.shadowRoot.querySelectorAll("slot");
457
+
458
+ let text = "";
459
+ for (const [, slot] of Object.entries(slots)) {
460
+ slot.assignedNodes().forEach(function (node) {
461
+ if (
462
+ node instanceof HTMLElement ||
463
+ node instanceof SVGElement ||
464
+ node instanceof MathMLElement
465
+ ) {
466
+ if (self.getOption("features.stripTags")) {
467
+ text += node.textContent.trim();
468
+ } else {
469
+ text += node.outerHTML.trim();
470
+ }
471
+ } else {
472
+ text += node.textContent.trim();
473
+ }
474
+ });
475
+ }
476
+
477
+ return text;
480
478
  }
481
479
 
482
480
  /**
@@ -484,17 +482,17 @@ function getSlottedCopyContent() {
484
482
  * @return {void}
485
483
  */
486
484
  function initControlReferences() {
487
- this[controlElementSymbol] = this.shadowRoot.querySelector(
488
- `[${ATTRIBUTE_ROLE}="control"]`,
489
- );
485
+ this[controlElementSymbol] = this.shadowRoot.querySelector(
486
+ `[${ATTRIBUTE_ROLE}="control"]`,
487
+ );
490
488
 
491
- this[copyButtonElementSymbol] = this.shadowRoot.querySelector(
492
- `[${ATTRIBUTE_ROLE}="button"]`,
493
- );
489
+ this[copyButtonElementSymbol] = this.shadowRoot.querySelector(
490
+ `[${ATTRIBUTE_ROLE}="button"]`,
491
+ );
494
492
 
495
- this[popperElementSymbol] = this.shadowRoot.querySelector(
496
- `[${ATTRIBUTE_ROLE}="popper"]`,
497
- );
493
+ this[popperElementSymbol] = this.shadowRoot.querySelector(
494
+ `[${ATTRIBUTE_ROLE}="popper"]`,
495
+ );
498
496
  }
499
497
 
500
498
  /**
@@ -502,8 +500,8 @@ function initControlReferences() {
502
500
  * @return {string}
503
501
  */
504
502
  function getTemplate() {
505
- // language=HTML
506
- return `
503
+ // language=HTML
504
+ return `
507
505
  <div data-monster-role="control" part="control">
508
506
  <slot></slot>
509
507
  <div data-monster-role="popper" part="popper" tabindex="-1" class="monster-color-primary-1">