@schukai/monster 3.73.7 → 3.73.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/package.json +1 -1
  3. package/source/components/datatable/filter/input.mjs +2 -2
  4. package/source/components/datatable/filter/select.mjs +6 -2
  5. package/source/components/datatable/stylesheet/change-button.mjs +1 -1
  6. package/source/components/datatable/stylesheet/column-bar.mjs +1 -1
  7. package/source/components/datatable/stylesheet/dataset.mjs +1 -1
  8. package/source/components/datatable/stylesheet/datatable.mjs +13 -6
  9. package/source/components/datatable/stylesheet/embedded-pagination.mjs +1 -1
  10. package/source/components/datatable/stylesheet/filter-select.mjs +13 -6
  11. package/source/components/datatable/stylesheet/filter.mjs +13 -6
  12. package/source/components/datatable/stylesheet/pagination.mjs +1 -1
  13. package/source/components/datatable/stylesheet/save-button.mjs +1 -1
  14. package/source/components/datatable/stylesheet/status.mjs +1 -1
  15. package/source/components/form/action-button.mjs +12 -1
  16. package/source/components/form/api-button.mjs +16 -5
  17. package/source/components/form/button-bar.mjs +13 -1
  18. package/source/components/form/confirm-button.mjs +12 -1
  19. package/source/components/form/context-error.mjs +12 -1
  20. package/source/components/form/context-help.mjs +12 -1
  21. package/source/components/form/field-set.mjs +12 -1
  22. package/source/components/form/form.mjs +15 -0
  23. package/source/components/form/message-state-button.mjs +16 -1
  24. package/source/components/form/popper-button.mjs +16 -1
  25. package/source/components/form/reload.mjs +14 -2
  26. package/source/components/form/shadow-reload.mjs +5 -62
  27. package/source/components/form/state-button.mjs +4 -30
  28. package/source/components/form/stylesheet/action-button.mjs +1 -1
  29. package/source/components/form/stylesheet/field-set.mjs +1 -1
  30. package/source/components/form/stylesheet/state-button.mjs +1 -1
  31. package/source/components/form/stylesheet/toggle-switch.mjs +1 -1
  32. package/source/components/form/tabs.mjs +1 -37
  33. package/source/components/form/template.mjs +4 -29
  34. package/source/components/form/toggle-switch.mjs +16 -1
  35. package/source/components/form/tree-select.mjs +8 -36
  36. package/source/components/host/stylesheet/call-button.mjs +1 -1
  37. package/source/components/host/stylesheet/host.mjs +1 -1
  38. package/source/components/host/stylesheet/overlay.mjs +1 -1
  39. package/source/components/host/stylesheet/toggle-button.mjs +1 -1
  40. package/source/components/host/stylesheet/viewer.mjs +1 -1
  41. package/source/components/layout/popper.mjs +317 -317
  42. package/source/components/layout/stylesheet/collapse.mjs +1 -1
  43. package/source/components/layout/stylesheet/details.mjs +1 -1
  44. package/source/components/layout/stylesheet/panel.mjs +1 -1
  45. package/source/components/layout/stylesheet/tabs.mjs +1 -1
  46. package/source/components/navigation/stylesheet/table-of-content.mjs +14 -7
  47. package/source/components/navigation/table-of-content.mjs +22 -17
  48. package/source/components/notify/stylesheet/message.mjs +1 -1
  49. package/source/components/stylesheet/color.mjs +13 -6
  50. package/source/components/stylesheet/mixin/property.mjs +13 -6
  51. package/source/components/stylesheet/property.mjs +1 -1
  52. package/source/components/tree-menu/stylesheet/tree-menu.mjs +1 -1
  53. package/source/components/tree-menu/tree-menu.mjs +21 -3
  54. package/source/data/buildtree.mjs +63 -63
  55. package/source/data/pathfinder.mjs +22 -19
  56. package/source/dom/updater.mjs +772 -759
  57. package/source/text/generate-range-comparison-expression.mjs +1 -1
  58. package/source/types/base.mjs +1 -1
  59. package/source/types/id.mjs +1 -1
  60. package/source/types/node.mjs +141 -142
  61. package/test/cases/data/buildmap.mjs +0 -1
  62. package/test/cases/data/pathfinder.mjs +2 -1
@@ -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
  }
@@ -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