qcobjectsnewapp 2.5.7-ts → 2.5.9-ts
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/CHANGELOG.md +12 -0
- package/VERSION +1 -1
- package/package.json +4 -4
- package/public/js/config.js +5 -5
- package/public/js/config.js.map +2 -2
- package/public/js/customWidgets.js +5 -5
- package/public/js/customWidgets.js.map +2 -2
- package/public/js/init.js +42 -42
- package/public/js/init.js.map +3 -3
- package/public/js/packages/com.qcobjects.installer.js +18 -18
- package/public/js/packages/com.qcobjects.installer.js.map +3 -3
- package/public/js/packages/com.qcobjects.services.github.js +5 -5
- package/public/js/packages/com.qcobjects.services.github.js.map +2 -2
- package/public/js/packages/com.qcobjects.services.newapp.js +5 -5
- package/public/js/packages/com.qcobjects.services.newapp.js.map +2 -2
- package/public/js/packages/org.quickcorp.custom.components.js +24 -24
- package/public/js/packages/org.quickcorp.custom.components.js.map +2 -2
- package/public/js/packages/org.quickcorp.custom.controllers.js +32 -32
- package/public/js/packages/org.quickcorp.custom.controllers.js.map +3 -3
- package/public/js/packages/org.quickcorp.custom.effects.js +5 -5
- package/public/js/packages/org.quickcorp.custom.effects.js.map +2 -2
- package/public/js/packages/org.quickcorp.custom.js +42 -42
- package/public/js/packages/org.quickcorp.custom.js.map +3 -3
- package/public/js/packages/org.quickcorp.custom.models.js +5 -5
- package/public/js/packages/org.quickcorp.custom.models.js.map +2 -2
- package/public/js/packages/org.quickcorp.custom.views.js +5 -5
- package/public/js/packages/org.quickcorp.custom.views.js.map +2 -2
- package/spec/testsSpec.js +8 -3
- package/src/js/packages/com.qcobjects.installer.ts +5 -5
- package/src/js/packages/org.quickcorp.custom.components.ts +4 -4
- package/src/js/packages/org.quickcorp.custom.controllers.ts +13 -2
package/spec/testsSpec.js
CHANGED
|
@@ -7,7 +7,8 @@ const {
|
|
|
7
7
|
New,
|
|
8
8
|
Component,
|
|
9
9
|
Effect,
|
|
10
|
-
logger
|
|
10
|
+
logger,
|
|
11
|
+
global
|
|
11
12
|
} = require("qcobjects");
|
|
12
13
|
const { NotificationComponent } = require("qcobjects-sdk");
|
|
13
14
|
|
|
@@ -37,9 +38,13 @@ describe("QCObjects Main Test", function () {
|
|
|
37
38
|
logger.debug("Existence of Effect Class... OK");
|
|
38
39
|
});
|
|
39
40
|
|
|
40
|
-
it("global exposes QCObjects classes", function () {
|
|
41
|
-
|
|
41
|
+
it("global exposes QCObjects classes (shared context)", function () {
|
|
42
|
+
// global is the shared context (== _top); classes are consumed via direct
|
|
43
|
+
// import or ClassFactory since core 2.7.0 deduped the ambient global.
|
|
44
|
+
expect(typeof global).toEqual("object");
|
|
42
45
|
expect(typeof global.Class).toEqual("function");
|
|
46
|
+
expect(ClassFactory("Component")).toEqual(Component);
|
|
47
|
+
expect(typeof Component).toEqual("function");
|
|
43
48
|
logger.debug("global as QCObjects global... OK");
|
|
44
49
|
});
|
|
45
50
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint-disable no-unreachable */
|
|
2
2
|
"use strict";
|
|
3
|
-
import
|
|
3
|
+
import { InheritClass, Package, logger, set, get } from "qcobjects";
|
|
4
4
|
import { NotificationComponent } from "qcobjects-sdk";
|
|
5
5
|
|
|
6
6
|
Package("com.qcobjects.installer", [
|
|
@@ -32,7 +32,7 @@ Package("com.qcobjects.installer", [
|
|
|
32
32
|
}
|
|
33
33
|
NotificationComponent.success(`TWA in ${displayMode} Mode`);
|
|
34
34
|
});
|
|
35
|
-
|
|
35
|
+
set("installer", this);
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
/**
|
|
@@ -45,7 +45,7 @@ Package("com.qcobjects.installer", [
|
|
|
45
45
|
beforeinstallprompt (e: Event) {
|
|
46
46
|
logger.debug("registering installer event");
|
|
47
47
|
e.preventDefault();
|
|
48
|
-
|
|
48
|
+
set("promptEvent", e);
|
|
49
49
|
this.root.classList.add("available");
|
|
50
50
|
return false;
|
|
51
51
|
}
|
|
@@ -56,7 +56,7 @@ Package("com.qcobjects.installer", [
|
|
|
56
56
|
*/
|
|
57
57
|
installed () {
|
|
58
58
|
logger.debug("app is already installed");
|
|
59
|
-
|
|
59
|
+
set("promptEvent", null);
|
|
60
60
|
// This fires after onbeforinstallprompt OR after manual add to homescreen.
|
|
61
61
|
this.root.classList.remove("available");
|
|
62
62
|
}
|
|
@@ -68,7 +68,7 @@ Package("com.qcobjects.installer", [
|
|
|
68
68
|
install () {
|
|
69
69
|
const root = this.root;
|
|
70
70
|
logger.debug("installer actioned");
|
|
71
|
-
let promptEvent =
|
|
71
|
+
let promptEvent = get("promptEvent", null);
|
|
72
72
|
if (promptEvent) {
|
|
73
73
|
logger.debug("prompt event");
|
|
74
74
|
|
|
@@ -111,10 +111,10 @@ class AdminSidebarOption extends AdminCheckComponent {
|
|
|
111
111
|
<details>
|
|
112
112
|
<summary>Admin</summary>
|
|
113
113
|
<ul>
|
|
114
|
-
<li><a
|
|
115
|
-
<li><a
|
|
116
|
-
<li><a
|
|
117
|
-
<li><a
|
|
114
|
+
<li><a href="/admin">Admin Tool</a></li>
|
|
115
|
+
<li><a href="/admin/plugins">Plugins</a></li>
|
|
116
|
+
<li><a href="/admin/handlers">Handlers</a></li>
|
|
117
|
+
<li><a href="/admin/libs">Libs</a></li>
|
|
118
118
|
</ul>
|
|
119
119
|
</details>
|
|
120
120
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
/* eslint-disable no-unused-vars */
|
|
4
4
|
"use strict";
|
|
5
5
|
|
|
6
|
-
import
|
|
6
|
+
import { Package, Controller, logger, _DOMCreateElement, set,
|
|
7
7
|
type Effect, New, ClassFactory, type QCObjectsElement,
|
|
8
8
|
type QCObjectsShadowedElement, type Component, type ControllerParams } from "qcobjects";
|
|
9
9
|
import { Fade } from "qcobjects-sdk";
|
|
@@ -46,7 +46,7 @@ Package("org.quickcorp.custom.controllers", [
|
|
|
46
46
|
} else {
|
|
47
47
|
this.componentRoot = this.component.body;
|
|
48
48
|
}
|
|
49
|
-
(
|
|
49
|
+
set("sideNavController", this);
|
|
50
50
|
this.effect = new Fade({
|
|
51
51
|
duration: 300
|
|
52
52
|
});
|
|
@@ -54,10 +54,21 @@ Package("org.quickcorp.custom.controllers", [
|
|
|
54
54
|
|
|
55
55
|
done(...args: any[]) {
|
|
56
56
|
const _ret_ = super.done(args);
|
|
57
|
+
this.bindControls();
|
|
57
58
|
this.close();
|
|
58
59
|
return _ret_;
|
|
59
60
|
}
|
|
60
61
|
|
|
62
|
+
bindControls() {
|
|
63
|
+
if (this.componentRoot) {
|
|
64
|
+
const navLinks = (this.componentRoot as QCObjectsElement)?.subelements("a[href]");
|
|
65
|
+
navLinks?.map((link: HTMLElement) => {
|
|
66
|
+
link.addEventListener("click", () => this.close());
|
|
67
|
+
return link;
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
61
72
|
open() {
|
|
62
73
|
if (this.componentRoot !== null) {
|
|
63
74
|
if (this.effect != null) {
|