@schukai/monster 3.56.0 → 3.57.0

Sign up to get free protection for your applications and to get access to all the features.
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
@@ -377,7 +377,7 @@ function findClosestByAttribute(element, key, value) {
377
377
  }
378
378
 
379
379
  /**
380
- * This function searches, starting from an `HTMLElemement`, for the next element that has a certain attribute.
380
+ * This function searches, starting from an `HTMLElement`, for the next element that has a certain attribute.
381
381
  *
382
382
  * ```html
383
383
  * <div class="myclass" id="2">
@@ -320,9 +320,13 @@ class CustomControl extends CustomElement {
320
320
  */
321
321
  formDisabledCallback(disabled) {
322
322
  if (disabled) {
323
- this.setAttribute("disabled", "");
323
+ if (!this.hasAttribute("disabled")) {
324
+ this.setAttribute("disabled", "");
325
+ }
324
326
  } else {
325
- this.removeAttribute("disabled");
327
+ if (this.hasAttribute("disabled")) {
328
+ this.removeAttribute("disabled");
329
+ }
326
330
  }
327
331
  }
328
332