@schukai/monster 3.73.8 → 3.74.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (82) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/package.json +1 -1
  3. package/source/components/datatable/change-button.mjs +4 -4
  4. package/source/components/datatable/columnbar.mjs +2 -2
  5. package/source/components/datatable/dataset.mjs +2 -2
  6. package/source/components/datatable/datasource/rest.mjs +9 -8
  7. package/source/components/datatable/datatable.mjs +6 -6
  8. package/source/components/datatable/filter/date-range.mjs +6 -6
  9. package/source/components/datatable/filter/input.mjs +2 -2
  10. package/source/components/datatable/filter/range.mjs +4 -4
  11. package/source/components/datatable/filter/select.mjs +6 -2
  12. package/source/components/datatable/filter.mjs +4 -4
  13. package/source/components/datatable/save-button.mjs +4 -4
  14. package/source/components/datatable/stylesheet/change-button.mjs +1 -1
  15. package/source/components/datatable/stylesheet/column-bar.mjs +1 -1
  16. package/source/components/datatable/stylesheet/dataset.mjs +1 -1
  17. package/source/components/datatable/stylesheet/datatable.mjs +13 -6
  18. package/source/components/datatable/stylesheet/embedded-pagination.mjs +1 -1
  19. package/source/components/datatable/stylesheet/filter-select.mjs +13 -6
  20. package/source/components/datatable/stylesheet/filter.mjs +13 -6
  21. package/source/components/datatable/stylesheet/pagination.mjs +1 -1
  22. package/source/components/datatable/stylesheet/save-button.mjs +1 -1
  23. package/source/components/datatable/stylesheet/status.mjs +1 -1
  24. package/source/components/datatable/util.mjs +2 -2
  25. package/source/components/form/action-button.mjs +12 -1
  26. package/source/components/form/api-button.mjs +16 -5
  27. package/source/components/form/button-bar.mjs +13 -1
  28. package/source/components/form/confirm-button.mjs +12 -1
  29. package/source/components/form/context-error.mjs +12 -1
  30. package/source/components/form/context-help.mjs +12 -1
  31. package/source/components/form/field-set.mjs +12 -1
  32. package/source/components/form/form.mjs +15 -0
  33. package/source/components/form/message-state-button.mjs +16 -1
  34. package/source/components/form/popper-button.mjs +16 -1
  35. package/source/components/form/reload.mjs +14 -2
  36. package/source/components/form/shadow-reload.mjs +5 -62
  37. package/source/components/form/state-button.mjs +4 -30
  38. package/source/components/form/stylesheet/action-button.mjs +1 -1
  39. package/source/components/form/stylesheet/field-set.mjs +1 -1
  40. package/source/components/form/stylesheet/state-button.mjs +1 -1
  41. package/source/components/form/stylesheet/toggle-switch.mjs +1 -1
  42. package/source/components/form/tabs.mjs +1 -37
  43. package/source/components/form/template.mjs +4 -29
  44. package/source/components/form/toggle-switch.mjs +16 -1
  45. package/source/components/form/tree-select.mjs +8 -36
  46. package/source/components/host/stylesheet/call-button.mjs +1 -1
  47. package/source/components/host/stylesheet/host.mjs +1 -1
  48. package/source/components/host/stylesheet/overlay.mjs +1 -1
  49. package/source/components/host/stylesheet/toggle-button.mjs +1 -1
  50. package/source/components/host/stylesheet/viewer.mjs +1 -1
  51. package/source/components/layout/popper.mjs +317 -317
  52. package/source/components/layout/slider.mjs +668 -0
  53. package/source/components/layout/style/slider.pcss +114 -0
  54. package/source/components/layout/stylesheet/collapse.mjs +1 -1
  55. package/source/components/layout/stylesheet/details.mjs +1 -1
  56. package/source/components/layout/stylesheet/panel.mjs +1 -1
  57. package/source/components/layout/stylesheet/slider.mjs +31 -0
  58. package/source/components/layout/stylesheet/tabs.mjs +1 -1
  59. package/source/components/navigation/stylesheet/table-of-content.mjs +14 -7
  60. package/source/components/navigation/table-of-content.mjs +22 -17
  61. package/source/components/notify/stylesheet/message.mjs +1 -1
  62. package/source/components/stylesheet/color.mjs +13 -6
  63. package/source/components/stylesheet/mixin/property.mjs +13 -6
  64. package/source/components/stylesheet/property.mjs +1 -1
  65. package/source/components/tree-menu/stylesheet/tree-menu.mjs +1 -1
  66. package/source/components/tree-menu/tree-menu.mjs +23 -5
  67. package/source/data/buildtree.mjs +63 -63
  68. package/source/data/datasource/server/restapi.mjs +1 -2
  69. package/source/data/pathfinder.mjs +22 -19
  70. package/source/dom/events.mjs +1 -1
  71. package/source/dom/updater.mjs +771 -759
  72. package/source/text/generate-range-comparison-expression.mjs +1 -1
  73. package/source/types/base.mjs +1 -1
  74. package/source/types/id.mjs +1 -1
  75. package/source/types/node.mjs +141 -142
  76. package/source/types/observer.mjs +7 -8
  77. package/source/types/version.mjs +1 -1
  78. package/test/cases/data/buildmap.mjs +0 -1
  79. package/test/cases/data/pathfinder.mjs +2 -1
  80. package/test/cases/monster.mjs +1 -1
  81. package/test/web/test.html +2 -2
  82. package/test/web/tests.js +240 -190
