@schukai/monster 3.54.0 → 3.55.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/package.json +1 -1
  3. package/source/components/datatable/datasource/rest.mjs +358 -309
  4. package/source/components/datatable/datatable/header.mjs +8 -0
  5. package/source/components/datatable/datatable.mjs +606 -557
  6. package/source/components/datatable/embedded-pagination.mjs +50 -62
  7. package/source/components/datatable/filter/util.mjs +122 -0
  8. package/source/components/datatable/filter.mjs +893 -708
  9. package/source/components/datatable/pagination.mjs +335 -310
  10. package/source/components/datatable/status.mjs +248 -0
  11. package/source/components/datatable/style/datatable.pcss +1 -0
  12. package/source/components/datatable/style/embedded-pagination.pcss +59 -2
  13. package/source/components/datatable/style/filter.pcss +4 -0
  14. package/source/components/datatable/style/pagination.pcss +28 -4
  15. package/source/components/datatable/style/status.pcss +42 -0
  16. package/source/components/datatable/stylesheet/column-bar.mjs +1 -1
  17. package/source/components/datatable/stylesheet/datatable.mjs +1 -1
  18. package/source/components/datatable/stylesheet/filter-button.mjs +1 -1
  19. package/source/components/datatable/stylesheet/filter.mjs +1 -1
  20. package/source/components/datatable/stylesheet/pagination.mjs +1 -1
  21. package/source/components/datatable/stylesheet/status.mjs +27 -0
  22. package/source/components/form/action-button.mjs +1 -1
  23. package/source/components/form/api-button.mjs +1 -1
  24. package/source/components/form/button-bar.mjs +1 -1
  25. package/source/components/form/button.mjs +1 -1
  26. package/source/components/form/confirm-button.mjs +1 -1
  27. package/source/components/form/context-error.mjs +275 -0
  28. package/source/components/form/context-help.mjs +5 -5
  29. package/source/components/form/form.mjs +2 -2
  30. package/source/components/form/message-state-button.mjs +2 -2
  31. package/source/components/form/popper-button.mjs +7 -4
  32. package/source/components/form/popper.mjs +317 -309
  33. package/source/components/form/reload.mjs +1 -1
  34. package/source/components/form/select.mjs +1 -1
  35. package/source/components/form/shadow-reload.mjs +1 -1
  36. package/source/components/form/state-button.mjs +2 -1
  37. package/source/components/form/style/context-error.pcss +32 -0
  38. package/source/components/form/style/context-help.pcss +22 -5
  39. package/source/components/form/stylesheet/context-error.mjs +27 -0
  40. package/source/components/form/stylesheet/context-help.mjs +1 -1
  41. package/source/components/form/stylesheet/select.mjs +1 -1
  42. package/source/components/form/stylesheet/tabs.mjs +1 -1
  43. package/source/components/form/tabs.mjs +757 -707
  44. package/source/components/form/template.mjs +1 -1
  45. package/source/components/form/tree-select.mjs +1 -1
  46. package/source/components/host/collapse.mjs +22 -5
  47. package/source/components/host/config-manager.mjs +39 -2
  48. package/source/components/host/host.mjs +14 -0
  49. package/source/components/host/stylesheet/call-button.mjs +1 -1
  50. package/source/components/host/stylesheet/overlay.mjs +1 -1
  51. package/source/components/host/stylesheet/toggle-button.mjs +1 -1
  52. package/source/components/host/util.mjs +6 -1
  53. package/source/components/notify/stylesheet/message.mjs +1 -1
  54. package/source/components/stylesheet/icons.mjs +1 -1
  55. package/source/data/transformer.mjs +39 -42
  56. package/source/dom/customelement.mjs +1 -1
  57. package/source/dom/updater.mjs +700 -688
  58. package/source/dom/util.mjs +42 -0
  59. package/source/i18n/providers/embed.mjs +3 -3
  60. package/source/monster.mjs +6 -0
  61. package/source/text/formatter.mjs +2 -2
  62. package/source/types/observer.mjs +1 -1
  63. package/source/types/version.mjs +1 -1
  64. package/source/util/sleep.mjs +18 -0
  65. package/test/cases/components/form/button.mjs +2 -1
  66. package/test/cases/components/form/select.mjs +1 -1
  67. package/test/cases/components/form/tree-select.mjs +1 -1
  68. package/test/cases/data/transformer.mjs +2 -2
  69. package/test/cases/dom/updater.mjs +67 -46
  70. package/test/cases/monster.mjs +1 -1
  71. package/test/web/test.html +2 -2
  72. package/test/web/tests.js +18 -13
