cavalion-vcl 1.1.52 → 1.1.55

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 ADDED
@@ -0,0 +1,47 @@
1
+ * [CHANGELOG.md]() - [README.md]() - [package.json]()
2
+ * [Workspace<vcl>](/Library/vcl-comps/devtools/Workspace$/vcl.js)
3
+
4
+ ---
5
+
6
+ ### `2022/04/03`
7
+
8
+ * ...
9
+
10
+ # classes
11
+
12
+ * [Factory](src/:.js) [.parse](src/Factory:.js) - [Reader](src/:.js) - [Writer](src/:.js)
13
+ * [CssRules](src/:.js) - [Listeners](src/:.js)
14
+ * [Component](src/:.js) [.query](src/Component:.js)
15
+ * [Action](src/:.js) - [Application](src/:.js)
16
+ * [data](src/:/) / [Array](src/data/:.js)
17
+ * [entities](src/:/) / [Query](src/entities/:.js) - [Instance](src/entities/:.js)
18
+ * [Control](src/:.js) < [ui](src/:/) /
19
+ * [Element](src/ui/:.js) < [LargeIcon](src/ui/:.js) << _smdl - alert_
20
+ * [Button](src/ui/:.js) < [PopupButton](src/ui/:.js)
21
+ * [Select](src/ui/:.js)
22
+ * [Input](src/ui/:.js) < [Checkbox](src/ui/:.js) - [Combobox](src/ui/:.js) - [DatePicker](src/ui/:.js)
23
+ * [Container](src/ui/:.js)
24
+ * [Group](src/ui/:.js)
25
+ * [Bar](src/ui/:.js)
26
+ * [CheckGroup](src/ui/:.js)
27
+ * [Panel](src/ui/:.js)
28
+ * [Popup](src/ui/:.js) - [Ace](src/ui/:.js) - [Console](src/ui/:.js)
29
+ * [Form](src/ui/:.js) - [FormContainer](src/ui/:.js)
30
+ * [List](src/ui/:.js) | [ListColumn](src/ui/:.js) - [ListBody](src/ui/:.js) - [ListFooter](src/ui/:.js) - [ListHeader](src/ui/:.js) - [ListRow](src/ui/:.js)
31
+ * [Node](src/ui/:.js) [.closeable](src/ui/Node:.js)
32
+ * [Sizer](src/ui/:.js) - [Tab](src/ui/:.js) - [Tabs](src/ui/:.js) - [Tree](src/ui/:.js)
33
+
34
+ # prototypes
35
+
36
+ > * [App](src/prototypes/:.js) << _#window is instantiated here (weirdly not in .desktop)_
37
+ * [.console](src/prototypes/App:.js)
38
+ * [.desktop](src/prototypes/App:.js)
39
+ * [.framework7](src/prototypes/App:.js)
40
+ * [.openform](src/prototypes/App:.js)
41
+ * [.scaffold](src/prototypes/App:.js)
42
+ * [.toast](src/prototypes/App:.js)
43
+ * [.v1](src/prototypes/App:.js)
44
+
45
+ # resources
46
+
47
+ * ...
package/CHANGELOG.md CHANGED
@@ -1,6 +1,18 @@
1
+ ### 2022/04/15 - 1.1.55
2
+
3
+ * Minor fixes in vcl/Control-style methodes
4
+
5
+ ### 2022/04/06 - 1.1.54
6
+
7
+ - **ui/List**: Adding support for UTC to `formatDate()`
8
+
9
+ ### 2022/04/03 - 1.1.53
10
+
11
+ - **Control**: Introducing `swapClass`
12
+
1
13
  ### 2022/03/28 - 1.1.52
2
14
 
3
- * Refactoring animation classes for glassy-containers
15
+ * Refactoring animation classes for `glassy-overlay` containers
4
16
 
5
17
  ### 2022/03/22
6
18
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cavalion-vcl",
3
- "version": "1.1.52",
3
+ "version": "1.1.55",
4
4
  "description": "Visual Component Library for vcl-comps",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/src/Control.js CHANGED