@@ -25,7 +25,7 @@ export { generateRangeComparisonExpression };
25
25
  * The generateRangeComparisonExpression() function returns a string representation of the comparison expression.
26
26
  *
27
27
  * ## Options
28
- * The options parameter is an object that can have the following properties:
28
+ * The option parameter is an object that can have the following properties:
29
29
  *
30
30
  * urlEncode (boolean, default: false): if set to true, URL encodes the comparison operators.
31
31
  * andOp (string, default: '&&'): the logical AND operator to use in the expression.
@@ -22,7 +22,7 @@ export { Base };
22
22
  * This class has besides a `toString` which returns the json representation of the object
23
23
  * also a functionality to check if an object is an instance of a class.
24
24
  *
25
- * Therefor the class has a static method ` [Symbol.hasInstance](that)` which returns true if the object
25
+ * Therefore, the class has a static method ` [Symbol.hasInstance](that)` which returns true if the object
26
26
  * is an instance of the class.
27
27
  *
28
28
  * @see [https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/hasInstance](developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/hasInstance)
@@ -28,7 +28,7 @@ const internalCounter = new Map();
28
28
  * thus, the first id with the prefix `myid` will be `myid1` and the second id `myid2`.
29
29
  * The ids are the same for every call, for example on a web page.
30
30
  *
31
- * So the ids can also be used for navigation. you just have to take care that the order stays the same.
31
+ * So the ids can also be used for navigation. you have to take care that the order stays the same.
32
32
  *
33
33
  * As of version 1.6.0 there is the new RandomID. this ID class is continuous from now on.
34
34
  *
@@ -12,13 +12,13 @@
12
12
  * SPDX-License-Identifier: AGPL-3.0
13
13
  */
14
14
 
15
- import {Base} from "./base.mjs";
16
- import {isPrimitive} from "./is.mjs";
17
- import {NodeList} from "./nodelist.mjs";
18
- import {validateInstance} from "./validate.mjs";
19
- import {instanceSymbol} from "../constants.mjs";
15
+ import { Base } from "./base.mjs";
16
+ import { isPrimitive } from "./is.mjs";
17
+ import { NodeList } from "./nodelist.mjs";
18
+ import { validateInstance } from "./validate.mjs";
19
+ import { instanceSymbol } from "../constants.mjs";
20
20
 
