@schukai/monster 4.56.0 → 4.58.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 +23 -0
  2. package/package.json +1 -1
  3. package/source/components/data/stylesheet/metric-graph.mjs +1 -1
  4. package/source/components/data/stylesheet/metric.mjs +1 -1
  5. package/source/components/datatable/dataset.mjs +10 -0
  6. package/source/components/datatable/datasource/rest.mjs +141 -14
  7. package/source/components/datatable/datasource.mjs +8 -1
  8. package/source/components/datatable/datatable.mjs +3 -7
  9. package/source/components/datatable/save-button.mjs +348 -334
  10. package/source/components/datatable/status.mjs +7 -0
  11. package/source/components/datatable/util.mjs +7 -0
  12. package/source/components/form/button-bar.mjs +193 -95
  13. package/source/components/form/field-set.mjs +283 -283
  14. package/source/components/form/form.mjs +407 -162
  15. package/source/components/form/login.mjs +1571 -1571
  16. package/source/components/form/quantity.mjs +233 -233
  17. package/source/components/form/select.mjs +3106 -3101
  18. package/source/components/form/style/field-set.pcss +6 -2
  19. package/source/components/form/style/form.pcss +8 -0
  20. package/source/components/form/stylesheet/field-set.mjs +1 -1
  21. package/source/components/form/stylesheet/form.mjs +1 -1
  22. package/source/components/form/stylesheet/select.mjs +13 -6
  23. package/source/components/style/typography.css +2 -2
  24. package/source/components/tree-menu/stylesheet/tree-menu.mjs +1 -1
  25. package/source/constraints/abstract.mjs +17 -17
  26. package/source/dom/customelement.mjs +962 -963
  27. package/source/dom/updater.mjs +874 -863
  28. package/source/dom/util/init-options-from-attributes.mjs +56 -56
  29. package/source/monster.mjs +0 -1
  30. package/source/net/webconnect.mjs +325 -325
  31. package/source/types/is.mjs +66 -66
@@ -14,13 +14,13 @@
14
14
 
15
15
  import { Pathfinder } from "../../data/pathfinder.mjs";
16
16
  import {
17
- isBoolean,
18
- isString,
19
- isObject,
20
- isNumber,
21
- isArray,
22
- isFunction,
23
- isInteger,
17
+ isBoolean,
18
+ isString,
19
+ isObject,
20
+ isNumber,
21
+ isArray,
22
+ isFunction,
23
+ isInteger,
24
24
  } from "../../types/is.mjs";
25
25
  import { extractKeys } from "./extract-keys.mjs";
26
26
 
@@ -59,62 +59,62 @@ export { initOptionsFromAttributes };
59
59
  * @this HTMLElement - The context of the DOM element.
60
60
  */
61
61
  function initOptionsFromAttributes(
62
- element,
63
- options,
64
- mapping = {},
65
- prefix = "data-monster-option-",
62
+ element,
63
+ options,
64
+ mapping = {},
65
+ prefix = "data-monster-option-",
66
66
  ) {
67
- if (!(element instanceof HTMLElement)) return options;
68
- if (!element.hasAttributes()) return options;
67
+ if (!(element instanceof HTMLElement)) return options;
68
+ if (!element.hasAttributes()) return options;
69
69
 
70
- const keyMap = extractKeys(options);
71
- const finder = new Pathfinder(options);
70
+ const keyMap = extractKeys(options);
71
+ const finder = new Pathfinder(options);
72
72
 
73
- element.getAttributeNames().forEach((name) => {
74
- if (!name.startsWith(prefix)) return;
73
+ element.getAttributeNames().forEach((name) => {
74
+ if (!name.startsWith(prefix)) return;
75
75
 
76
- // check if the attribute name is a valid option.
77
- // the mapping between the attribute is simple. The dash is replaced by a dot.
78
- // e.g. data-monster-url => url
79
- const optionName = keyMap.get(name.substring(prefix.length).toLowerCase());
80
- if (!finder.exists(optionName)) return;
76
+ // check if the attribute name is a valid option.
77
+ // the mapping between the attribute is simple. The dash is replaced by a dot.
78
+ // e.g. data-monster-url => url
79
+ const optionName = keyMap.get(name.substring(prefix.length).toLowerCase());
80
+ if (!finder.exists(optionName)) return;
81
81
 
82
- if (element.hasAttribute(name)) {
83
- let value = element.getAttribute(name);
84
- if (
85
- mapping.hasOwnProperty(optionName) &&
86
- isFunction(mapping[optionName])
87
- ) {
88
- value = mapping[optionName](value);
89
- }
82
+ if (element.hasAttribute(name)) {
83
+ let value = element.getAttribute(name);
84
+ if (
85
+ mapping.hasOwnProperty(optionName) &&
86
+ isFunction(mapping[optionName])
87
+ ) {
88
+ value = mapping[optionName](value);
89
+ }
90
90
 
91
- let optionValue = finder.getVia(optionName);
92
- if (optionValue === null || optionValue === undefined) {
93
- optionValue = value;
94
- }
91
+ let optionValue = finder.getVia(optionName);
92
+ if (optionValue === null || optionValue === undefined) {
93
+ optionValue = value;
94
+ }
95
95
 
96
- //const typeOfOptionValue = typeof optionValue;
97
- if (optionValue === null || optionValue === undefined) {
98
- value = null;
99
- } else if (isBoolean(optionValue)) {
100
- value = value === "true";
101
- } else if (isInteger(optionValue)) {
102
- value = Number(value);
103
- } else if (isNumber(optionValue)) {
104
- value = Number(value);
105
- } else if (isString(optionValue)) {
106
- value = String(value);
107
- } else if (isObject(optionValue)) {
108
- value = JSON.parse(value);
109
- } else if (isArray(optionValue)) {
110
- value = value.split("::");
111
- } else {
112
- value = optionValue;
113
- }
96
+ //const typeOfOptionValue = typeof optionValue;
97
+ if (optionValue === null || optionValue === undefined) {
98
+ value = null;
99
+ } else if (isBoolean(optionValue)) {
100
+ value = value === "true";
101
+ } else if (isInteger(optionValue)) {
102
+ value = Number(value);
103
+ } else if (isNumber(optionValue)) {
104
+ value = Number(value);
105
+ } else if (isString(optionValue)) {
106
+ value = String(value);
107
+ } else if (isObject(optionValue)) {
108
+ value = JSON.parse(value);
109
+ } else if (isArray(optionValue)) {
110
+ value = value.split("::");
111
+ } else {
112
+ value = optionValue;
113
+ }
114
114
 
115
- finder.setVia(optionName, value);
116
- }
117
- });
115
+ finder.setVia(optionName, value);
116
+ }
117
+ });
118
118
 
119
- return options;
119
+ return options;
120
120
  }
@@ -112,7 +112,6 @@ export * from "./components/accessibility/locale-picker.mjs";
112
112
  export * from "./components/state/log/entry.mjs";
113
113
  export * from "./components/state/state.mjs";
114
114
  export * from "./components/state/log.mjs";
115
- export * from "./components/navigation/wizard-navigation.mjs";
116
115
  export * from "./components/navigation/table-of-content.mjs";
117
116
  export * from "./components/navigation/site-navigation.mjs";
118
117
  export * from "./components/data/metric-graph.mjs";