@@ -4,27 +4,27 @@
4
4
  * This file is licensed under the AGPLv3 License.
5
5
  * License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
6
6
  */
7
- import { instanceSymbol } from "../../constants.mjs";
7
+ import {instanceSymbol} from "../../constants.mjs";
8
8
  import {
9
- addAttributeToken,
10
- removeAttributeToken,
9
+ addAttributeToken,
10
+ removeAttributeToken,
11
11
  } from "../../dom/attributes.mjs";
12
- import { ATTRIBUTE_ROLE } from "../../dom/constants.mjs";
12
+ import {ATTRIBUTE_ROLE} from "../../dom/constants.mjs";
13
13
  import {
14
- assembleMethodSymbol,
15
- registerCustomElement,
14
+ assembleMethodSymbol,
15
+ registerCustomElement,
16
16
  } from "../../dom/customelement.mjs";
17
- import { fireCustomEvent } from "../../dom/events.mjs";
18
- import { getDocument } from "../../dom/util.mjs";
19
- import { DeadMansSwitch } from "../../util/deadmansswitch.mjs";
20
- import { Button } from "./button.mjs";
21
- import { STYLE_DISPLAY_MODE_BLOCK } from "./constants.mjs";
22
- import { positionPopper } from "./util/floating-ui.mjs";
23
- import { CustomControl } from "../../dom/customcontrol.mjs";
24
- import { PopperStyleSheet } from "./stylesheet/popper.mjs";
25
- import { isArray } from "../../types/is.mjs";
26
-
27
- export { Popper };
17
+ import {fireCustomEvent} from "../../dom/events.mjs";
18
+ import {getDocument} from "../../dom/util.mjs";
19
+ import {DeadMansSwitch} from "../../util/deadmansswitch.mjs";
20
+ import {Button} from "./button.mjs";
21
+ import {STYLE_DISPLAY_MODE_BLOCK} from "./constants.mjs";
22
+ import {positionPopper} from "./util/floating-ui.mjs";
23
+ import {CustomControl} from "../../dom/customcontrol.mjs";
24
+ import {PopperStyleSheet} from "./stylesheet/popper.mjs";
25
+ import {isArray} from "../../types/is.mjs";
26
+
27
+ export {Popper};
28
28
 
29
29
  /**
30
30
  * @private
@@ -116,277 +116,285 @@ const arrowElementSymbol = Symbol("arrowElement");
116
116
  * @summary A popper button
117
117
  */