21
- export {Node};
21
+ export { Node };
22
22
 
23
23
  /**
24
24
  * @private
@@ -43,120 +43,120 @@ const treeStructureSymbol = Symbol("treeStructure");
43
43
  * @see https://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Iteration_protocols
44
44
  */
45
45
  class Node extends Base {
46
- /**
47
- * @param {*} [value]
48
- */
49
- constructor(value) {
50
- super();
51
- this[internalValueSymbol] = value;
52
-
53
- this[treeStructureSymbol] = {
54
- parent: null,
55
- childNodes: new NodeList(),
56
- level: 0,
57
- };
58
- }
59
-
60
- /**
61
- * This method is called by the `instanceof` operator.
62
- * @returns {symbol}
63
- * @since 2.1.0
64
- */
65
- static get [instanceSymbol]() {
66
- return Symbol.for("@schukai/monster/types/node");
67
- }
68
-
69
- /**
70
- * @property {*}
71
- */
72
- get value() {
73
- return this[internalValueSymbol];
74
- }
75
-
76
- /**
77
- * @property {*}
78
- */
79
- set value(value) {
80
- this[internalValueSymbol] = value;
81
- }
82
-
83
- /**
84
- * @property {Monster.Types.Node|null}
85
- */
86
- get parent() {
87
- return this[treeStructureSymbol].parent;
88
- }
89
-
90
- /**
91
- * @property {integer}
92
- */
93
- get level() {
94
- return this[treeStructureSymbol].level;
95
- }
96
-
97
- /**
98
- *
99
- * @property {NodeList}
100
- */
101
- get childNodes() {
102
- return this[treeStructureSymbol].childNodes;
103
- }
104
-
105
- /**
106
- *
107
- * @property {NodeList}
108
- */
109
- set childNodes(childNodes) {
110
- this[treeStructureSymbol].childNodes = validateInstance(
111
- childNodes,
112
- NodeList,
113
- );
114
- setChildLevelAndParent.call(this, this, 1, new Set());
115
- }
116
-
117
- /**
118
- * @return {Monster.Types.Node}
119
- * @param {Node} node
120
- */
121
- appendChild(node) {
122
- this[treeStructureSymbol].childNodes.add(validateInstance(node, Node));
123
- node[treeStructureSymbol].parent = this;
124
-
125
- node[treeStructureSymbol].level = this.level + 1;
126
- setChildLevelAndParent.call(this, node, 1, new Set());
127
- return this;
128
- }
129
-
130
- /**
131
- * @return {Monster.Types.Node}
132
- * @param {Node} node
133
- */
134
- removeChild(node) {
135
- this[treeStructureSymbol].childNodes.remove(validateInstance(node, Node));
136
- node[treeStructureSymbol].parent = null;
137
-
138
- node[treeStructureSymbol].level = 0;
139
- setChildLevelAndParent.call(this, node, -1, new Set());
140
- return this;
141
- }
142
-
143
- /**
144
- *
145
- * @return {boolean}
146
- */
147
- hasChildNodes() {
148
- return this[treeStructureSymbol].childNodes.length > 0;
149
- }
150
-
151
- /**
152
- * @return {Monster.Types.Node}
153
- * @param {Node} node
154
- */
155
- hasChild(node) {
156
- return this[treeStructureSymbol].childNodes.has(
157
- validateInstance(node, Node),
158
- );
159
- }
46
+ /**
47
+ * @param {*} [value]
48
+ */
49
+ constructor(value) {
50
+ super();
51
+ this[internalValueSymbol] = value;
52
+
53
+ this[treeStructureSymbol] = {
54
+ parent: null,
55
+ childNodes: new NodeList(),
56
+ level: 0,
57
+ };
58
+ }
59
+
60
+ /**
61
+ * This method is called by the `instanceof` operator.
62
+ * @returns {symbol}
63
+ * @since 2.1.0
64
+ */
65
+ static get [instanceSymbol]() {
66
+ return Symbol.for("@schukai/monster/types/node");
67
+ }
68
+
69
+ /**
70
+ * @property {*}
71
+ */
72
+ get value() {
73
+ return this[internalValueSymbol];
74
+ }
75
+
76
+ /**
77
+ * @property {*}
78
+ */
79
+ set value(value) {
80
+ this[internalValueSymbol] = value;
81
+ }
82
+
83
+ /**
84
+ * @property {Monster.Types.Node|null}
85
+ */
86
+ get parent() {
87
+ return this[treeStructureSymbol].parent;
88
+ }
89
+
90
+ /**
91
+ * @property {integer}
92
+ */
93
+ get level() {
94
+ return this[treeStructureSymbol].level;
95
+ }
96
+
97
+ /**
98
+ *
99
+ * @property {NodeList}
100
+ */
101
+ get childNodes() {
102
+ return this[treeStructureSymbol].childNodes;
103
+ }
104
+
105
+ /**
106
+ *
107
+ * @property {NodeList}
108
+ */
109
+ set childNodes(childNodes) {
110
+ this[treeStructureSymbol].childNodes = validateInstance(
111
+ childNodes,
112
+ NodeList,
113
+ );
114
+ setChildLevelAndParent.call(this, this, 1, new Set());
115
+ }
116
+
117
+ /**
118
+ * @return {Monster.Types.Node}
119
+ * @param {Node} node
120
+ */
121
+ appendChild(node) {
122
+ this[treeStructureSymbol].childNodes.add(validateInstance(node, Node));
123
+ node[treeStructureSymbol].parent = this;
124
+
125
+ node[treeStructureSymbol].level = this.level + 1;
126
+ setChildLevelAndParent.call(this, node, 1, new Set());
127
+ return this;
128
+ }
129
+
130
+ /**
131
+ * @return {Monster.Types.Node}
132
+ * @param {Node} node
133
+ */
134
+ removeChild(node) {
135
+ this[treeStructureSymbol].childNodes.remove(validateInstance(node, Node));
136
+ node[treeStructureSymbol].parent = null;
137
+
138
+ node[treeStructureSymbol].level = 0;
139
+ setChildLevelAndParent.call(this, node, -1, new Set());
140
+ return this;
141
+ }
142
+
143
+ /**
144
+ *
145
+ * @return {boolean}
146
+ */
147
+ hasChildNodes() {
148
+ return this[treeStructureSymbol].childNodes.length > 0;
149
+ }
150
+
151
+ /**
152
+ * @return {Monster.Types.Node}
153
+ * @param {Node} node
154
+ */
155
+ hasChild(node) {
156
+ return this[treeStructureSymbol].childNodes.has(
157
+ validateInstance(node, Node),
158
+ );
159
+ }
160
160
 
161
161
  /**
162
162
  * @since 1.28.0
@@ -192,7 +192,6 @@ class Node extends Base {
192
192
  }
193
193
  }
194
194
 
195
-
196
195
  /**
197
196
  * @private
198
197
  * @param {Node} node
@@ -201,25 +200,25 @@ class Node extends Base {
201
200
  * @return {setChildLevelAndParent}
202
201
  */
203
202
  function setChildLevelAndParent(node, operand, visitedNodes) {
204
- const self = this;
205
-
206
- if (visitedNodes.has(node)) {
207
- throw new Error(
208
- "the node has already been visited and cannot be traversed again",
209
- )
210
- }
211
-
212
- visitedNodes.add(node);
213
-
214
- if (node !== this) {
215
- node[treeStructureSymbol].parent = this;
216
- }
217
-
218
- node[treeStructureSymbol].childNodes.forEach(function (child) {
219
- child[treeStructureSymbol].parent = node;
220
- child[treeStructureSymbol].level =
221
- node[treeStructureSymbol].level + operand;
222
- setChildLevelAndParent.call(self, child, operand, visitedNodes);
223
- });
224
- return this;
203
+ const self = this;
204
+
205
+ if (visitedNodes.has(node)) {
206
+ throw new Error(
207
+ "the node has already been visited and cannot be traversed again",
208
+ );
209
+ }
210
+
211
+ visitedNodes.add(node);
212
+
213
+ if (node !== this) {
214
+ node[treeStructureSymbol].parent = this;
215
+ }
216
+
217
+ node[treeStructureSymbol].childNodes.forEach(function (child) {
218
+ child[treeStructureSymbol].parent = node;
219
+ child[treeStructureSymbol].level =
220
+ node[treeStructureSymbol].level + operand;
221
+ setChildLevelAndParent.call(self, child, operand, visitedNodes);
222
+ });
223
+ return this;
225
224
  }
@@ -132,17 +132,16 @@ class Observer extends Base {
132
132
  update(subject) {
133
133
  const self = this;
134
134
 
135
- return new Promise(function (resolve, reject) {
136
- if (!isObject(subject)) {
137
- reject("subject must be an object");
138
- return;
139
- }
135
+ if (!isObject(subject)) {
136
+ return Promise.reject("subject must be an object");
137
+ }
140
138
 
139
+ return new Promise(function (resolve, reject) {
141
140
  self.queue.add(subject);
142
141
 
143
- setTimeout(() => {
142
+ queueMicrotask(() => {
144
143
  try {
145
- // the queue and the `setTimeout` ensure that an object is not
144
+ // the queue and the `queueMicrotask` ensure that an object is not
146
145
  // informed of the same change more than once.
147
146
  if (self.queue.isEmpty()) {
148
147
  resolve();
@@ -161,7 +160,7 @@ class Observer extends Base {
161
160
  } catch (e) {
162
161
  reject(e);
163
162
  }
164
- }, 0);
163
+ });
165
164
  });
166
165
  }
167
166
  }
@@ -159,7 +159,7 @@ function getMonsterVersion() {
159
159
  }
160
160
 
161
161
  /** don't touch, replaced by make with package.json version */
162
- monsterVersion = new Version("3.73.6");
162
+ monsterVersion = new Version("3.73.9");
163
163
 
164
164
  return monsterVersion;
165
165
  }
@@ -335,6 +335,5 @@ describe('buildMap', function () {
335
335
  });
336
336
  });
337
337
 
338
-
339
338
  });