@@ -613,7 +613,7 @@ define(function(require) {
613
613
  },
614
614
 
615
615
 
616
- /**-- style/css/classes */
616
+ /**-- style/css/classes -- TODO 2022/04/12 it's a bit messy/asymmetric when update() is called/or not*/
617
617
  getComputedStyle: function() {
618
618
  if(this._computedStyle === null) {
619
619
  this._computedStyle = HtmlElement.getComputedStyle(this.nodeNeeded());
@@ -754,12 +754,11 @@ define(function(require) {
754
754
 
755
755
  Replaced with following fragment
756
756
  */
757
-
758
757
  classes.forEach(function(cls, index) {
759
758
  if(this.hasClass(cls)) {
760
- this.removeClass(cls);
759
+ this.removeClass(cls, true);
761
760
  } else {
762
- this.addClass(cls);
761
+ this.addClass(cls, true);
763
762
  }
764
763
  }, this);
765
764
  }
@@ -778,6 +777,15 @@ define(function(require) {
778
777
  }
779
778
  }
780
779
  },
780
+ swapClass: function(a, b) {
781
+ if(this.hasClass(a)) {
782
+ this.removeClass(a);
783
+ this.addClass(b);
784
+ } else if(this.hasClass(b)) {
785
+ this.removeClass(b);
786
+ this.addClass(a);
787
+ }
788
+ },
781
789
  addClass: function(value, directly) {
782
790
 
783
791
  //directly && console.warn("addClass directly can be replaced with a call to _update");
@@ -850,6 +858,7 @@ define(function(require) {
850
858
  }
851
859
  },
852
860
  removeClasses: function(classes, directly) {
861
+ // why does this method exist where all the others in this group accept classes
853
862
  if(typeof classes === "string") {
854
863
  classes = classes.split(" ");
855
864
  }
@@ -878,7 +887,21 @@ define(function(require) {
878
887
  clearClass: function(classes) {
879
888
  Array.as(classes).forEach(cls => { while(this.hasClass(cls)) this.removeClass(cls); });
880
889
  },
881
-
890
+ syncClass: function(classes, states) {
891
+ // classes = classes || classes?.split(" ")
892
+ if(classes.split) {
893
+ classes = classes.split(" ");
894
+ }
895
+ classes.forEach((cls, index) => {
896
+ var state = this.hasClass(cls);
897
+ if(state && !states[index]) {
898
+ this.removeClass(cls);
899
+ } else if(!state && states[index]) {
900
+ this.addClass(cls)
901
+ }
902
+ });
903
+ this.applyClasses();
904
+ },
882
905
  hasState: function(state) {
883
906
  /** @param state {String} ControlState * @returns
884
907
  */
@@ -17,15 +17,16 @@
17
17
  align: "client",
18
18
  classes: "animated",
19
19
  css: {
20
- // "font-family": "SF Pro Text, SF UI Text, system-ui, Helvetica Neue, Helvetica, Lucida Grande, Arial, sans-serif",
21
- "font-family": "Lucida Grande, Arial, sans-serif",
22
- "font-size": "9pt",
23
20
  ".{./Button}": {
24
21
  "font-family": "Lucida Grande, Arial, sans-serif",
25
22
  "font-size": "9pt"
26
23
  },
24
+ // "font-family": "SF Pro Text, SF UI Text, system-ui, Helvetica Neue, Helvetica, Lucida Grande, Arial, sans-serif",
25
+ "font-family": "Lucida Grande, Arial, sans-serif",
26
+ "font-size": "9pt",
27
27
  ".with-shadow": "box-shadow:rgba(0, 0, 0, 0.4) 0px 1px 2px 0px;",
28
28
  ".transparent": "background-color:transparent;",
29
+
29
30
  ".glassy-overlay": {
30
31
  "": "pointer-events: none; color:rgba(5,5,5,0.95); text-shadow: rgb(255 255 255) 0px 0px 12px, #00000094 0px 0px 5px;",
31
32
  ">.{./Element}": "pointer-events: auto;",
@@ -39,12 +40,6 @@
39
40
  ".loading": "background: rgba(155, 155, 155, 0.35) url(/shared/vcl/images/loading.gif) 50% 50% no-repeat;",
40
41
  ".rounded": "padding: 4px; border-radius: 5px;",
41
42
  ".animate-width-height": "transition: width 250ms ease-in, height 250ms ease-in;",
42
- // ".glassy": {
43
- // "": "background: rgba(155, 155, 155, 0.35); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);",
44
- // // "&:not(.no-animation)": "transition: backdrop-filter 350ms ease-in, -webkit-backdrop-filter 350ms ease-in;",
45
- // // "&:hover": "backdrop-filter: blur(25px); -webkit-backdrop-filter: blur(25px);"
46
- // },
47
- ".with-shadow": "box-shadow:rgba(0, 0, 0, 0.4) 0px 1px 2px 0px;",
48
43
  ".{./Node}": {
49
44
  "&.invisible-layer": "opacity: 0.4;",
50
45
  "&.seperator": "border-top:1px solid rgba(155,155,155,0.55);margin-top:2px;padding-top:2px;",
@@ -5,7 +5,7 @@ var HtmlElement = require("util/HtmlElement");
5
5
  var Element = require("vcl/ui/Element");
6
6
  var FormContainer = require("vcl/ui/FormContainer");
7
7
 
8
- $(["./App.openform.toast"], {
8
+ [["./App.openform.toast"], {
9
9
  onDispatchChildEvent: function(component, name, evt, f, args) {
10
10
  if(name === "touchstart") {
11
11
  if(!Fullscreen.hasRequested()) {
@@ -34,9 +34,9 @@ $(["./App.openform.toast"], {
34
34
  state && state.restore && state.restore(state);
35
35
  }
36
36
  }, [
37
- $i("window", [
38
- $("vcl/ui/FormContainer", "client", {
37
+ ["#window", [
38
+ ["vcl/ui/FormContainer", "client", {
39
39
  formUri: "./ui/forms/Portal<>"
40
- }),
41
- ])
42
- ]);
40
+ }],
41
+ ]]
42
+ ]];
package/src/ui/List.js CHANGED
@@ -460,12 +460,15 @@ define(function(require) {
460
460
  return (value instanceof Date) || (typeof value === "string" &&
461
461
  value.length === 24 && value.endsWith("Z"));
462
462
  },
463
- formatDate: function(value) {
463
+ formatDate: function(value, opts) {
464
464
  if(!(value instanceof Date)) value = new Date(value);
465
+ if(opts && opts.utc) {
466
+ return String.format("%d/%02d/%02d %02d:%02d", value.getUTCFullYear(), value.getUTCMonth() + 1,
467
+ value.getUTCDate(), value.getUTCHours(), value.getUTCMinutes());
468
+ }
469
+
465
470
  return String.format("%d/%02d/%02d %02d:%02d", value.getFullYear(), value.getMonth() + 1,
466
471
  value.getDate(), value.getHours(), value.getMinutes());
467
- // return String.format("%d/%02d/%d %02d:%02d", value.getDate(), value.getMonth() + 1,
468
- // value.getFullYear(), value.getHours(), value.getMinutes());
469
472
  },
470
473
 
471
474
  getBodyWidth: function() {