qcobjectsnewapp 1.2.97 → 2.4.2

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.4" ]
20
20
  schedule:
21
21
  - cron: '23 16 * * 2'
22
22
 
@@ -0,0 +1,38 @@
1
+ # This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
2
+ # For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
3
+
4
+ name: Node.js Publish Beta version
5
+
6
+ on:
7
+ push:
8
+ branches:
9
+ - 'v*.*-beta'
10
+ tags:
11
+ - 'v*.*.*-beta'
12
+
13
+ jobs:
14
+ build:
15
+ runs-on: ubuntu-latest
16
+ steps:
17
+ - uses: actions/checkout@v3.3.0
18
+ - uses: actions/setup-node@v3.6.0
19
+ with:
20
+ node-version: 16
21
+ - run: npm ci
22
+ - run: npm test
23
+
24
+ publish-npm:
25
+ needs: build
26
+ runs-on: ubuntu-latest
27
+ steps:
28
+ - uses: actions/checkout@v3.3.0
29
+ - uses: actions/setup-node@v3.6.0
30
+ with:
31
+ node-version: 16
32
+ registry-url: https://registry.npmjs.org/
33
+ - name: Set up NPM authentication
34
+ run: echo "registry=https://registry.npmjs.org/:_authToken=${{secrets.NPM_TOKEN}}" >> ~/.npmrc
35
+ - run: npm ci
36
+ - run: npm publish --tag ${GITHUB_REF##*/}
37
+ env:
38
+ NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
@@ -0,0 +1,38 @@
1
+ # This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
2
+ # For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
3
+
4
+ name: Node.js Publish LTS version
5
+
6
+ on:
7
+ push:
8
+ branches:
9
+ - 'v*.*-lts'
10
+ tags:
11
+ - 'v*.*.*-lts'
12
+
13
+ jobs:
14
+ build:
15
+ runs-on: ubuntu-latest
16
+ steps:
17
+ - uses: actions/checkout@v3.3.0
18
+ - uses: actions/setup-node@v3.6.0
19
+ with:
20
+ node-version: 16
21
+ - run: npm ci
22
+ - run: npm test
23
+
24
+ publish-npm:
25
+ needs: build
26
+ runs-on: ubuntu-latest
27
+ steps:
28
+ - uses: actions/checkout@v3.3.0
29
+ - uses: actions/setup-node@v3.6.0
30
+ with:
31
+ node-version: 16
32
+ registry-url: https://registry.npmjs.org/
33
+ - name: Set up NPM authentication
34
+ run: echo "registry=https://registry.npmjs.org/:_authToken=${{secrets.NPM_TOKEN}}" >> ~/.npmrc
35
+ - run: npm ci
36
+ - run: npm publish --tag ${GITHUB_REF##*/}
37
+ env:
38
+ NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
@@ -14,10 +14,10 @@ jobs:
14
14
  build:
15
15
  runs-on: ubuntu-latest
16
16
  steps:
17
- - uses: actions/checkout@v2
18
- - uses: actions/setup-node@v1
17
+ - uses: actions/checkout@v3.3.0
18
+ - uses: actions/setup-node@v3.6.0
19
19
  with:
20
- node-version: 14
20
+ node-version: 16
21
21
  - run: npm ci
22
22
  - run: npm test
23
23
 
@@ -25,10 +25,10 @@ jobs:
25
25
  needs: build
26
26
  runs-on: ubuntu-latest
27
27
  steps:
28
- - uses: actions/checkout@v2
29
- - uses: actions/setup-node@v1
28
+ - uses: actions/checkout@v3.3.0
29
+ - uses: actions/setup-node@v3.6.0
30
30
  with:
31
- node-version: 12
31
+ node-version: 16
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/VERSION CHANGED
@@ -1 +1 @@
1
- 1.2.97
1
+ 2.4.2
package/index.html CHANGED
@@ -3,11 +3,11 @@
3
3
 
4
4
  <head>
5
5
  <meta charset="utf-8" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1">
6
7
  <!-- This is a wide open CSP declaration. To lock this down for production, see below. -->
7
8
  <meta http-equiv="Content-Security-Policy" content="default-src * 'self' 'unsafe-inline' 'unsafe-eval' data: gap: https://ssl.gstatic.com; img-src * 'self' data:; child-src *; style-src * 'self' 'unsafe-inline' 'unsafe-eval'; script-src * 'self' 'unsafe-inline' 'unsafe-eval'; connect-src * 'self' 'unsafe-inline' 'unsafe-eval';media-src *">
8
- <title>QCObjects New App</title>
9
- <meta name="description" content="QCObjects New App">
10
- <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=5">
9
+ <title>QCObjects New App v2.4</title>
10
+ <meta name="description" content="QCObjects New App v2.4">
11
11
  <link rel="canonical" href="https://newapp.qcobjects.dev/">
12
12
  <link rel="manifest" href="manifest.json">
13
13
  <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
@@ -43,7 +43,7 @@
43
43
  <splash-screen componentClass="CubeSplashScreenComponent"
44
44
  duration="3000" data-background="black"
45
45
  data-cube_image="./img/Q_web-white.png"></splash-screen>
46
- <layout-basic splashscreen shadowed=true cached=true controllerClass="MainController">
46
+ <layout-basic splashscreen shadowed=true controllerClass="MainController" data-one="1" data-two="2">
47
47
  </layout-basic>
48
48
 
49
49
  <script type="module" src="js/init.js"></script>
package/js/init.js CHANGED
@@ -23,7 +23,7 @@
23
23
  * Everyone is permitted to copy and distribute verbatim copies of this
24
24
  * license document, but changing it is not allowed.
25
25
  */
26
- import "https://cdn.qcobjects.dev/QCObjects.js";
26
+ import "../QCObjects.js";
27
27
  /*
28
28
  * The next values are the default settings
29
29
  * You can change any value in runtime by using CONFIG.set
@@ -36,15 +36,14 @@ CONFIG.set("delayForReady", 1); // delay to wait before executing the first read
36
36
  CONFIG.set("preserveComponentBodyTag", false); // don't use <componentBody></componentBody> tag
37
37
  CONFIG.set("useConfigService", false); // Load settings from config.json
38
38
  CONFIG.set("routingWay","hash"); // routingWay possible values are 'hash','pathname','search'
39
- CONFIG.set("useSDK",true); // it is recommended to use the SDK that is dynamically loaded, but you can chose not to load it
40
- CONFIG.set("useLocalSDK",false); // on the frontend side you can chose whether to load the SDK from sdk.qcobjects.dev or from your local website
39
+ CONFIG.set("useLocalSDK",true); // on the frontend side you can chose whether to load the SDK from sdk.qcobjects.dev or from your local website
41
40
  CONFIG.set("tplextension","tpl.html"); // this is the file extension to locate the template files (if component.name = 'main' then template name will be main.tpl.html)
42
41
  CONFIG.set("asynchronousImportsLoad",true); // it is recommended to load the Import declarations in an asyncronous way
43
42
  CONFIG.set("serviceWorkerURI","/sw.js"); //QCObjects will register an launch this service worker automatically to work offline
44
43
 
45
44
  // if Component.cached is true, all the Class('Component') declarations will save the template in a localStorage cache
46
45
  // until a cached=false attribute is found in a <component> html declaration
47
- Component.cached=true;
46
+ Component.cached=false;
48
47
 
49
48
  /**
50
49
  * Main import sentence.
@@ -1,21 +1,9 @@
1
1
  "use strict";
2
2
  Package("com.qcobjects.installer",[
3
- Class("Installer",Object,{
4
- promptEvent:null,
5
- beforeinstallprompt (e) {
6
- logger.debug("registering installer event");
7
- e.preventDefault();
8
- this.promptEvent = e;
9
- this.root.classList.add("available");
10
- return false;
11
- },
12
- installed () {
13
- logger.debug("app is already installed");
14
- this.promptEvent = null;
15
- // This fires after onbeforinstallprompt OR after manual add to homescreen.
16
- this.root.classList.remove("available");
17
- },
18
- _new_ ({root}) {
3
+ class Installer extends ClassFactory("InheritClass") {
4
+ constructor ({root}){
5
+ super(...arguments);
6
+
19
7
  this.root = root;
20
8
  window.addEventListener("beforeinstallprompt", this.beforeinstallprompt.bind(this),false);
21
9
  window.addEventListener("appinstalled", this.installed.bind(this),false);
@@ -31,7 +19,26 @@ Package("com.qcobjects.installer",[
31
19
  NotificationComponent.success(`TWA in ${displayMode} Mode`);
32
20
  });
33
21
  global.set("installer", this);
34
- },
22
+
23
+ }
24
+
25
+ promptEvent=null;
26
+
27
+ beforeinstallprompt (e) {
28
+ logger.debug("registering installer event");
29
+ e.preventDefault();
30
+ this.promptEvent = e;
31
+ this.root.classList.add("available");
32
+ return false;
33
+ }
34
+
35
+ installed () {
36
+ logger.debug("app is already installed");
37
+ this.promptEvent = null;
38
+ // This fires after onbeforinstallprompt OR after manual add to homescreen.
39
+ this.root.classList.remove("available");
40
+ }
41
+
35
42
  install () {
36
43
  var root = this.root;
37
44
  logger.debug("installer actioned");
@@ -61,5 +68,7 @@ Package("com.qcobjects.installer",[
61
68
  logger.debug("not asking for install");
62
69
  }
63
70
  }
64
- })
71
+
72
+
73
+ }
65
74
  ]);
@@ -1,12 +1,26 @@
1
1
  "use strict";
2
2
  Package("org.quickcorp.custom.components",[
3
- Class("Component1",Component,{
4
- name:"main",
5
- cached:false,
6
- controller:null,
7
- view:null
8
- }),
9
- Class("Component2",Component,{
10
- propertyName2:"propertyValue2"
11
- }),
3
+
4
+ class Component1 extends Component {
5
+ name = "main";
6
+ cached=false;
7
+ controller=null;
8
+ view=null;
9
+
10
+ constructor () {
11
+ super(...arguments);
12
+ }
13
+ },
14
+
15
+ class Component2 extends Component {
16
+ name = "component-two";
17
+ propertyName2="propertyValue2";
18
+
19
+ constructor () {
20
+ super(...arguments);
21
+ }
22
+
23
+ }
24
+
25
+
12
26
  ]);
@@ -3,94 +3,109 @@
3
3
  "use strict";
4
4
 
5
5
  Package("org.quickcorp.custom.controllers", [
6
- Class("MainController", Controller, {
7
- dependencies: [],
8
- component: null,
9
- _new_(o) {
10
- this.__new__(o);
11
- //TODO: Implement
12
- },
13
- done: function () {
14
- if (!MainController.loaded) {
6
+
7
+ class MainController extends Controller {
8
+ constructor() {
9
+ logger.debug("Initializing MainController...");
10
+ super(...arguments);
11
+ }
12
+
13
+ done() {
14
+ var _ret_ = super.done(...arguments);
15
+ if (!MainController.loaded){
15
16
  var s = _DOMCreateElement("style");
16
17
  s.innerHTML = "body, html {margin:0;padding:0;width:100%;height:100%;top:0;bottom:0;left:0;right:0}";
17
18
  document.body.append(s);
19
+ logger.debug("MainController loaded");
18
20
  MainController.loaded = true;
19
21
  }
20
-
22
+ return _ret_;
21
23
  }
22
- }),
23
- Class("PWAController", Object, {
24
- component: null,
25
- _new_(o) {
24
+
25
+ },
26
+
27
+ class PWAController extends Controller {
28
+ constructor() {
29
+ super(...arguments);
26
30
  logger.debug("PWAController Element Initialized");
27
- this.component = o.component;
28
- },
29
- done: function () {
31
+ }
32
+
33
+ done() {
34
+ var _ret_ = super.done(...arguments);
30
35
  document.head.innerHTML += componentRoot.innerHTML;
31
36
  componentRoot.innerHTML = "";
37
+ return _ret_;
38
+ }
39
+
40
+ },
41
+
42
+ class SideNavController extends Controller {
43
+
44
+ constructor() {
45
+ super(...arguments);
46
+
47
+ global.sideNavController = this;
48
+ var controller = this;
49
+ global._sdk_.then(function () {
50
+ controller.effect = new Fade ({
51
+ duration: 300
52
+ });
53
+ controller.close();
54
+ });
32
55
  }
33
- }),
34
- Class("SideNavController", Object, {
35
- dependencies: [],
36
- component: null,
37
- visibility: false,
38
- effect: null,
56
+
39
57
  open() {
40
58
  var controller = this;
41
- var componentRoot = (controller.component.shadowed)?(controller.component.shadowRoot):(controller.component.body);
59
+ var componentRoot = (controller.component.shadowed) ? (controller.component.shadowRoot) : (controller.component.body);
42
60
  if (this.effect != null) {
43
61
  this.effect.apply(componentRoot, 0, 1);
44
62
  }
45
63
  componentRoot.style.width = "100%";
46
64
  componentRoot.style.overflowX = "visible";
47
- componentRoot.parentElement.subelements(".navbtn")[0].style.display = "none";
48
- componentRoot.parentElement.subelements(".closebtn")[0].style.display = "block";
65
+ if (Object.hasOwnProperty.call(componentRoot, "parentElement") && typeof componentRoot.parentElement !== "undefined"){
66
+ componentRoot.parentElement.subelements(".navbtn")[0].style.display = "none";
67
+ componentRoot.parentElement.subelements(".closebtn")[0].style.display = "block";
68
+ }
49
69
  this.visibility = true;
50
70
  return this.visibility;
51
- },
71
+ }
72
+
52
73
  close() {
53
74
  var controller = this;
54
- var componentRoot = (controller.component.shadowed)?(controller.component.shadowRoot):(controller.component.body);
75
+ var componentRoot = (controller.component.shadowed) ? (controller.component.shadowRoot) : (controller.component.body);
55
76
  if (this.effect != null) {
56
77
  this.effect.apply(componentRoot, 1, 0);
57
78
  }
58
79
  componentRoot.style.width = "0px";
59
80
  componentRoot.style.overflowX = "hidden";
60
- componentRoot.parentElement.subelements(".navbtn")[0].style.display = "block";
61
- componentRoot.parentElement.subelements(".closebtn")[0].style.display = "none";
81
+ if (Object.hasOwnProperty.call(componentRoot, "parentElement") && typeof componentRoot.parentElement !== "undefined"){
82
+ componentRoot.parentElement.subelements(".navbtn")[0].style.display = "block";
83
+ componentRoot.parentElement.subelements(".closebtn")[0].style.display = "none";
84
+ }
62
85
  this.visibility = false;
63
86
  return this.visibility;
64
- },
87
+ }
88
+
65
89
  toggle() {
66
90
  if (this.visibility) {
67
91
  this.close();
68
92
  } else {
69
93
  this.open();
70
94
  }
71
- },
72
- _new_(o) {
73
- this.__new__(o);
74
- global.sideNavController = this;
75
- var controller = this;
76
- global._sdk_.then(function () {
77
- controller.effect = New(Fade, {
78
- duration: 300
79
- });
80
- controller.close();
81
- });
82
- //TODO: Implement
83
-
84
- },
85
- done: function () {}
86
- }),
87
- Class("HeaderController", Controller, {
88
- dependencies: [],
89
- component: null,
90
- installer: null,
95
+ }
96
+
97
+
98
+ },
99
+
100
+ class HeaderController extends Controller {
101
+ constructor() {
102
+ super(...arguments);
103
+ }
104
+
105
+
91
106
  loadInstallerButton() {
92
107
  var controller = this;
93
- var componentRoot = (controller.component.shadowed)?(controller.component.shadowRoot):(controller.component.body);
108
+ var componentRoot = (controller.component.shadowed) ? (controller.component.shadowRoot) : (controller.component.body);
94
109
  componentRoot.subelements("#installerbutton").map(
95
110
  function (element) {
96
111
  controller.installer = New(Installer, {
@@ -98,31 +113,14 @@ Package("org.quickcorp.custom.controllers", [
98
113
  });
99
114
  }
100
115
  );
101
- },
102
- _new_(o) {
103
- this.__new__(o);
104
- //TODO: Implement
105
- },
106
- done: function () {
107
- this.loadInstallerButton();
108
- }
109
- }),
110
- Class("Controller1", Controller, {
111
- dependencies: [],
112
- component: null,
113
- _new_(o) {
114
- this.__new__(o);
115
- var controller = this;
116
- //TODO: Implement
117
116
  }
118
- }),
119
- Class("Controller2", Controller, {
120
- dependencies: [],
121
- component: null,
122
- _new_(o) {
123
- this.__new__(o);
124
- var controller = this;
125
- //TODO: Implement
117
+
118
+
119
+ done() {
120
+ var _ret_ = super.done(...arguments);
121
+ this.loadInstallerButton();
122
+ return _ret_;
126
123
  }
127
- })
124
+
125
+ }
128
126
  ]);
@@ -1,12 +1,18 @@
1
1
  "use strict";
2
2
  Package("org.quickcorp.custom.effects",[
3
- Class("MainTransitionEffect",TransitionEffect,{
4
- duration:780,
5
- defaultParams:{
3
+
4
+ class MainTransitionEffect extends TransitionEffect {
5
+ duration=780;
6
+ defaultParams={
6
7
  alphaFrom:0,
7
8
  alphaTo:1
8
- },
9
- effects:["Fade","MoveYInFromBottom"],
10
- fitToHeight:true
11
- })
9
+ };
10
+ effects=["Fade","MoveYInFromBottom"];
11
+ fitToHeight=true;
12
+
13
+ constructor (){
14
+ super(...arguments);
15
+ }
16
+
17
+ }
12
18
  ]);
@@ -1,13 +1,15 @@
1
1
  "use strict";
2
2
  Package("org.quickcorp.custom.models",[
3
- Class("ContactVO",VO,{
4
- first_name:"",
5
- last_name:"",
6
- address:"",
7
- postalCode:"",
8
- city:"",
9
- country:"",
10
- email:"",
11
- phone:""
12
- })
3
+
4
+ class ContactVO extends VO {
5
+ first_name="";
6
+ last_name="";
7
+ address="";
8
+ postalCode="";
9
+ city="";
10
+ country="";
11
+ email="";
12
+ phone="";
13
+
14
+ }
13
15
  ]);
@@ -1,19 +1,18 @@
1
1
  "use strict";
2
2
  Package("org.quickcorp.custom.views",[
3
- Class("CardView",View,{
3
+
4
+ class CardView extends View {
5
+ constructor () {
6
+ super(...arguments);
7
+ }
4
8
  done (){
9
+ var _ret_ = super.done(...arguments);
5
10
  let component = this.component;
6
11
  component.body.style.display="block";
7
12
  component.body.style.width="100px";
8
13
  component.body.style.height="100px";
14
+ return _ret_;
9
15
  }
10
- }),
11
- Class("View2",View,{
12
- dependencies:[],
13
- component:null,
14
- _new_ (o){
15
- this.__new__(o);
16
- //TODO: Implement
17
- }
18
- }),
16
+
17
+ }
19
18
  ]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qcobjectsnewapp",
3
- "version": "1.2.97",
3
+ "version": "2.4.2",
4
4
  "description": "App template for New App in QCObjects",
5
5
  "main": "js/init.js",
6
6
  "scripts": {
@@ -10,6 +10,13 @@
10
10
  "postversion": "git push && git push --tags",
11
11
  "coverage": "nyc --reporter=lcov --reporter=text-summary npm run test",
12
12
  "start": "node app.js",
13
+ "serve": "node app.js",
14
+ "server": "node app.js",
15
+ "collab": "node -e \"require('qcobjects-cli/qcobjects-collab')\"",
16
+ "shell": "node -e \"require('qcobjects-cli/qcobjects-shell')\"",
17
+ "createcert": "node -e \"require('qcobjects-cli/qcobjects-createcert')\"",
18
+ "http-server": "node -e \"require('qcobjects-cli/qcobjects-http-server')\"",
19
+ "gae-server": "node -e \"require('qcobjects-cli/qcobjects-gae-http-server')\"",
13
20
  "build": "exit 0"
14
21
  },
15
22
  "repository": {
@@ -28,13 +35,19 @@
28
35
  "eslint": "^8.2.0",
29
36
  "eslint-config-qcobjects": "^0.0.13",
30
37
  "jasmine": "^3.6.3",
31
- "qcobjects": "^2.3.68",
32
- "qcobjects-cli": "^2.3.50"
38
+ "qcobjects": "^2.4.40",
39
+ "qcobjects-cli": "^2.4.25"
33
40
  },
34
41
  "dependencies": {
35
42
  "grunt": "^1.4.1",
36
- "grunt-contrib-jasmine": "^2.0.2",
43
+ "grunt-contrib-jasmine": "^4.0.0",
37
44
  "nyc": "^15.1.0",
38
- "qcobjects-sdk": "^2.3.30"
45
+ "qcobjects": "^2.4.40",
46
+ "qcobjects-cli": "^2.4.25",
47
+ "qcobjects-sdk": "^2.4.26"
48
+ },
49
+ "engines": {
50
+ "npm": ">=8.10.0",
51
+ "node": ">=14.17.6"
39
52
  }
40
53
  }
@@ -56,7 +56,7 @@
56
56
  <routing path="#signin" name="login2"></routing>
57
57
  <routing path="#" name="contentblock"></routing>
58
58
  <routing path="" name="contentblock"></routing>
59
- </component>
59
+ </component>
60
60
  </section>
61
61
  </main>
62
62
  <footer>
@@ -3,23 +3,23 @@
3
3
  <details>
4
4
  <summary>Main</summary>
5
5
  <ul>
6
- <li><a onclick="global.sideNavController.close()" href="#">Main</a></li>
6
+ <li><a onclick="global.sideNavController.close()" href="/#">Main</a></li>
7
7
 
8
8
  </ul>
9
9
  </details>
10
10
  <details>
11
11
  <summary>Register</summary>
12
12
  <ul>
13
- <li><a onclick="global.sideNavController.close();return true;" href="#signup">Create an account</a></li>
14
- <li><a onclick="global.sideNavController.close();return true;" href="#signin">Sign In</a></li>
13
+ <li><a onclick="global.sideNavController.close();return true;" href="/#signup">Create an account</a></li>
14
+ <li><a onclick="global.sideNavController.close();return true;" href="/#signin">Sign In</a></li>
15
15
  </ul>
16
16
  </details>
17
17
  <details>
18
18
  <summary>Other</summary>
19
19
  <ul>
20
- <li><a onclick="global.sideNavController.close()" href="#page1">Page 1</a></li>
21
- <li><a onclick="global.sideNavController.close()" href="#page2">Page 2</a></li>
22
- <li><a onclick="global.sideNavController.close()" href="#page3">Page 3</a></li>
20
+ <li><a onclick="global.sideNavController.close()" href="/#page1">Page 1</a></li>
21
+ <li><a onclick="global.sideNavController.close()" href="/#page2">Page 2</a></li>
22
+ <li><a onclick="global.sideNavController.close()" href="/#page3">Page 3</a></li>
23
23
  </ul>
24
24
  </details>
25
25
  </div>