@schukai/monster 4.86.0 → 4.87.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,14 @@
2
2
 
3
3
 
4
4
 
5
+ ## [4.87.0] - 2026-01-11
6
+
7
+ ### Add Features
8
+
9
+ - Add functionality for change events in text fields for issue [#371](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/371)
10
+
11
+
12
+
5
13
  ## [4.86.0] - 2026-01-10
6
14
 
7
15
  ### 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.86.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.87.0"}
@@ -14,14 +14,24 @@
14
14
 
15
15
  import { instanceSymbol } from "../../constants.mjs";
16
16
  import { diff } from "../../data/diff.mjs";
17
- import { addAttributeToken } from "../../dom/attributes.mjs";
18
- import { ATTRIBUTE_ERRORMESSAGE } from "../../dom/constants.mjs";
17
+ import {
18
+ addAttributeToken,
19
+ getLinkedObjects,
20
+ hasObjectLink,
21
+ } from "../../dom/attributes.mjs";
22
+ import {
23
+ ATTRIBUTE_ERRORMESSAGE,
24
+ customElementUpdaterLinkSymbol,
25
+ } from "../../dom/constants.mjs";
19
26
  import {
20
27
  assembleMethodSymbol,
21
28
  CustomElement,
22
29
  registerCustomElement,
23
30
  } from "../../dom/customelement.mjs";
24
- import { findElementWithSelectorUpwards } from "../../dom/util.mjs";
31
+ import {
32
+ findElementWithSelectorUpwards,
33
+ getDocument,
34
+ } from "../../dom/util.mjs";
25
35
  import { isString, isArray } from "../../types/is.mjs";
26
36
  import { Observer } from "../../types/observer.mjs";
27
37
  import { TokenList } from "../../types/tokenlist.mjs";
@@ -346,8 +356,8 @@ function initEventHandler() {
346
356
  this[saveInFlightSymbol] = true;
347
357
  this[stateButtonElementSymbol].setOption("disabled", true);
348
358
 
349
- this[datasourceLinkedElementSymbol]
350
- .write()
359
+ flushLinkedForms.call(this)
360
+ .then(() => this[datasourceLinkedElementSymbol].write())
351
361
  .then(() => {
352
362
  this[originValuesSymbol] = null;
353
363
  this[originValuesSymbol] = clone(
@@ -378,6 +388,49 @@ function initEventHandler() {
378
388
  });
379
389
  }
380
390
 
391
+ /**
392
+ * @private
393
+ * @return {Promise<void>}
394
+ */
395
+ function flushLinkedForms() {
396
+ const datasource = this[datasourceLinkedElementSymbol];
397
+ if (!datasource) {
398
+ return Promise.resolve();
399
+ }
400
+
401
+ const doc = getDocument();
402
+ const forms = doc.querySelectorAll("monster-form");
403
+ const writes = [];
404
+
405
+ for (const form of forms) {
406
+ if (!(form instanceof HTMLElement)) {
407
+ continue;
408
+ }
409
+ if (form[datasourceLinkedElementSymbol] !== datasource) {
410
+ continue;
411
+ }
412
+
413
+ if (hasObjectLink(form, customElementUpdaterLinkSymbol)) {
414
+ const updaters = getLinkedObjects(form, customElementUpdaterLinkSymbol);
415
+ for (const list of updaters) {
416
+ for (const updater of list) {
417
+ updater.retrieve();
418
+ }
419
+ }
420
+ }
421
+
422
+ if (typeof form.write === "function") {
423
+ writes.push(form.write());
424
+ }
425
+ }
426
+
427
+ if (writes.length === 0) {
428
+ return Promise.resolve();
429
+ }
430
+
431
+ return Promise.all(writes).then(() => {});
432
+ }
433
+
381
434
  /**
382
435
  * @private
383
436
  */