qcobjects 2.4.20-beta → 2.4.20

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.
@@ -13,10 +13,10 @@ name: "CodeQL"
13
13
 
14
14
  on:
15
15
  push:
16
- branches: [ master ]
16
+ branches: [ main ]
17
17
  pull_request:
18
18
  # The branches below must be a subset of the branches above
19
- branches: [ master ]
19
+ branches: [ "v2.3", "v2.4" ]
20
20
  schedule:
21
21
  - cron: '23 16 * * 2'
22
22
 
@@ -28,7 +28,7 @@ jobs:
28
28
  - uses: actions/checkout@v2
29
29
  - uses: actions/setup-node@v1
30
30
  with:
31
- node-version: 12
31
+ node-version: 14
32
32
  registry-url: https://registry.npmjs.org/
33
33
  - name: Set up NPM authentication
34
34
  run: echo "registry=https://registry.npmjs.org/:_authToken=${{secrets.NPM_TOKEN}}" >> ~/.npmrc
@@ -1,7 +1,7 @@
1
1
  # This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
2
2
  # For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
3
3
 
4
- name: Node.js Publish Beta version
4
+ name: Node.js Publish LTS version
5
5
 
6
6
  on:
7
7
  push:
@@ -28,7 +28,7 @@ jobs:
28
28
  - uses: actions/checkout@v2
29
29
  - uses: actions/setup-node@v1
30
30
  with:
31
- node-version: 12
31
+ node-version: 14
32
32
  registry-url: https://registry.npmjs.org/
33
33
  - name: Set up NPM authentication
34
34
  run: echo "registry=https://registry.npmjs.org/:_authToken=${{secrets.NPM_TOKEN}}" >> ~/.npmrc
package/QCObjects.js CHANGED
@@ -124,8 +124,8 @@
124
124
  if (typeof String.prototype.matchAll === "undefined"){
125
125
  String.prototype.matchAll = String.prototype.__mAll__;
126
126
  }
