@schukai/monster 4.121.0 → 4.122.1

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,22 @@
2
2
 
3
3
 
4
4
 
5
+ ## [4.122.1] - 2026-02-13
6
+
7
+ ### Bug Fixes
8
+
9
+ - Ensure proper context for placeAppointments function
10
+
11
+
12
+
13
+ ## [4.122.0] - 2026-02-13
14
+
15
+ ### Add Features
16
+
17
+ - Add option to control event emission in show function
18
+
19
+
20
+
5
21
  ## [4.121.0] - 2026-02-13
6
22
 
7
23
  ### Add Features
package/package.json CHANGED
@@ -1 +1 @@
1
- {"author":"Volker Schukai","dependencies":{"@floating-ui/dom":"^1.7.4","@popperjs/core":"^2.11.8"},"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":"4.121.0"}
1
+ {"author":"Volker Schukai","dependencies":{"@floating-ui/dom":"^1.7.4","@popperjs/core":"^2.11.8"},"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":"4.122.1"}
@@ -712,11 +712,12 @@ function initPopper() {
712
712
  * @private
713
713
  * @param {HTMLElement} element
714
714
  */
715
- function show(element) {
715
+ function show(element, options = {}) {
716
716
  if (!this.shadowRoot) {
717
717
  throw new Error("no shadow-root is defined");
718
718
  }
719
719
 
720
+ const emitEvents = options?.emitEvents !== false;
720
721
  const reference = element.getAttribute(`${ATTRIBUTE_PREFIX}tab-reference`);
721
722
 
722
723
  const nodes = getSlottedElements.call(this);
@@ -726,9 +727,11 @@ function show(element) {
726
727
  if (id === reference) {
727
728
  node.classList.add("active");
728
729
 
729
- fireCustomEvent(this, "monster-tab-change", {
730
- reference,
731
- });
730
+ if (emitEvents) {
731
+ fireCustomEvent(this, "monster-tab-change", {
732
+ reference,
733
+ });
734
+ }
732
735
 
733
736
  const openDelay = Number.parseInt(
734
737
  this.getOption("features.openDelay"),
@@ -774,18 +777,22 @@ function show(element) {
774
777
  const filter = undefined;
775
778
  loadAndAssignContent(node, url, options, filter)
776
779
  .then(() => {
777
- fireCustomEvent(this, "monster-tab-changed", {
778
- reference,
779
- });
780
+ if (emitEvents) {
781
+ fireCustomEvent(this, "monster-tab-changed", {
782
+ reference,
783
+ });
784
+ }
780
785
  })
781
786
  .catch((e) => {
782
787
  addAttributeToken(this, ATTRIBUTE_ERRORMESSAGE, e.message);
783
788
  });
784
789
  } else {
785
- fireCustomEvent(this, "monster-tab-changed", {
786
- reference,
787
- data,
788
- });
790
+ if (emitEvents) {
791
+ fireCustomEvent(this, "monster-tab-changed", {
792
+ reference,
793
+ data,
794
+ });
795
+ }
789
796
  }
790
797
  } else {
791
798
  node.classList.remove("active");
@@ -1126,7 +1133,7 @@ function initTabButtons() {
1126
1133
  `[${ATTRIBUTE_PREFIX}tab-reference="${activeReference}"]`,
1127
1134
  );
1128
1135
  if (button instanceof HTMLButtonElement && button.disabled !== true) {
1129
- show.call(this, button);
1136
+ show.call(this, button, { emitEvents: false });
1130
1137
  }
1131
1138
  })
1132
1139
  .run(undefined)
@@ -177,7 +177,7 @@ class MonthCalendar extends CustomElement {
177
177
  this.setOption("data", {});
178
178
  queueMicrotask(() => {
179
179
  handleDataSourceChanges.call(this);
180
- placeAppointments();
180
+ placeAppointments.call(this);
181
181
  resolve();
182
182
  });
183
183
  });