cavalion-vcl 1.1.65 → 1.1.68

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.
package/.md CHANGED
@@ -1,5 +1,17 @@
1
1
  * [CHANGELOG.md]() - [README.md]() - [package.json]()
2
- * [Workspace<vcl>](/Library/vcl-comps/devtools/Workspace$/vcl.js)
2
+ * [Workspace<vcl>](/Library/vcl-comps/devtools/Workspace$/vcl.js) - [.js]()
3
+
4
+ # `0728` Control.prototype.makeVisible
5
+
6
+ Been working on coding in Markdown documents, basically in order to be able print results in the workspace console. Therefore the method `p()` has been introduced. It cancels the behaviour of opening a document while linking a link. Instead it evaluates the code and print its result in the workspace console.
7
+
8
+ So, now we can do something like:
9
+
10
+ * ```[`123`](`${p(:)}`)``` ==> [`123`](`${p(:)}`) - check the console after clicking 123
11
+
12
+ However, the console doesn't show yet automatically. Therefore the method `Control.prototype.makeVisible` is introduced. It will call the method `Control.prototype.show` and travel up in the parent-hierarchy and call more in case necessary.
13
+
14
+ * makeVisible() already exists in vcl/ui/Tab.prototype.
3
15
 
4
16
  # `0519` vcl/Factory `#CVLN-20220519-1`
5
17
 
@@ -57,8 +69,12 @@
57
69
  * [Popup](src/ui/:.js) - [Ace](src/ui/:.js) - [Console](src/ui/:.js)
58
70
  * [Form](src/ui/:.js) - [FormContainer](src/ui/:.js)
59
71
  * [List](src/ui/:.js) | [ListColumn](src/ui/:.js) - [ListBody](src/ui/:.js) - [ListFooter](src/ui/:.js) - [ListHeader](src/ui/:.js) - [ListRow](src/ui/:.js)
60
- * [Node](src/ui/:.js) [.closeable](src/ui/Node:.js)
61
- * [Sizer](src/ui/:.js) - [Tab](src/ui/:.js) - [Tabs](src/ui/:.js) - [Tree](src/ui/:.js)
72
+ * [Sizer](src/ui/:.js)
73
+ * [Tabs](src/ui/:.js)
74
+ * [Tab](src/ui/:.js)
75
+ * [Tree](src/ui/:.js)
76
+ * [Node](src/ui/:.js)
77
+ * [.closeable](src/ui/Node:.js)
62
78
 
63
79
 
64
80
  # resources
package/CHANGELOG.md CHANGED
@@ -1,3 +1,22 @@
1
+ ### 2022/07/28 - 1.1.68
2
+
3
+ * 768156d - fixes an issue where the vertical scrollbar was not accesible on macOS
4
+ * cd60d4b - introduces new methods for vcl/Control:
5
+ * reflectStates,
6
+ * makeVisible and
7
+ * selectVisible
8
+ * cd60d4b - changing some css/rendering details for Tree and Node
9
+
10
+ ### 2022/07/04 - 1.1.67
11
+
12
+ * 7dc04fb - adds Component.prototype.getTimeout
13
+ * 52bebc9 - introducing Query.prototype.error
14
+ * 18cd481 - destroying element upon remove (seems decent)
15
+
16
+ ### 2022/06/27 - 1.1.66
17
+
18
+ * 07c6e83 - introducing onError event-property
19
+
1
20
  ### 2022/06/27 - 1.1.65
2
21
 
3
22
  * 52c79ea - fixes bug where applyClasses was called without a _node being allocated/available
@@ -10,7 +29,7 @@
10
29
  * ca79dd6 - preventDefault when clicked A
11
30
  * 0e3c6e0 - rendering pending values as -
12
31
  * d1aeeae - fixes executesAction enum item No -> no
13
- * 2239c5b - cosmetic (5 days ago) <Ralph Kazemier>
32
+ * 2239c5b - cosmetic
14
33
 
15
34
  ### 2022/05/31 - 1.1.63
16
35
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cavalion-vcl",
3
- "version": "1.1.65",
3
+ "version": "1.1.68",
4
4
  "description": "Visual Component Library for vcl-comps",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/src/Component.js CHANGED