118
118
  class Popper extends CustomControl {
119
- /**
120
- * This method is called by the `instanceof` operator.
121
- * @returns {symbol}
122
- */
123
- static get [instanceSymbol]() {
124
- return Symbol.for("@schukai/component-form/popper@@instance");
125
- }
126
-
127
- /**
128
- * To set the options via the html tag the attribute `data-monster-options` must be used.
129
- * @see {@link https://monsterjs.org/en/doc/#configurate-a-monster-control}
130
- *
131
- * The individual configuration values can be found in the table.
132
- *
133
- * @property {Object} templates - The templates for the control.
134
- * @property {string} templates.main - The main template.
135
- * @property {string} mode - The mode of the popper. Possible values are `click`, `enter` `hover`, `manual`, `focus`, "auto" or a combination of them.
136
- * @property {string} content - The content of the popper.
137
- * @property {object} popper - The popper options.
138
- * @property {string} popper.placement - The placement of the popper. Possible values are `top`, `bottom`, `left` and `right`.
139
- * @property {Array<function>} popper.middleware - The middleware functions of the popper.
140
- * @property {Array<function>} popper.middlewareInit - The middleware init functions of the popper.
141
- * @property {Object} features - The features of the popper.
142
- * @property {boolean} features.preventPropagateOpenEvents - Prevents the open event from being sent.
143
- * @extends {Button}
144
- */
145
- get defaults() {
146
- return Object.assign({}, super.defaults, {
147
- templates: {
148
- main: getTemplate(),
149
- },
150
- mode: "hover focus",
151
- content: "<slot>Should I Stay or Should I Go?</slot>",
152
- popper: {
153
- placement: "top",
154
- middleware: ["autoPlacement", "offset:10", "arrow"],
155
- },
156
- features: {
157
- preventOpenEventSent: false,
158
- },
159
- });
160
- }
161
-
162
- /**
163
- *
164
- * @return {Monster.Components.Form.Popper}
165
- */
166
- [assembleMethodSymbol]() {
167
- super[assembleMethodSymbol]();
168
- initControlReferences.call(this);
169
- initEventhandler.call(this);
170
-
171
- return this;
172
- }
173
-
174
- /**
175
- * @return {string}
176
- */
177
- static getTag() {
178
- return "monster-popper";
179
- }
180
-
181
- /**
182
- * @return {Array<CSSStyleSheet>}
183
- */
184
- static getCSSStyleSheet() {
185
- return [PopperStyleSheet];
186
- }
187
-
188
- /**
189
- * @return {void}
190
- */
191
- connectedCallback() {
192
- super.connectedCallback();
193
-
194
- const document = getDocument();
195
-
196
- for (const [, type] of Object.entries(["click", "touch"])) {
197
- // close on outside ui-events
198
- document.addEventListener(type, this[closeEventHandler]);
199
- }
200
-
201
- updatePopper.call(this);
202
- attachResizeObserver.call(this);
203
- }
204
-
205
- /**
206
- * @return {void}
207
- */
208
- disconnectedCallback() {
209
- super.disconnectedCallback();
210
-
211
- // close on outside ui-events
212
- for (const [, type] of Object.entries(["click", "touch"])) {
213
- document.removeEventListener(type, this[closeEventHandler]);
214
- }
215
-
216
- disconnectResizeObserver.call(this);
217
- }
218
-
219
- /**
220
- *
221
- * @return {Monster.Components.Form.Popper}
222
- */
223
- showDialog() {
224
- show.call(this);
225
- return this;
226
- }
227
-
228
- /**
229
- *
230
- * @return {Monster.Components.Form.Popper}
231
- */
232
- hideDialog() {
233
- hide.call(this);
234
- return this;
235
- }
236
-
237
- /**
238
- *
239
- * @return {Monster.Components.Form.Popper}
240
- */
241
- toggleDialog() {
242
- if (this[popperElementSymbol].style.display === STYLE_DISPLAY_MODE_BLOCK) {
243
- this.hideDialog();
244
- } else {
245
- this.showDialog();
246
- }
247
- return this;
248
- }
119
+ /**
120
+ * This method is called by the `instanceof` operator.
121
+ * @returns {symbol}
122
+ */
123
+ static get [instanceSymbol]() {
124
+ return Symbol.for("@schukai/monster/components/form/popper@@instance");
125
+ }
126
+
127
+ /**
128
+ * To set the options via the html tag the attribute `data-monster-options` must be used.
129
+ * @see {@link https://monsterjs.org/en/doc/#configurate-a-monster-control}
130
+ *
131
+ * The individual configuration values can be found in the table.
132
+ *
133
+ * @property {Object} templates - The templates for the control.
134
+ * @property {string} templates.main - The main template.
135
+ * @property {string} mode - The mode of the popper. Possible values are `click`, `enter` `hover`, `manual`, `focus`, "auto" or a combination of them.
136
+ * @property {string} content - The content of the popper.
137
+ * @property {object} popper - The popper options.
138
+ * @property {string} popper.placement - The placement of the popper. Possible values are `top`, `bottom`, `left` and `right`.
139
+ * @property {Array<function>} popper.middleware - The middleware functions of the popper.
140
+ * @property {Array<function>} popper.middlewareInit - The middleware init functions of the popper.
141
+ * @property {Object} features - The features of the popper.
142
+ * @property {boolean} features.preventPropagateOpenEvents - Prevents the open event from being sent.
143
+ * @extends {Button}
144
+ */
145
+ get defaults() {
146
+ return Object.assign({}, super.defaults, {
147
+ templates: {
148
+ main: getTemplate(),
149
+ },
150
+ mode: "hover focus",
151
+ content: "<slot>Should I Stay or Should I Go?</slot>",
152
+ popper: {
153
+ placement: "top",
154
+ middleware: ["autoPlacement", "offset:10", "arrow"],
155
+ },
156
+ features: {
157
+ preventOpenEventSent: false,
158
+ },
159
+ });
160
+ }
161
+
162
+ /**
163
+ *
164
+ * @return {Monster.Components.Form.Popper}
165
+ */
166
+ [assembleMethodSymbol]() {
167
+ super[assembleMethodSymbol]();
168
+ initControlReferences.call(this);
169
+ initEventHandler.call(this);
170
+
171
+ return this;
172
+ }
173
+
174
+ /**
175
+ * @return {string}
176
+ */
177
+ static getTag() {
178
+ return "monster-popper";
179
+ }
180
+
181
+ /**
182
+ * @return {Array<CSSStyleSheet>}
183
+ */
184
+ static getCSSStyleSheet() {
185
+ return [PopperStyleSheet];
186
+ }
187
+
188
+ /**
189
+ * @return {void}
190
+ */
191
+ connectedCallback() {
192
+ super.connectedCallback();
193
+
194
+ const document = getDocument();
195
+
196
+ for (const [, type] of Object.entries(["click", "touch"])) {
197
+ // close on outside ui-events
198
+ document.addEventListener(type, this[closeEventHandler]);
199
+ }
200
+
201
+ updatePopper.call(this);
202
+ attachResizeObserver.call(this);
203
+ }
204
+
205
+ /**
206
+ * @return {void}
207
+ */
208
+ disconnectedCallback() {
209
+ super.disconnectedCallback();
210
+
211
+ // close on outside ui-events
212
+ for (const [, type] of Object.entries(["click", "touch"])) {
213
+ document.removeEventListener(type, this[closeEventHandler]);
214
+ }
215
+
216
+ disconnectResizeObserver.call(this);
217
+ }
218
+
219
+ /**
220
+ *
221
+ * @return {Monster.Components.Form.Popper}
222
+ */
223
+ showDialog() {
224
+ show.call(this);
225
+ return this;
226
+ }
227
+
228
+ /**
229
+ *
230
+ * @return {Monster.Components.Form.Popper}
231
+ */
232
+ hideDialog() {
233
+ hide.call(this);
234
+ return this;
235
+ }
236
+
237
+ /**
238
+ *
239
+ * @return {Monster.Components.Form.Popper}
240
+ */
241
+ toggleDialog() {
242
+ if (this[popperElementSymbol].style.display === STYLE_DISPLAY_MODE_BLOCK) {
243
+ this.hideDialog();
244
+ } else {
245
+ this.showDialog();
246
+ }
247
+ return this;
248
+ }
249
249
  }
