@schukai/monster 3.56.1 → 3.58.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/example/components/form/toggle-switch.mjs +7 -0
  3. package/package.json +1 -1
  4. package/source/components/datatable/change-button.mjs +8 -4
  5. package/source/components/datatable/dataset.mjs +1 -1
  6. package/source/components/datatable/filter.mjs +0 -1
  7. package/source/components/form/button.mjs +3 -3
  8. package/source/components/form/select.mjs +55 -15
  9. package/source/components/form/style/button-bar.pcss +2 -0
  10. package/source/components/form/style/button.pcss +2 -0
  11. package/source/components/form/style/select.pcss +1 -1
  12. package/source/components/form/style/toggle-switch.pcss +74 -0
  13. package/source/components/form/stylesheet/button-bar.mjs +1 -1
  14. package/source/components/form/stylesheet/button.mjs +1 -1
  15. package/source/components/form/stylesheet/select.mjs +1 -1
  16. package/source/components/form/stylesheet/toggle-switch.mjs +27 -0
  17. package/source/components/form/tabs.mjs +0 -1
  18. package/source/components/form/toggle-switch.mjs +430 -0
  19. package/source/data/transformer.mjs +30 -0
  20. package/source/dom/attributes.mjs +1 -1
  21. package/source/dom/customcontrol.mjs +6 -2
  22. package/source/dom/customelement.mjs +43 -5
  23. package/source/dom/events.mjs +3 -3
  24. package/source/dom/updater.mjs +43 -16
  25. package/source/i18n/translations.mjs +1 -1
  26. package/source/monster.mjs +7 -0
  27. package/source/types/version.mjs +1 -1
  28. package/test/cases/components/form/select.mjs +1 -1
  29. package/test/cases/components/form/toggle-switch.mjs +310 -0
  30. package/test/cases/components/form/tree-select.mjs +1 -8
  31. package/test/cases/data/transformer.mjs +16 -0
  32. package/test/cases/dom/customcontrol.mjs +53 -8
  33. package/test/cases/dom/customelement-initfromscripthost.mjs +0 -4
  34. package/test/cases/dom/customelement.mjs +30 -26
  35. package/test/cases/dom/updater.mjs +14 -3
  36. package/test/cases/monster.mjs +1 -1
  37. package/test/util/jsdom.mjs +9 -10
  38. package/test/web/import.js +1 -0
  39. package/test/web/test.html +2 -2
  40. package/test/web/tests.js +3966 -1415
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  import chai from "chai"
4
- import {Updater} from "../../../source/dom/updater.mjs";
4
+
5
5
  import {ID} from "../../../source/types/id.mjs";
6
6
  import {Observer} from "../../../source/types/observer.mjs";
7
7
  import {ProxyObserver} from "../../../source/types/proxyobserver.mjs";
@@ -110,11 +110,22 @@ let html4 = `
110
110
  `;
111
111
 
112
112
 
113
+
113
114
  describe('DOM', function () {
114
115
 
116
+ let Updater = null;
117
+
115
118
  before(function (done) {
116
- initJSDOM().then(() => {
117
- done()
119
+ const options = {
120
+ }
121
+ initJSDOM(options).then(() => {
122
+
123
+ import("../../../source/dom/updater.mjs").then((m) => {
124
+ Updater = m.Updater;
125
+ done();
126
+ }).catch((e) => {
127
+ done(e)
128
+ });
118
129
  });
119
130
  });
120
131
 
@@ -7,7 +7,7 @@ describe('Monster', function () {
7
7
  let monsterVersion
8
8
 
9
9
  /** don´t touch, replaced by make with package.json version */
10
- monsterVersion = new Version("3.56.1")
10
+ monsterVersion = new Version("3.58.0")
11
11
 
12
12
  let m = getMonsterVersion();
13
13
 
@@ -2,7 +2,6 @@
2
2
 
3
3
  import {extend} from "../../source/data/extend.mjs";
4
4
  import {getGlobal} from "../../source/types/global.mjs";
5
- //import Storage from "dom-storage";
6
5
 
7
6
  export const isBrowser = new Function("try {return this===window;}catch(e){ return false;}");
8
7
  export const isNode = new Function("try {return this===global;}catch(e){return false;}");
@@ -16,8 +15,6 @@ let JSDOMExport = null;
16
15
  */
17
16
  function initJSDOM(options) {
18
17
  if (typeof window === "object" && window['DOMParser']) return Promise.resolve();
19
-
20
-
21
18
 
22
19
  const g = getGlobal();
23
20
 
@@ -40,8 +37,8 @@ function initJSDOM(options) {
40
37
  </body>`, options);
41
38
 
42
39
  g['window'] = window;
43
-
44
- return new Promise(resolve =>
40
+
41
+ return new Promise((resolve, reject) =>
45
42
  window.addEventListener("load", () => {
46
43
 
47
44
  [
@@ -83,18 +80,20 @@ function initJSDOM(options) {
83
80
  g[key] = window[key]
84
81
  });
85
82
 
86
-
87
83
  import("dom-storage").then(({default: Storage}) => {
88
-
89
-
84
+
90
85
  g.localStorage = new Storage(null, {strict: true});
91
86
  g.sessionStorage = new Storage(null, {strict: true});
92
87
 
93
88
  window['localStorage'] = g.localStorage;
94
89
  window['sessionStorage'] = g.sessionStorage;
95
- });
96
90
 
97
- resolve(g);
91
+ resolve(g);
92
+
93
+ }).catch(e => {
94
+ console.error("Error loading dom-storage", e);
95
+ reject(e);
96
+ });
98
97
 
99
98
  })
100
99
  );
@@ -8,6 +8,7 @@ import "../cases/components/form/confirm-button.mjs";
8
8
  import "../cases/components/form/form.mjs";
9
9
  import "../cases/components/form/tree-select.mjs";
10
10
  import "../cases/components/form/button.mjs";
11
+ import "../cases/components/form/toggle-switch.mjs";
11
12
  import "../cases/components/form/template.mjs";
12
13
  import "../cases/components/notify/message.mjs";
13
14
  import "../cases/components/notify/notify.mjs";
@@ -15,8 +15,8 @@
15
15
  </head>
16
16
  <body>
17
17
  <div id="headline" style="display: flex;align-items: center;justify-content: center;flex-direction: column;">
18
- <h1 style='margin-bottom: 0.1em;'>Monster 3.55.3</h1>
19
- <div id="lastupdate" style='font-size:0.7em'>last update Mi 24. Jan 19:51:51 CET 2024</div>
18
+ <h1 style='margin-bottom: 0.1em;'>Monster 3.57.0</h1>
19
+ <div id="lastupdate" style='font-size:0.7em'>last update So 17. Mär 11:35:11 CET 2024</div>
20
20
  </div>
21
21
  <div id="mocha-errors"
22
22
  style="color: red;font-weight: bold;display: flex;align-items: center;justify-content: center;flex-direction: column;margin:20px;"></div>