cavalion-vcl 1.1.67 → 1.1.69

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,7 +1,74 @@
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
3
 
4
- # `0519` vcl/Factory `#CVLN-20220519-1`
4
+ # `2022/10/28-3` vcl/Component.getKeysByUri - bug (?!!)
5
+
6
+ Found a bug in [Component](src/:.js). Amazing that that still happens, even in a function used so F'n frequently...
7
+
8
+ * `#VA-20221028-3` Characters missing when no <>
9
+
10
+ ![20221028-172348-nnqDdO](https://raw.githubusercontent.com/relluf/screenshots/master/20221028-172348-nnqDdO.png)
11
+
12
+ ![20221028-172420-PT3Fro](https://raw.githubusercontent.com/relluf/screenshots/master/20221028-172420-PT3Fro.png)
13
+
14
+ Squeezed and fixed:
15
+
16
+ ![20221028-172807-fO3Z56](https://raw.githubusercontent.com/relluf/screenshots/master/20221028-172807-fO3Z56.png)
17
+
18
+ # `2022/10/28-2` √ Console should hint textContent
19
+
20
+ Many times I need to scroll the console horizontally to read error messages or other large strings. Let's try to hint that content while mousing over it.
21
+
22
+ * `#VA-20221028-2`
23
+
24
+ The following works [nicely](//.js) and can be easily implemented on [Console](src/ui/:.js) itself, by hooking the mousemove-event:
25
+
26
+ >> const setTarget = (value) => {
27
+ const target = app.vars("target");
28
+ if(value !== target) {
29
+ if(target) {
30
+ target.title = target.title$$;
31
+ delete target.title$$;
32
+ }
33
+ value.title$$ = value.title;
34
+ value.title = value.textContent;
35
+ app.vars("target", value);
36
+ app.print("target", app.vars("target"));
37
+ }
38
+ };
39
+
40
+ >> app._onDispatchChildEvent = (component, name, evt, f, args) => {
41
+ if(name === "mousemove" && component instanceof Console) {
42
+ if(evt.target.classList.contains("value") && evt.target.parentNode.classList.contains("node")) {
43
+ setTarget(evt.target);
44
+ } else {
45
+ setTarget(null);
46
+ }
47
+ }
48
+ };
49
+
50
+ # `2022/10/28-1` √ List is buggy
51
+
52
+ Finally got to work on (and fix( that annoying bug where loading the second page triggered the "busy"-state/class (again), resulting in way too much animated-loading-image showing.
53
+
54
+ * `#VA-20221028-1`
55
+ * √ show loading image too long => use _count instead of _topRow
56
+ * √ error causes loading state to continue forever
57
+ * √ better error handling in entities/Query
58
+
59
+ # `2022/07/28` Control.prototype.makeVisible
60
+
61
+ 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.
62
+
63
+ So, now we can do something like:
64
+
65
+ * ```[`123`](`${p(:)}`)``` ==> [`123`](`${p(:)}`) - check the console after clicking 123
66
+
67
+ 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.
68
+
69
+ * makeVisible() already exists in vcl/ui/Tab.prototype.
70
+
71
+ # `2022/05/19` vcl/Factory `#CVLN-20220519-1`
5
72
 
6
73
  * how is the implicit base determined in `["", {}, []]`
7
74
 
@@ -9,7 +76,7 @@
9
76
  => Factory.load
10
77
  => Factory.prototype.load
11
78
 
12
- # `0417` prototypes
79
+ # `2022/04/17` prototypes
13
80
 
14
81
  > * [App](src/prototypes/:.js) - <= _#window is instantiated here (weirdly not in .desktop)_
15
82
  * [.console](src/prototypes/App:.js) << _hotkeys_ _probably deprecated_
@@ -36,7 +103,7 @@
36
103
  * [Query](src/prototypes/ui/entities/:.js) - [.scaffold](src/prototypes/ui/entities/Query:.js) - [scaffold.future](src/prototypes/ui/entities/Query:.js)
37
104
  * [QueryFilters](src/prototypes/ui/entities/:.js)
38
105
 
39
- # `0403` classes
106
+ # `2022/04/03` classes
40
107
 
41
108
  * [Factory](src/:.js) [.parse](src/Factory:.js) - [Reader](src/:.js) - [Writer](src/:.js)
42
109
  * [CssRules](src/:.js) - [Listeners](src/:.js)
@@ -57,9 +124,12 @@
57
124
  * [Popup](src/ui/:.js) - [Ace](src/ui/:.js) - [Console](src/ui/:.js)
58
125
  * [Form](src/ui/:.js) - [FormContainer](src/ui/:.js)
59
126
  * [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)
62
-
127
+ * [Sizer](src/ui/:.js)
128
+ * [Tabs](src/ui/:.js)
129
+ * [Tab](src/ui/:.js)
130
+ * [Tree](src/ui/:.js)
131
+ * [Node](src/ui/:.js)
132
+ * [.closeable](src/ui/Node:.js)
63
133
 
64
134
  # resources
65
135
 
package/CHANGELOG.md CHANGED
@@ -1,10 +1,26 @@
1
- * ### 2022/07/04 - 1.1.67
1
+ ### 2022/10/30 - 1.1.69
2
+
3
+ `#VA-20221028-1`, `-2` & `-3`
4
+
5
+ * ebae088 - lowers SELECT\_TIMEMOUT\_MS for [vcl/ui/Tab(s)](src/ui/Tabs.js)
6
+ * 4bd2244 - simplifies ids used in [Component.protoype.nextTick]()()
7
+
8
+ ### 2022/07/28 - 1.1.68
9
+
10
+ * 768156d - fixes an issue where the vertical scrollbar was not accesible on macOS
11
+ * cd60d4b - introduces new methods for vcl/Control:
12
+ * reflectStates,
13
+ * makeVisible and
14
+ * selectVisible
15
+ * cd60d4b - changing some css/rendering details for Tree and Node
16
+
17
+ ### 2022/07/04 - 1.1.67
2
18
 
3
19
  * 7dc04fb - adds Component.prototype.getTimeout
4
20
  * 52bebc9 - introducing Query.prototype.error
5
21
  * 18cd481 - destroying element upon remove (seems decent)
6
22
 
7
- * ### 2022/06/27 - 1.1.66
23
+ ### 2022/06/27 - 1.1.66
8
24
 
9
25
  * 07c6e83 - introducing onError event-property
10
26
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cavalion-vcl",
3
- "version": "1.1.67",
3
+ "version": "1.1.69",
4
4
  "description": "Visual Component Library for vcl-comps",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/src/Component.js CHANGED
@@ -13,7 +13,7 @@ define(function (require) {
13
13
  var ILLEGAL_COMPONENT_NAME_CHARS = "/";
14
14
  var ILLEGAL_COMPONENT_URI_CHARS = "/";
15
15
 
16
- var all = [];
16
+ var all = [], nextTick = 1;
17
17
 
18
18
  Component = Component(require, {
19
19
  prototype: {
@@ -231,7 +231,7 @@ define(function (require) {
231
231
  if(typeof name === "function") {
232
232
  args = f;
233
233
  f = name;
234
- name = "nextTick-" + Date.now();
234
+ name = "nextTick-" + (nextTick++);
235
235
  }
236
236
  return this.setTimeout(name, f, 0, args);
237
237
  },
@@ -1338,7 +1338,11 @@ define(function (require) {
1338
1338
  r.classes = uri[0].split("/").pop().split(".");
1339
1339
  r.classes.shift();
1340
1340
 
1341
- uri = uri[0].substring(0, uri[0].length - r.classes.join(".").length - 1);
1341
+ if(r.classes.length) {
1342
+ uri = uri[0].substring(0, uri[0].length - r.classes.join(".").length - 1);
1343
+ } else {
1344
+ uri = uri[0];
1345
+ }
1342
1346
 
1343
1347
  r.template = "";
1344
1348
  r.specializer = "";
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();
@@ -53,10 +53,13 @@ define(function(require) {
53
53
  } else {
54
54
  if(e && e.responseJSON && e.responseJSON.message) {
55
55
  console.error(e.responseJSON.message, e);
56
- throw e;
56
+ this.print(new Error(e.responseJSON.message));
57
+ // throw e;
58
+ } else {
59
+ console.error(e);
60
+ this.print(new Error(e));
57
61
  }
58
- console.error(e);
59
- throw e;
62
+ // throw e;
60
63
  }
61
64
  },
62
65
  loaded: function() {
@@ -275,28 +278,40 @@ define(function(require) {
275
278
  criteria.attributes || this._attributes,
276
279
  criteria,
277
280
  criteria.opts
278
- ).then(function(res) {
281
+ )
282
+ .then(res => {
279
283
  /*- if this response does not belong to the current request */
280
- if(me._pageReqs && (me._request !== me._pageReqs[page])) {
281
- // console.debug(me._entity, "requestPage: page", page, "receveid, but IGNORED");
284
+ if(this._pageReqs && (this._request !== this._pageReqs[page])) {
285
+ // console.debug(this._entity, "requestPage: page", page, "receveid, but IGNORED");
282
286
  /* ...it should be ignored */
283
287
  return res;
284
288
  }
285
289
 
286
- delete me._request;
290
+ delete this._request;
287
291
  if(res instanceof Error) {
288
- console.error(me._entity, "requestPage: page", page, "error received", err);
292
+ console.error(this._entity, "requestPage: page", page, "error received", err);
289
293
  } else {
290
- // console.debug(me._entity, "requestPage: page", page, "received", {time: Date.now() - start, res: res});
294
+ // console.debug(this._entity, "requestPage: page", page, "received", {time: Date.now() - start, res: res});
291
295
  }
292
- me.processResult(res, page, criteria);
296
+ this.processResult(res, page, criteria);
293
297
 
294
- if(!me.isBusy()) {
295
- me.notifyEvent(SourceEvent.busyChanged, false, page);
296
- }
297
298
  return res;
298
- }).catch(function(e) {
299
- me.error(e);
299
+ })
300
+ .catch(e => {
301
+ /*- if this response does not belong to the current request */
302
+ if(this._pageReqs && (this._request !== this._pageReqs[page])) {
303
+ // console.debug(this._entity, "requestPage: page", page, "receveid, but IGNORED");
304
+ /* ...it should be ignored */
305
+ return res;
306
+ }
307
+
308
+ delete this._request;
309
+ this.error(e);
310
+ })
311
+ .finally(() => {
312
+ if(!this.isBusy()) {
313
+ this.notifyEvent(SourceEvent.busyChanged, false, page);
314
+ }
300
315
  })
301
316
  );
302
317
 
package/src/ui/Console.js CHANGED
@@ -138,6 +138,7 @@ define(function(require) {
138
138
  _content: "<div class='console'></div><div class='cmdline'><input></div>",
139
139
  _history: null,
140
140
  _onEvaluate: null,
141
+ _mouseTarget: null,
141
142
 
142
143
  constructor: function() {
143
144
  this._history = [];
@@ -278,6 +279,28 @@ define(function(require) {
278
279
 
279
280
  return r;
280
281
  },
282
+
283
+ onmousemove: function(evt) {
284
+ if(evt.target.classList.contains("value") && evt.target.parentNode.classList.contains("node")) {
285
+ this.setMouseTarget(evt.target);
286
+ } else {
287
+ this.setMouseTarget(null);
288
+ }
289
+ },
290
+ setMouseTarget: function(value) {
291
+ if(value !== this._mouseTarget) {
292
+ if(this._mouseTarget) {
293
+ this._mouseTarget.title = this._mouseTarget.title$$;
294
+ delete this._mouseTarget.title$$;
295
+ }
296
+ this._mouseTarget = value;
297
+ if(value) {
298
+ value.title$$ = value.title;
299
+ value.title = value.textContent;
300
+ }
301
+ }
302
+ },
303
+
281
304
  setFocus: function(evt) {
282
305
  /** @overrides ../../Control.prototype.setFocus */
283
306
  this.nodeNeeded();
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;"
@@ -479,8 +480,10 @@ define(function(require) {
479
480
  var column = this._columns[i];
480
481
  if(column.isVisible() === true) {
481
482
  if(i < this._header._controls.length) {
483
+ // this.print("getBodyWidth-adding", parseInt(this._header._controls[i].getComputedStylePropValue("width"), 10));
482
484
  r += parseInt(this._header._controls[i].getComputedStylePropValue("width"), 10);
483
485
  } else {
486
+ // this.print("getBodyWidth-adding", column.getWidth());
484
487
  r += column.getWidth();
485
488
  }
486
489
  }
@@ -670,10 +673,8 @@ define(function(require) {
670
673
  },
671
674
  updateColumns: function() {
672
675
  var updateColumns = this.updateColumns;
673
- this.updateColumns = function() {
674
- console.log("updateColumns blocked");
675
- };
676
676
 
677
+ this.updateColumns = () => console.log("updateColumns blocked");
677
678
  this.resetColumnAutoWidth();
678
679
 
679
680
  try {
@@ -766,9 +767,12 @@ define(function(require) {
766
767
  break;
767
768
 
768
769
  case SourceEvent.busyChanged:
769
- if((data && this._topRow > 0) || this.hasClass("ignore-busy")) { /* TODO what about scrolling up? */
770
+ if((data && this._count > 0) || this.hasClass("ignore-busy")) { /* TODO what about scrolling up? */
770
771
  return;
771
772
  }
773
+
774
+ this.app().print(js.sf("data: %s => busy: %s, count: %s, topRow: %s", data, this.hasClass("busy"), this._count, this._topRow))
775
+
772
776
  this.setTimeout("update-busy", function() {
773
777
  if(data && !this.hasClass("busy")) {
774
778
  this.addClass("busy");
package/src/ui/Tab.js CHANGED
@@ -4,7 +4,7 @@ define(function(require) {
4
4
  var Control = require("../Control");
5
5
  var Element = require("./Element");
6
6
 
7
- var SELECT_TIMEOUT_MS = 128;
7
+ var SELECT_TIMEOUT_MS = 50;
8
8
 
9
9
  var Tab = {
10
10
  statics: {
@@ -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) {