@@ -235,7 +235,7 @@ define(function (require) {
235
235
  }
236
236
  return this.setTimeout(name, f, 0, args);
237
237
  },
238
- setTimeout: function (name, f, ms, args) {
238
+ setTimeout: function(name, f, ms, args) {
239
239
  /**
240
240
  * @param name Used to identify the timeout. Successive calls will cancel a previous timeout with the same name.
241
241
  * @param f {String/Function} Identifies the function which should be called when at least ms has passed. Optional, when omitted it defaults to the same value as name. A string value to identify a member function or simply a reference to a function.
@@ -301,6 +301,13 @@ define(function (require) {
301
301
 
302
302
  return (this._timeouts[name] = js.setTimeout(g, ms, this._timeouts[name]));
303
303
  },
304
+ getTimeout: function(name) {
305
+ /**
306
+ * @param name Used to identify the timeout.
307
+ * @returns The timeout function set, if any, otherwise undefined
308
+ */
309
+ return this._timeouts[name];
310
+ },
304
311
  hasTimeout: function(name) {
305
312
  return this._timeouts.hasOwnProperty(name);
306
313
  },
package/src/Control.js CHANGED
@@ -958,6 +958,25 @@ define(function(require) {
958
958
  }
959
959
  }
960
960
  },
961
+ reflectStates: function(states) {
962
+ if(typeof states === "string") {
963
+ states = states.split(",").map(state => ControlState[state]);
964
+ }
965
+
966
+ states.forEach(state => {
967
+ switch(state) {
968
+ case ControlState.showing:
969
+ this.makeVisible();
970
+ break;
971
+
972
+ case ControlState.selected:
973
+ this.setSelected(true);
974
+ break;
975
+ }
976
+
977
+ })
978
+
979
+ },
961
980
 
962
981
  // scrollIntoView: function() {
963
982
  // this.nodeNeeded();
@@ -1084,6 +1103,21 @@ define(function(require) {
1084
1103
  hide: function() {
1085
1104
  this.setVisible(false);
1086
1105
  },
1106
+ makeVisible: function(control) {
1107
+ var parent = this._parent;
1108
+ if(this._parent && !this._parent.isVisible()) {
1109
+ this._parent.makeVisible();
1110
+ this._parent.update(() => this.makeVisible());
1111
+ return;
1112
+ }
1113
+ if(!this.isVisible()) {
1114
+ this.show();
1115
+ }
1116
+ },
1117
+ selectVisible: function() {
1118
+ this.setSelected(true);
1119
+ this.makeVisible();
1120
+ },
1087
1121
 
1088
1122
  allowsUpdateChildren: function() {
1089
1123
  return this.isShowing();
@@ -47,6 +47,18 @@ define(function(require) {
47
47
  this._monitors = [];
48
48
  this._pageReqs = [];
49
49
  },
50
+ error: function(e) {
51
+ if(this._onError) {
52
+ this._onError(e);
53
+ } else {
54
+ if(e && e.responseJSON && e.responseJSON.message) {
55
+ console.error(e.responseJSON.message, e);
56
+ throw e;
57
+ }
58
+ console.error(e);
59
+ throw e;
60
+ }
61
+ },
50
62
  loaded: function() {
51
63
  /** @overrides ../vcl/Compopnent.prototype.loaded */
52
64
  return this.inherited(arguments);
@@ -284,12 +296,7 @@ define(function(require) {
284
296
  }
285
297
  return res;
286
298
  }).catch(function(e) {
287
- if(e && e.responseJSON && e.responseJSON.message) {
288
- console.error(e.responseJSON.message, e)
289
- throw e;
290
- }
291
- console.error(e);
292
- throw e;
299
+ me.error(e);
293
300
  })
294
301
  );
295
302
 
@@ -602,6 +609,12 @@ define(function(require) {
602
609
  /* This method provides an interface to dynamically determine the request criteria, based upon for example user input. This method must return a criteria object. The function receives the criteria as they are currently indicated by its properties. Return null to prevent the request from going out.
603
610
  */
604
611
  }
612
+ },
613
+ "onError": {
614
+ type: Type.EVENT,
615
+ f: function(e) {
616
+ /* This method provides an interface to handle errors, if not set an error will be thrown and logged to the console */
617
+ }
605
618
  }
606
619
  }
607
620
  }));