127
-
128
- var isBrowser = typeof window !== "undefined" && typeof window.self !== "undefined" && window === window.self;
127
+ var isDeno = (typeof window !== "undefined" && "Deno" in window);
128
+ var isBrowser = (typeof window !== "undefined" && typeof window.self !== "undefined" && window === window.self) && !isDeno;
129
129
  var _DOMCreateElement = function(elementName) {
130
130
  var _ret_;
131
131
  if (isBrowser) {
@@ -826,12 +826,12 @@
826
826
  return class {};
827
827
  case 1:
828
828
  name = arguments[0];
829
- type = Object;
829
+ type = class {};
830
830
  definition = {};
831
831
  break;
832
832
  case 2:
833
833
  name = arguments[0];
834
- type = Object;
834
+ type = class {};
835
835
  definition = arguments[1];
836
836
  break;
837
837
  case 3:
@@ -941,7 +941,7 @@
941
941
  self.__new__ = super.__new__.bind(self);
942
942
  self.__new__.call(self,_o_);
943
943
  }
944
- if (Object.hasOwnProperty.call(self,"_new_") && typeof self._new_.isCalled === "undefined") {
944
+ if (typeof self === "object" && Object.hasOwnProperty.call(self,"_new_") && typeof self._new_.isCalled === "undefined") {
945
945
  try {
946
946
  self._new_.call(self,_o_);
947
947
  self._new_.isCalled = true;
@@ -959,6 +959,10 @@
959
959
  }
960
960
  _new_ (){}
961
961
 
962
+ getClass () {
963
+ return Object.getPrototypeOf(this.constructor);
964
+ }
965
+
962
966
  css (_css) {
963
967
  if (typeof this["body"] !== "undefined" && this["body"]["style"] !== "undefined") {
964
968
  logger.debug("body style");
@@ -1760,16 +1764,18 @@
1760
1764
  } else {
1761
1765
  global.onload = _Ready;
1762
1766
  }
1767
+ Class("InheritClass", Object, {});
1763
1768
 
1764
1769
  /**
1765
1770
  * Dynamic Data Objects Class
1766
1771
  * Usage:
1767
1772
  * Class('TestDDO',{
1773
+ * data: {},
1768
1774
  * _new_ (){
1769
1775
  * this.ddo = New(DDO,{
1770
1776
  * instance:this,
1771
- * name:'ddo',
1772
- * value:0,
1777
+ * name:'data',
1778
+ * value:{},
1773
1779
  * fget (value){
1774
1780
  * logger.debug('returned value '+ value );
1775
1781
  * }
@@ -1778,7 +1784,31 @@
1778
1784
  * });
1779
1785
  *
1780
1786
  */
1781
- Class("DDO", Object, {
1787
+ class DDO extends ClassFactory ("InheritClass") {
1788
+ constructor({
1789
+ instance,
1790
+ name,
1791
+ fget,
1792
+ fset,
1793
+ value
1794
+ }) {
1795
+ super({
1796
+ instance,
1797
+ name,
1798
+ fget,
1799
+ fset,
1800
+ value
1801
+ });
1802
+ this._new_({
1803
+ instance,
1804
+ name,
1805
+ fget,
1806
+ fset,
1807
+ value
1808
+ });
1809
+
1810
+ }
1811
+
1782
1812
  _new_ ({
1783
1813
  instance,
1784
1814
  name,
@@ -1786,13 +1816,12 @@
1786
1816
  fset,
1787
1817
  value
1788
1818
  }) {
1789
- var _value;
1790
1819
  var ddoInstance = this;
1791
1820
  var name = (typeof name === "undefined") ? (ObjectName(ddoInstance)) : (name);
1792
1821
 
1793
1822
  Object.defineProperty(instance, name, {
1794
1823
  set(val) {
1795
- _value = val;
1824
+ let _value = val;
1796
1825
  logger.debug("value changed " + name);
1797
1826
  var ret;
1798
1827
  if (typeof fset !== "undefined" && typeof fset === "function") {
@@ -1800,12 +1829,14 @@
1800
1829
  } else {
1801
1830
  ret = _value;
1802
1831
  }
1832
+ instance["_"+name] = ret;
1803
1833
  return;
1804
1834
  },
1805
1835
  get() {
1836
+ let _value = instance["_"+name];
1806
1837
  logger.debug("returning value " + name);
1807
1838
  var is_ddo = function(v) {
1808
- if (typeof v === "object" && v.hasOwnProperty.call(v,"value")) {
1839
+ if (typeof v === "object" && Object.hasOwnProperty.call(v,"value")) {
1809
1840
  return v.value;
1810
1841
  }
1811
1842
  return v;
@@ -1821,9 +1852,8 @@
1821
1852
  });
1822
1853
  }
1823
1854
 
1824
- });
1825
-
1826
- Class("InheritClass", Object, {});
1855
+ }
1856
+ Export (DDO);
1827
1857
 
1828
1858
  Class("DefaultTemplateHandler", Object, {
1829
1859
  template: "",
@@ -1931,7 +1961,7 @@
1931
1961
  }
1932
1962
  }
1933
1963
  };
1934
- Class ("Component", Object, {
1964
+ Class ("Component", class {}, {
1935
1965
  domain: domain,
1936
1966
  basePath: basePath,
1937
1967
  templateURI: "",
@@ -2115,9 +2145,10 @@
2115
2145
  });
2116
2146
  return _promise;
2117
2147
  },
2118
- Cast (o) {
2148
+ Cast (oClass) {
2119
2149
  /* Cast method for components has been deprecated. Don't use this method, it is available only for compatibility purposes */
2120
- return this;
2150
+ let o = _methods_(oClass).map(m=>m.name.replace(/bound /g, "")).map(m=>{return {[m]:oClass[m].bind(this)};}).reduce((c,p)=>Object.assign(c, p), {});
2151
+ return _Cast(this, o);
2121
2152
  },
2122
2153
  routingWay: null,
2123
2154
  validRoutingWays: ["pathname", "hash", "search"],
@@ -3518,7 +3549,7 @@
3518
3549
 
3519
3550
  _component_.runComponentHelpers();
3520
3551
 
3521
- if ((Tag("component[loaded=true]").length * 100 / Tag("component:not([template-source=none])").length) >= 100) {
3552
+ if ((Tag("component[loaded=true]").length * 100 / Tag("component").length) >= 100) {
3522
3553
  d.dispatchEvent(new CustomEvent("componentsloaded", {
3523
3554
  detail: {
3524
3555
  lastComponent: _component_
package/VERSION CHANGED
@@ -1 +1 @@
1
- 2.4.20-beta
1
+ 2.4.20
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qcobjects",
3
- "version": "2.4.20-beta",
3
+ "version": "2.4.20",
4
4
  "description": "QCObjects is an Open-source framework that empowers full-stack developers to make micro-services and micro-frontends into an N-Tier architecture.",
5
5
  "main": "QCObjects.js",
6
6
  "license": "LGPL-3.0",