@schukai/monster 3.56.0 → 3.57.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.
Files changed (31) hide show
  1. package/CHANGELOG.md +39 -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 +5 -1
  5. package/source/components/form/button.mjs +3 -3
  6. package/source/components/form/select.mjs +1773 -1745
  7. package/source/components/form/style/select.pcss +1 -1
  8. package/source/components/form/style/toggle-switch.pcss +74 -0
  9. package/source/components/form/stylesheet/select.mjs +1 -1
  10. package/source/components/form/stylesheet/toggle-switch.mjs +27 -0
  11. package/source/components/form/toggle-switch.mjs +427 -0
  12. package/source/data/transformer.mjs +33 -1
  13. package/source/dom/attributes.mjs +1 -1
  14. package/source/dom/customcontrol.mjs +6 -2
  15. package/source/dom/customelement.mjs +909 -864
  16. package/source/dom/updater.mjs +754 -732
  17. package/source/dom/util/set-option-from-attribute.mjs +2 -1
  18. package/source/monster.mjs +5 -0
  19. package/source/types/version.mjs +1 -1
  20. package/test/cases/components/form/select.mjs +1 -1
  21. package/test/cases/components/form/toggle-switch.mjs +310 -0
  22. package/test/cases/components/form/tree-select.mjs +1 -8
  23. package/test/cases/data/transformer.mjs +16 -0
  24. package/test/cases/dom/customcontrol.mjs +53 -8
  25. package/test/cases/dom/customelement-initfromscripthost.mjs +0 -4
  26. package/test/cases/dom/customelement.mjs +30 -26
  27. package/test/cases/dom/updater.mjs +14 -3
  28. package/test/cases/monster.mjs +1 -1
  29. package/test/util/jsdom.mjs +9 -10
  30. package/test/web/test.html +2 -2
  31. package/test/web/tests.js +3044 -1023
package/CHANGELOG.md CHANGED
@@ -1,4 +1,42 @@
1
1
 
2
+ ## [3.57.0] - 2024-03-06
3
+
4
+ ### Add Features
5
+
6
+ - [#162](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/162)
7
+ - new updaterTransformerMethodsSymbol method [#163](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/163)
8
+ - new updaterTransformerMethodsSymbol method [#163](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/163)
9
+ ### Bug Fixes
10
+
11
+ - [#165](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/165)
12
+ - bind this to callback and fix timing [#158](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/158) [#164](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/164)
13
+ - add arrowdown handler [#160](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/160) [#161](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/161)
14
+ - add arrowdown handler [#160](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/160) [#161](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/161)
15
+ ### Changes
16
+
17
+ - tests and more
18
+ - tests and more
19
+ - fix tests
20
+ - updates [#160](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/160)
21
+ - whitespace [#160](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/160)
22
+ - optimize outline [#160](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/160)
23
+ - optimize outline [#160](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/160)
24
+ - rename internal function [#160](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/160)
25
+ - fix missing fs bug
26
+ - release and publish to npm new version 3.56.1
27
+ ### Documentation
28
+
29
+ - typo [#160](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/160)
30
+
31
+ ## [3.56.1] - 2024-02-26
32
+
33
+ ### Bug Fixes
34
+
35
+ - [3] is not the right way [#151](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/151)
36
+ ### Changes
37
+
38
+ - release and publish to npm new version 3.56.1
39
+
2
40
  ## [3.56.0] - 2024-02-26
3
41
 
4
42
  ### Add Features
@@ -6,6 +44,7 @@
6
44
  - update datatable controls [#150](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/150) [#149](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/149) [#148](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/148) [#147](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/147) [#146](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/146) [#145](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/145)
7
45
  ### Changes
8
46
 
47
+ - release and publish to npm new version 3.56.0
9
48
  - format
10
49
  - format
11
50
  - [#144](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/144)
@@ -0,0 +1,7 @@
1
+ import {Switch} from '@schukai/component-form/source/toggle-switch.js';
2
+
3
+ // create element
4
+ const toggleSwitch = document.createElement('monster-toggle-switch');
5
+
6
+ // insert element into the DOM
7
+ document.body.appendChild(toggleSwitch);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@schukai/monster",
3
- "version": "3.56.0",
3
+ "version": "3.57.0",
4
4
  "description": "Monster is a simple library for creating fast, robust and lightweight websites.",
5
5
  "keywords": [
6
6
  "framework",
@@ -5,6 +5,8 @@
5
5
 
6
6
  import { instanceSymbol } from "../../constants.mjs";
7
7
  import { diff } from "../../data/diff.mjs";
8
+ import {addAttributeToken} from "../../dom/attributes.mjs";
9
+ import {ATTRIBUTE_ERRORMESSAGE} from "../../dom/constants.mjs";
8
10
  import {
9
11
  assembleMethodSymbol,
10
12
  CustomElement,
@@ -205,15 +207,17 @@ function getIndex() {
205
207
 
206
208
  const row = this.closest("[data-monster-insert-reference]");
207
209
  if (!row) {
210
+ addAttributeToken(this, ATTRIBUTE_ERRORMESSAGE, "no reference found");
208
211
  return;
209
212
  }
210
213
 
211
214
  const ref = row.getAttribute("data-monster-insert-reference");
212
215
  if (!ref) {
216
+ addAttributeToken(this, ATTRIBUTE_ERRORMESSAGE, "reference is missing or empty");
213
217
  return;
214
218
  }
215
219
 
216
- const index = Number(ref.split("-")[3]);
220
+ const index = Number(ref.split("-").pop());
217
221
  if (isNaN(index)) {
218
222
  return;
219
223
  }
@@ -85,7 +85,7 @@ class Button extends CustomControl {
85
85
  [assembleMethodSymbol]() {
86
86
  super[assembleMethodSymbol]();
87
87
  initControlReferences.call(this);
88
- initEventhandler.call(this);
88
+ initEventHandler.call(this);
89
89
  return this;
90
90
  }
91
91
 
@@ -257,10 +257,10 @@ class Button extends CustomControl {
257
257
 
258
258
  /**
259
259
  * @private
260
- * @return {initEventhandler}
260
+ * @return {initEventHandler}
261
261
  * @fires Monster.Components.Form.event:monster-button-clicked
262
262
  */
263
- function initEventhandler() {
263
+ function initEventHandler() {
264
264
  const self = this;
265
265
  const button = this[buttonElementSymbol];
266
266