@@ -34,7 +34,7 @@
34
34
  elem.setTimeout("disappear", () => {
35
35
  var h = elem.on("transitionend", () => {
36
36
  elem.un(h);
37
- elem.setParent(null);
37
+ elem.destroy();
38
38
  });
39
39
  elem.replaceClass("appear", "disappear");
40
40
  }, timeout_ !== undefined ? timeout_ : timeout);
package/src/ui/List.js CHANGED
@@ -58,7 +58,8 @@ define(function(require) {
58
58
  position: "absolute",
59
59
  width: "1px",
60
60
  height: "1px",
61
- overflow: "hidden"
61
+ overflow: "hidden",
62
+ 'z-index': 2
62
63
  }
63
64
  },
64
65
  "&.header-invisible .{./ListHeader}": "height:0;"
package/src/ui/Tab.js CHANGED
@@ -168,7 +168,14 @@ define(function(require) {
168
168
  this.setState("invalidated", true);
169
169
  }
170
170
  },
171
-
171
+
172
+ makeVisible: function(control) {
173
+ this.inherited(arguments);
174
+ if(!control && this._parent) {
175
+ this._parent.makeVisible(this);
176
+ }
177
+ },
178
+
172
179
  getControl: function() {
173
180
  return this._control;
174
181
  },
package/src/ui/Tabs.js CHANGED
@@ -210,17 +210,21 @@ define(function(require) {
210
210
  // }
211
211
  // },
212
212
  makeVisible: function(control) {
213
- /*- this assumes horizontal scrolling only */
214
- control.scrollIntoView();
215
- // HACK
216
- this._node.scrollTop = 0;
217
- this.nextTick("position-scrollbar", function() {
218
- if(this._node.scrollLeft < 100) {
219
- this._node.scrollLeft = 0;
220
- } else {
221
- this._node.scrollLeft += 100;
222
- }
223
- }.bind(this));
213
+ if(control) {
214
+ /*- this assumes horizontal scrolling only */
215
+ control.scrollIntoView();
216
+ // HACK
217
+ this.nodeNeeded().scrollTop = 0;
218
+ this.nextTick("position-scrollbar", function() {
219
+ if(this._node.scrollLeft < 100) {
220
+ this._node.scrollLeft = 0;
221
+ } else {
222
+ this._node.scrollLeft += 100;
223
+ }
224
+ }.bind(this));
225
+ } else {
226
+ return this.inherited(arguments);
227
+ }
224
228
  },
225
229
  initializeNodes: function(control) {
226
230
  /** @overrides ../Control.prototype.initializeNodes */
package/src/ui/Tree.js CHANGED
@@ -74,13 +74,14 @@ define(function (require) {
74
74
  }
75
75
  },
76
76
  ">.text": {
77
- "input[type=checkbox]": `position:relative;top:${checkbox_top}px;`,
77
+ 'input[type=checkbox]': `position:relative;top:${checkbox_top}px;`,
78
78
  cursor: "pointer",
79
79
  position: "relative",
80
80
  // width: "100%",
81
81
  display: 'inline-block',
82
- "margin-left": "2px",
82
+ 'margin-left': "2px",
83
83
  padding: "3px 4px 3px 4px",
84
+ // 'vertical-align': "top"
84
85
  },
85
86
  "&.selected": {
86
87
  ">.selection": {
@@ -231,10 +232,14 @@ define(function (require) {
231
232
  this.dispatch("nodesneeded", null);
232
233
  },
233
234
  makeVisible: function(childNode) {
234
- var node = this.nodeNeeded();
235
- var pos = jquery(childNode.nodeNeeded()).position();
236
- var top = this.getAbsoluteRect().height / 3;
237
- node.scrollTop -= (top - pos.top);
235
+ if(childNode) {
236
+ var node = this.nodeNeeded();
237
+ var pos = jquery(childNode.nodeNeeded()).position();
238
+ var top = this.getAbsoluteRect().height / 3;
239
+ node.scrollTop -= (top - pos.top);
240
+ } else {
241
+ return this.inherited(arguments);
242
+ }
238
243
  },
239
244
 
240
245
  do_keyup: function(evt) {