340
339
  });
@@ -69,11 +69,12 @@ describe('Pathfinder', function () {
69
69
 
70
70
 
71
71
  it('.setVia(' + a + ') should result in ' + b, function () {
72
+
72
73
  let r = pf.getVia(a);
73
74
  let i = convertMapResult(r);
74
75
  expect(JSON.stringify(i)).is.equal(b);
75
- });
76
76
 
77
+ });
77
78
 
78
79
  });
79
80
 
@@ -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.73.6")
10
+ monsterVersion = new Version("3.73.9")
11
11
 
12
12
  let m = getMonsterVersion();
13
13
 
@@ -9,8 +9,8 @@
9
9
  </head>
10
10
  <body>
11
11
  <div id="headline" style="display: flex;align-items: center;justify-content: center;flex-direction: column;">
12
- <h1 style='margin-bottom: 0.1em;'>Monster 3.73.6</h1>
13
- <div id="lastupdate" style='font-size:0.7em'>last update Do 1. Aug 15:58:34 CEST 2024</div>
12
+ <h1 style='margin-bottom: 0.1em;'>Monster 3.73.9</h1>
13
+ <div id="lastupdate" style='font-size:0.7em'>last update So 15. Sep 19:44:25 CEST 2024</div>
14
14
  </div>
15
15
  <div id="mocha-errors"
16
16
  style="color: red;font-weight: bold;display: flex;align-items: center;justify-content: center;flex-direction: column;margin:20px;"></div>