250
250
 
251
251
  /**
252
252
  * @private
253
253
  * @return {Monster.Components.Form.Popper}
254
254
  */
255
- function initEventhandler() {
256
- this[closeEventHandler] = (event) => {
257
- const path = event.composedPath();
258
-
259
- for (const [, element] of Object.entries(path)) {
260
- if (element === this) {
261
- return;
262
- }
263
- }
264
- hide.call(this);
265
- };
266
-
267
- let modes = null;
268
- const modeOption = this.getOption("mode");
269
- if (typeof modeOption === "string") {
270
- modes = modeOption.split(" ");
271
- }
272
-
273
- if (
274
- modes === null ||
275
- modes === undefined ||
276
- isArray(modes) === false ||
277
- modes.length === 0
278
- ) {
279
- modes = ["manual"];
280
- }
281
-
282
- for (const [, mode] of Object.entries(modes)) {
283
- initEventHandlerByMode.call(this, mode);
284
- }
285
-
286
- return this;
255
+ function initEventHandler() {
256
+ this[closeEventHandler] = (event) => {
257
+ const path = event.composedPath();
258
+
259
+ for (const [, element] of Object.entries(path)) {
260
+ if (element === this) {
261
+ return;
262
+ }
263
+ }
264
+ hide.call(this);
265
+ };
266
+
267
+ let modes = null;
268
+ const modeOption = this.getOption("mode");
269
+ if (typeof modeOption === "string") {
270
+ modes = modeOption.split(" ");
271
+ }
272
+
273
+ if (
274
+ modes === null ||
275
+ modes === undefined ||
276
+ isArray(modes) === false ||
277
+ modes.length === 0
278
+ ) {
279
+ modes = ["manual"];
280
+ }
281
+
282
+ for (const [, mode] of Object.entries(modes)) {
283
+ initEventHandlerByMode.call(this, mode);
284
+ }
285
+
286
+ return this;
287
287
  }
288
288
 
289
+ /**
290
+ * @private
291
+ * @param mode
292
+ * @return {Monster.Components.Form.Popper}
293
+ * @throws Error
294
+ */
289
295
  function initEventHandlerByMode(mode) {
290
- switch (mode) {
291
- case "manual":
292
- break;
293
-
294
- case "focus":
295
- this[buttonElementSymbol].addEventListener("focus", (event) => {
296
- if (this.getOption("features.preventOpenEventSent") === true) {
297
- event.preventDefault();
298
- }
299
- this.showDialog();
300
- });
301
- this[buttonElementSymbol].addEventListener("blur", (event) => {
302
- if (this.getOption("features.preventOpenEventSent") === true) {
303
- event.preventDefault();
304
- }
305
- this.hideDialog();
306
- });
307
- break;
308
-
309
- case "click":
310
- this[buttonElementSymbol].addEventListener("click", (event) => {
311
- if (this.getOption("features.preventOpenEventSent") === true) {
312
- event.preventDefault();
313
- }
314
- this.toggleDialog();
315
- });
316
- break;
317
- case "enter":
318
- this[buttonElementSymbol].addEventListener("mouseenter", (event) => {
319
- if (this.getOption("features.preventOpenEventSent") === true) {
320
- event.preventDefault();
321
- }
322
- this.showDialog();
323
- });
324
- break;
325
-
326
- case "auto": // is hover
327
- this[buttonElementSymbol].addEventListener("mouseenter", (event) => {
328
- if (this.getOption("features.preventOpenEventSent") === true) {
329
- event.preventDefault();
330
- }
331
- this.showDialog();
332
- });
333
- this[buttonElementSymbol].addEventListener("mouseleave", (event) => {
334
- if (this.getOption("features.preventOpenEventSent") === true) {
335
- event.preventDefault();
336
- }
337
- this.hideDialog();
338
- });
339
- break;
340
- }
296
+ switch (mode) {
297
+ case "manual":
298
+ break;
299
+
300
+ case "focus":
301
+ this[buttonElementSymbol].addEventListener("focus", (event) => {
302
+ if (this.getOption("features.preventOpenEventSent") === true) {
303
+ event.preventDefault();
304
+ }
305
+ this.showDialog();
306
+ });
307
+ this[buttonElementSymbol].addEventListener("blur", (event) => {
308
+ if (this.getOption("features.preventOpenEventSent") === true) {
309
+ event.preventDefault();
310
+ }
311
+ this.hideDialog();
312
+ });
313
+ break;
314
+
315
+ case "click":
316
+ this[buttonElementSymbol].addEventListener("click", (event) => {
317
+ if (this.getOption("features.preventOpenEventSent") === true) {
318
+ event.preventDefault();
319
+ }
320
+ this.toggleDialog();
321
+ });
322
+ break;
323
+ case "enter":
324
+ this[buttonElementSymbol].addEventListener("mouseenter", (event) => {
325
+ if (this.getOption("features.preventOpenEventSent") === true) {
326
+ event.preventDefault();
327
+ }
328
+ this.showDialog();
329
+ });
330
+ break;
331
+
332
+ case "auto": // is hover
333
+ this[buttonElementSymbol].addEventListener("mouseenter", (event) => {
334
+ if (this.getOption("features.preventOpenEventSent") === true) {
335
+ event.preventDefault();
336
+ }
337
+ this.showDialog();
338
+ });
339
+ this[buttonElementSymbol].addEventListener("mouseleave", (event) => {
340
+ if (this.getOption("features.preventOpenEventSent") === true) {
341
+ event.preventDefault();
342
+ }
343
+ this.hideDialog();
344
+ });
345
+ break;
346
+ default:
347
+ throw new Error(`Unknown mode ${mode}`);
348
+ }
341
349
  }
342
350
 
343
351
  /**
344
352
  * @private
345
353
  */
346
354
  function attachResizeObserver() {
347
- // against flickering
348
- this[resizeObserverSymbol] = new ResizeObserver((entries) => {
349
- if (this[timerCallbackSymbol] instanceof DeadMansSwitch) {
350
- try {
351
- this[timerCallbackSymbol].touch();
352
- return;
353
- } catch (e) {
354
- delete this[timerCallbackSymbol];
355
- }
356
- }
357
-
358
- this[timerCallbackSymbol] = new DeadMansSwitch(200, () => {
359
- updatePopper.call(this);
360
- });
361
- });
362
-
363
- this[resizeObserverSymbol].observe(this.parentElement);
355
+ // against flickering
356
+ this[resizeObserverSymbol] = new ResizeObserver((entries) => {
357
+ if (this[timerCallbackSymbol] instanceof DeadMansSwitch) {
358
+ try {
359
+ this[timerCallbackSymbol].touch();
360
+ return;
361
+ } catch (e) {
362
+ delete this[timerCallbackSymbol];
363
+ }
364
+ }
365
+
366
+ this[timerCallbackSymbol] = new DeadMansSwitch(200, () => {
367
+ updatePopper.call(this);
368
+ });
369
+ });
370
+
371
+ this[resizeObserverSymbol].observe(this.parentElement);
364
372
  }
365
373
 
366
374
  function disconnectResizeObserver() {
367
- if (this[resizeObserverSymbol] instanceof ResizeObserver) {
368
- this[resizeObserverSymbol].disconnect();
369
- }
375
+ if (this[resizeObserverSymbol] instanceof ResizeObserver) {
376
+ this[resizeObserverSymbol].disconnect();
377
+ }
370
378
  }
371
379
 
372
380
  /**
373
381
  * @private
374
382
  */
375
383
  function hide() {
376
- const self = this;
384
+ const self = this;
377
385
 
378
- fireCustomEvent(self, "monster-popper-hide", {
379
- self,
380
- });
386
+ fireCustomEvent(self, "monster-popper-hide", {
387
+ self,
388
+ });
381
389
 
382
- self[popperElementSymbol].style.display = "none";
383
- removeAttributeToken(self[controlElementSymbol], "class", "open");
390
+ self[popperElementSymbol].style.display = "none";
391
+ removeAttributeToken(self[controlElementSymbol], "class", "open");
384
392
 
385
- setTimeout(() => {
386
- fireCustomEvent(self, "monster-popper-hidden", {
387
- self,
388
- });
389
- }, 0);
393
+ setTimeout(() => {
394
+ fireCustomEvent(self, "monster-popper-hidden", {
395
+ self,
396
+ });
397
+ }, 0);
390
398
  }
391
399
 
392
400
  /**
@@ -394,51 +402,51 @@ function hide() {
394
402
  * @this PopperButton
395
403
  */
396
404
  function show() {
397
- const self = this;
405
+ const self = this;
398
406
 
399
- if (self.getOption("disabled", false) === true) {
400
- return;
401
- }
407
+ if (self.getOption("disabled", false) === true) {
408
+ return;
409
+ }
402
410
 
403
- if (self[popperElementSymbol].style.display === STYLE_DISPLAY_MODE_BLOCK) {
404
- return;
405
- }
411
+ if (self[popperElementSymbol].style.display === STYLE_DISPLAY_MODE_BLOCK) {
412
+ return;
413
+ }
406
414
 
407
- fireCustomEvent(self, "monster-popper-open", {
408
- self,
409
- });
415
+ fireCustomEvent(self, "monster-popper-open", {
416
+ self,
417
+ });
410
418
 
411
- self[popperElementSymbol].style.visibility = "hidden";
412
- self[popperElementSymbol].style.display = STYLE_DISPLAY_MODE_BLOCK;
419
+ self[popperElementSymbol].style.visibility = "hidden";
420
+ self[popperElementSymbol].style.display = STYLE_DISPLAY_MODE_BLOCK;
413
421
 
414
- addAttributeToken(self[controlElementSymbol], "class", "open");
415
- updatePopper.call(self);
422
+ addAttributeToken(self[controlElementSymbol], "class", "open");
423
+ updatePopper.call(self);
416
424
 
417
- setTimeout(() => {
418
- fireCustomEvent(self, "monster-popper-opened", {
419
- self,
420
- });
421
- }, 0);
425
+ setTimeout(() => {
426
+ fireCustomEvent(self, "monster-popper-opened", {
427
+ self,
428
+ });
429
+ }, 0);
422
430
  }
423
431
 
424
432
  /**
425
433
  * @private
426
434
  */
427
435
  function updatePopper() {
428
- if (this[popperElementSymbol].style.display !== STYLE_DISPLAY_MODE_BLOCK) {
429
- return;
430
- }
431
-
432
- if (this.getOption("disabled", false) === true) {
433
- return;
434
- }
435
-
436
- positionPopper.call(
437
- this,
438
- this[controlElementSymbol],
439
- this[popperElementSymbol],
440
- this.getOption("popper", {}),
441
- );
436
+ if (this[popperElementSymbol].style.display !== STYLE_DISPLAY_MODE_BLOCK) {
437
+ return;
438
+ }
439
+
440
+ if (this.getOption("disabled", false) === true) {
441
+ return;
442
+ }
443
+
444
+ positionPopper.call(
445
+ this,
446
+ this[controlElementSymbol],
447
+ this[popperElementSymbol],
448
+ this.getOption("popper", {}),
449
+ );
442
450
  }
443
451
 
444
452
  /**
@@ -446,19 +454,19 @@ function updatePopper() {
446
454
  * @return {Monster.Components.Form.Popper}
447
455
  */
448
456
  function initControlReferences() {
449
- this[controlElementSymbol] = this.shadowRoot.querySelector(
450
- `[${ATTRIBUTE_ROLE}=control]`,
451
- );
452
- this[buttonElementSymbol] = this.shadowRoot.querySelector(
453
- `[${ATTRIBUTE_ROLE}=button]`,
454
- );
455
- this[popperElementSymbol] = this.shadowRoot.querySelector(
456
- `[${ATTRIBUTE_ROLE}=popper]`,
457
- );
458
- this[arrowElementSymbol] = this.shadowRoot.querySelector(
459
- `[${ATTRIBUTE_ROLE}=arrow]`,
460
- );
461
- return this;
457
+ this[controlElementSymbol] = this.shadowRoot.querySelector(
458
+ `[${ATTRIBUTE_ROLE}=control]`,
459
+ );
460
+ this[buttonElementSymbol] = this.shadowRoot.querySelector(
461
+ `[${ATTRIBUTE_ROLE}=button]`,
462
+ );
463
+ this[popperElementSymbol] = this.shadowRoot.querySelector(
464
+ `[${ATTRIBUTE_ROLE}=popper]`,
465
+ );
466
+ this[arrowElementSymbol] = this.shadowRoot.querySelector(
467
+ `[${ATTRIBUTE_ROLE}=arrow]`,
468
+ );
469
+ return this;
462
470
  }
463
471
 
464
472
  /**
@@ -466,8 +474,8 @@ function initControlReferences() {
466
474
  * @return {string}
467
475
  */
468
476
  function getTemplate() {
469
- // language=HTML
470
- return `
477
+ // language=HTML
478
+ return `
471
479
  <div data-monster-role="control" part="control">
472
480
  <slot name="button" data-monster-role="button"></slot>
473
481