cavalion-vcl 1.1.68 → 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,62 @@
1
1
  * [CHANGELOG.md]() - [README.md]() - [package.json]()
2
2
  * [Workspace<vcl>](/Library/vcl-comps/devtools/Workspace$/vcl.js) - [.js]()
3
3
 
4
- # `0728` Control.prototype.makeVisible
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
5
60
 
6
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.
7
62
 
@@ -13,7 +68,7 @@ However, the console doesn't show yet automatically. Therefore the method `Contr
13
68
 
14
69
  * makeVisible() already exists in vcl/ui/Tab.prototype.
15
70
 
16
- # `0519` vcl/Factory `#CVLN-20220519-1`
71
+ # `2022/05/19` vcl/Factory `#CVLN-20220519-1`
17
72
 
18
73
  * how is the implicit base determined in `["", {}, []]`
19
74
 
@@ -21,7 +76,7 @@ However, the console doesn't show yet automatically. Therefore the method `Contr
21
76
  => Factory.load
22
77
  => Factory.prototype.load
23
78
 
24
- # `0417` prototypes
79
+ # `2022/04/17` prototypes
25
80
 
26
81
  > * [App](src/prototypes/:.js) - <= _#window is instantiated here (weirdly not in .desktop)_
27
82
  * [.console](src/prototypes/App:.js) << _hotkeys_ _probably deprecated_
@@ -48,7 +103,7 @@ However, the console doesn't show yet automatically. Therefore the method `Contr
48
103
  * [Query](src/prototypes/ui/entities/:.js) - [.scaffold](src/prototypes/ui/entities/Query:.js) - [scaffold.future](src/prototypes/ui/entities/Query:.js)
49
104
  * [QueryFilters](src/prototypes/ui/entities/:.js)
50
105
 
51
- # `0403` classes
106
+ # `2022/04/03` classes
52
107
 
53
108
  * [Factory](src/:.js) [.parse](src/Factory:.js) - [Reader](src/:.js) - [Writer](src/:.js)
54
109
  * [CssRules](src/:.js) - [Listeners](src/:.js)
@@ -76,7 +131,6 @@ However, the console doesn't show yet automatically. Therefore the method `Contr
76
131
  * [Node](src/ui/:.js)
77
132
  * [.closeable](src/ui/Node:.js)
78
133
 
79
-
80
134
  # resources
81
135
 
82
136
  * ...
package/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
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
+
1
8
  ### 2022/07/28 - 1.1.68
2
9
 
3
10
  * 768156d - fixes an issue where the vertical scrollbar was not accesible on macOS
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cavalion-vcl",
3
- "version": "1.1.68",
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 = "";
@@ -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
@@ -480,8 +480,10 @@ define(function(require) {
480
480
  var column = this._columns[i];
481
481
  if(column.isVisible() === true) {
482
482
  if(i < this._header._controls.length) {
483
+ // this.print("getBodyWidth-adding", parseInt(this._header._controls[i].getComputedStylePropValue("width"), 10));
483
484
  r += parseInt(this._header._controls[i].getComputedStylePropValue("width"), 10);
484
485
  } else {
486
+ // this.print("getBodyWidth-adding", column.getWidth());
485
487
  r += column.getWidth();
486
488
  }
487
489
  }
@@ -671,10 +673,8 @@ define(function(require) {
671
673
  },
672
674
  updateColumns: function() {
673
675
  var updateColumns = this.updateColumns;
674
- this.updateColumns = function() {
675
- console.log("updateColumns blocked");
676
- };
677
676
 
677
+ this.updateColumns = () => console.log("updateColumns blocked");
678
678
  this.resetColumnAutoWidth();
679
679
 
680
680
  try {
@@ -767,9 +767,12 @@ define(function(require) {
767
767
  break;
768
768
 
769
769
  case SourceEvent.busyChanged:
770
- 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? */
771
771
  return;
772
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
+
773
776
  this.setTimeout("update-busy", function() {
774
777
  if(data && !this.hasClass("busy")) {
775
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: {