qcobjects 2.5.125-beta → 2.5.133-beta
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/Dockerfile +3 -3
- package/VERSION +1 -1
- package/build/ArrayCollection.js +2 -2
- package/build/Base64.js +14 -12
- package/build/ComponentFactory.js +2 -2
- package/build/DataStringify.js +1 -1
- package/build/DefaultTemplateHandler.js +5 -5
- package/build/ObjectName.js +1 -1
- package/build/Ready.js +3 -3
- package/build/WidgetsFactory.js +2 -2
- package/build/asyncLoad.js +3 -3
- package/build/basePath.js +6 -11
- package/build/index.js +1 -1
- package/build/introspection.js +1 -1
- package/build/is_a.js +1 -1
- package/build/is_forbidden_name.js +1 -1
- package/build/is_raw_class.js +1 -1
- package/build/loadSDK.js +2 -2
- package/build/make_global.js +1 -1
- package/build/range.js +1 -1
- package/build/routings.js +2 -2
- package/build/shortCode.js +1 -1
- package/build/waitUntil.js +2 -2
- package/build-esbuild.js +6 -7
- package/eslint.config.mjs +1 -1
- package/package.json +17 -9
- package/public/browser/QCObjects.js +139 -146
- package/public/browser/QCObjects.js.map +4 -4
- package/public/cjs/{QCObjects.cjs → index.cjs} +141 -240
- package/public/cjs/index.cjs.map +7 -0
- package/public/esm/{QCObjects.mjs → index.mjs} +229 -229
- package/public/esm/index.mjs.map +7 -0
- package/public/types/index.d.ts +99 -106
- package/public/types/index.d.ts.map +1 -0
- package/spec/helpers/mock-sdk.helper.ts +0 -3
- package/spec/testsClassFactorySpec.ts +1 -1
- package/spec/testsConfigSpec.ts +1 -1
- package/src/ArrayCollection.ts +7 -7
- package/src/BackendMicroservice.ts +14 -13
- package/src/Base64.ts +87 -87
- package/src/CONFIG.ts +3 -3
- package/src/Class.ts +1 -1
- package/src/ClassFactory.ts +1 -1
- package/src/ComplexStorageCache.ts +5 -5
- package/src/Component.ts +19 -19
- package/src/ComponentFactory.ts +4 -4
- package/src/Controller.ts +7 -7
- package/src/Crypt.ts +16 -16
- package/src/DDO.ts +2 -2
- package/src/DOMCreateElement.ts +9 -9
- package/src/DataStringify.ts +14 -14
- package/src/DefaultTemplateHandler.ts +45 -45
- package/src/Effect.ts +7 -7
- package/src/Export.ts +6 -6
- package/src/IncrementInstanceID.ts +1 -1
- package/src/InheritClass.ts +26 -26
- package/src/Logger.ts +4 -4
- package/src/MainProcess.ts +1 -1
- package/src/ObjectName.ts +1 -1
- package/src/PrimaryCollections.ts +2 -2
- package/src/Processor.ts +20 -20
- package/src/QCObjects.ts +1 -1
- package/src/Ready.ts +4 -4
- package/src/Service.ts +8 -8
- package/src/SourceCSS.ts +42 -42
- package/src/SourceJS.ts +8 -8
- package/src/Tag.ts +4 -4
- package/src/Timer.ts +2 -2
- package/src/Toggle.ts +2 -2
- package/src/TransitionEffect.ts +3 -4
- package/src/View.ts +2 -1
- package/src/WidgetsFactory.ts +3 -3
- package/src/assign.ts +1 -0
- package/src/asyncLoad.ts +5 -5
- package/src/basePath.ts +7 -14
- package/src/captureFalseTouch.ts +1 -1
- package/src/componentLoader.ts +1 -1
- package/src/defaultProcessors.ts +3 -3
- package/src/globalSettings.ts +24 -24
- package/src/index.cts +1 -1
- package/src/index.mts +1 -1
- package/src/index.ts +1 -1
- package/src/introspection.ts +78 -78
- package/src/is_a.ts +12 -12
- package/src/is_forbidden_name.ts +11 -12
- package/src/is_raw_class.ts +3 -3
- package/src/loadSDK.ts +2 -2
- package/src/make_global.ts +1 -1
- package/src/range.ts +12 -12
- package/src/routings.ts +3 -3
- package/src/secretKey.ts +1 -1
- package/src/serviceLoader.ts +1 -1
- package/src/shortCode.ts +9 -9
- package/src/top.ts +4 -4
- package/src/types/global/index.d.ts +4 -5
- package/src/uniqueID.ts +1 -1
- package/src/waitUntil.ts +2 -2
- package/tsconfig.d.json +30 -4
- package/tsconfig.jasmine.json +30 -5
- package/tsconfig.json +18 -2
- package/build/index.cjs +0 -37
- package/build/index.mjs +0 -2
- package/public/cjs/QCObjects.cjs.map +0 -7
- package/public/esm/QCObjects.mjs.map +0 -7
|
@@ -6,6 +6,7 @@ import { _domain_ } from "./domain";
|
|
|
6
6
|
import { InheritClass } from "./InheritClass";
|
|
7
7
|
import { logger } from "./Logger";
|
|
8
8
|
import { Package } from "./Package";
|
|
9
|
+
import { IMicroservice } from "types";
|
|
9
10
|
|
|
10
11
|
export class BackendMicroservice extends InheritClass {
|
|
11
12
|
stream: any;
|
|
@@ -19,7 +20,7 @@ export class BackendMicroservice extends InheritClass {
|
|
|
19
20
|
body = null,
|
|
20
21
|
stream = null,
|
|
21
22
|
request = null
|
|
22
|
-
}) {
|
|
23
|
+
}:IMicroservice) {
|
|
23
24
|
super({
|
|
24
25
|
domain,
|
|
25
26
|
basePath,
|
|
@@ -67,7 +68,7 @@ export class BackendMicroservice extends InheritClass {
|
|
|
67
68
|
|
|
68
69
|
}
|
|
69
70
|
|
|
70
|
-
cors() {
|
|
71
|
+
cors():void {
|
|
71
72
|
if (this.route.cors) {
|
|
72
73
|
logger.debug("Validating CORS...");
|
|
73
74
|
const {
|
|
@@ -132,52 +133,52 @@ export class BackendMicroservice extends InheritClass {
|
|
|
132
133
|
}
|
|
133
134
|
|
|
134
135
|
|
|
135
|
-
head(formData: any) {
|
|
136
|
+
head(formData: any):void {
|
|
136
137
|
logger.debug(`[BackendMicroservice.head] Data received: ${_DataStringify(formData)}`);
|
|
137
138
|
this.done();
|
|
138
139
|
}
|
|
139
140
|
|
|
140
|
-
get(formData: any) {
|
|
141
|
+
get(formData: any):void {
|
|
141
142
|
logger.debug(`[BackendMicroservice.get] Data received: ${_DataStringify(formData)}`);
|
|
142
143
|
this.done();
|
|
143
144
|
}
|
|
144
145
|
|
|
145
|
-
post(formData: any) {
|
|
146
|
+
post(formData: any):void {
|
|
146
147
|
logger.debug(`[BackendMicroservice.post] Data received: ${_DataStringify(formData)}`);
|
|
147
148
|
this.done();
|
|
148
149
|
}
|
|
149
150
|
|
|
150
|
-
put(formData: any) {
|
|
151
|
+
put(formData: any):void {
|
|
151
152
|
logger.debug(`[BackendMicroservice.put] Data received: ${_DataStringify(formData)}`);
|
|
152
153
|
this.done();
|
|
153
154
|
}
|
|
154
155
|
|
|
155
|
-
delete(formData: any) {
|
|
156
|
+
delete(formData: any):void {
|
|
156
157
|
logger.debug(`[BackendMicroservice.delete] Data received: ${_DataStringify(formData)}`);
|
|
157
158
|
this.done();
|
|
158
159
|
}
|
|
159
160
|
|
|
160
|
-
connect(formData: any) {
|
|
161
|
+
connect(formData: any):void {
|
|
161
162
|
logger.debug(`[BackendMicroservice.connect] Data received: ${_DataStringify(formData)}`);
|
|
162
163
|
this.done();
|
|
163
164
|
}
|
|
164
165
|
|
|
165
|
-
options(formData: any) {
|
|
166
|
+
options(formData: any):void {
|
|
166
167
|
logger.debug(`[BackendMicroservice.options] Data received: ${_DataStringify(formData)}`);
|
|
167
168
|
this.done();
|
|
168
169
|
}
|
|
169
170
|
|
|
170
|
-
trace(formData: any) {
|
|
171
|
+
trace(formData: any):void {
|
|
171
172
|
logger.debug(`[BackendMicroservice.trace] Data received: ${_DataStringify(formData)}`);
|
|
172
173
|
this.done();
|
|
173
174
|
}
|
|
174
175
|
|
|
175
|
-
patch(formData: any) {
|
|
176
|
+
patch(formData: any):void {
|
|
176
177
|
logger.debug(`[BackendMicroservice.patch] Data received: ${_DataStringify(formData)}`);
|
|
177
178
|
this.done();
|
|
178
179
|
}
|
|
179
180
|
|
|
180
|
-
finishWithBody(stream?: Http2Stream | Stream) {
|
|
181
|
+
finishWithBody(stream?: Http2Stream | Stream):void {
|
|
181
182
|
try {
|
|
182
183
|
logger.debug("[BackendMicroservice.finishWithBody] Ending the stream...");
|
|
183
184
|
logger.debug(`[BackendMicroservice.finishWithBody] type of body is: ${typeof this.body}`);
|
|
@@ -193,7 +194,7 @@ export class BackendMicroservice extends InheritClass {
|
|
|
193
194
|
}
|
|
194
195
|
}
|
|
195
196
|
|
|
196
|
-
done() {
|
|
197
|
+
done():void {
|
|
197
198
|
logger.debug("[BackendMicroservice.done] Finalizing the response...");
|
|
198
199
|
const microservice = this;
|
|
199
200
|
const stream = microservice.stream;
|
package/src/Base64.ts
CHANGED
|
@@ -1,92 +1,92 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
t = t + this._keyStr.charAt(s) + this._keyStr.charAt(o) + this._keyStr.charAt(u) + this._keyStr.charAt(a);
|
|
1
|
+
export class Base64 {
|
|
2
|
+
static _keyStr: string = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
|
|
3
|
+
static encode(e: string): string {
|
|
4
|
+
let t = "";
|
|
5
|
+
let n: number, r: number, i: number, s: number, o: number, u: number, a: number;
|
|
6
|
+
let f = 0;
|
|
7
|
+
e = Base64._utf8_encode(e);
|
|
8
|
+
while (f < e.length) {
|
|
9
|
+
n = e.charCodeAt(f++);
|
|
10
|
+
r = e.charCodeAt(f++);
|
|
11
|
+
i = e.charCodeAt(f++);
|
|
12
|
+
s = n >> 2;
|
|
13
|
+
o = (n & 3) << 4 | r >> 4;
|
|
14
|
+
u = (r & 15) << 2 | i >> 6;
|
|
15
|
+
a = i & 63;
|
|
16
|
+
if (isNaN(r)) {
|
|
17
|
+
u = a = 64;
|
|
18
|
+
} else if (isNaN(i)) {
|
|
19
|
+
a = 64;
|
|
22
20
|
}
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
21
|
+
t = t + this._keyStr.charAt(s) + this._keyStr.charAt(o) + this._keyStr.charAt(u) + this._keyStr.charAt(a);
|
|
22
|
+
}
|
|
23
|
+
return t;
|
|
24
|
+
}
|
|
25
|
+
static decode(e: string): string {
|
|
26
|
+
let t = "";
|
|
27
|
+
let n: number, r: number, i: number;
|
|
28
|
+
let s: number, o: number, u: number, a: number;
|
|
29
|
+
let f = 0;
|
|
30
|
+
e = e.replace(/[^A-Za-z0-9+/=]/g, "");
|
|
31
|
+
while (f < e.length) {
|
|
32
|
+
s = this._keyStr.indexOf(e.charAt(f++));
|
|
33
|
+
o = this._keyStr.indexOf(e.charAt(f++));
|
|
34
|
+
u = this._keyStr.indexOf(e.charAt(f++));
|
|
35
|
+
a = this._keyStr.indexOf(e.charAt(f++));
|
|
36
|
+
n = s << 2 | o >> 4;
|
|
37
|
+
r = (o & 15) << 4 | u >> 2;
|
|
38
|
+
i = (u & 3) << 6 | a;
|
|
39
|
+
t = t + String.fromCharCode(n);
|
|
40
|
+
if (u !== 64) {
|
|
41
|
+
t = t + String.fromCharCode(r);
|
|
42
|
+
}
|
|
43
|
+
if (a !== 64) {
|
|
44
|
+
t = t + String.fromCharCode(i);
|
|
46
45
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
46
|
+
}
|
|
47
|
+
t = Base64._utf8_decode(t);
|
|
48
|
+
return t;
|
|
49
|
+
}
|
|
50
|
+
static _utf8_encode(e: string): string {
|
|
51
|
+
e = e.replace(/rn/g, "n");
|
|
52
|
+
let t = "";
|
|
53
|
+
for (let n = 0; n < e.length; n++) {
|
|
54
|
+
const r = e.charCodeAt(n);
|
|
55
|
+
if (r < 128) {
|
|
56
|
+
t += String.fromCharCode(r);
|
|
57
|
+
} else if (r > 127 && r < 2048) {
|
|
58
|
+
t += String.fromCharCode(r >> 6 | 192);
|
|
59
|
+
t += String.fromCharCode(r & 63 | 128);
|
|
60
|
+
} else {
|
|
61
|
+
t += String.fromCharCode(r >> 12 | 224);
|
|
62
|
+
t += String.fromCharCode(r >> 6 & 63 | 128);
|
|
63
|
+
t += String.fromCharCode(r & 63 | 128);
|
|
65
64
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
65
|
+
}
|
|
66
|
+
return t;
|
|
67
|
+
}
|
|
68
|
+
static _utf8_decode(e: string): string {
|
|
69
|
+
let t = "";
|
|
70
|
+
let n = 0;
|
|
71
|
+
let r = 0;
|
|
72
|
+
let c2 = 0;
|
|
73
|
+
let c3: number;
|
|
74
|
+
while (n < e.length) {
|
|
75
|
+
r = e.charCodeAt(n);
|
|
76
|
+
if (r < 128) {
|
|
77
|
+
t += String.fromCharCode(r);
|
|
78
|
+
n++;
|
|
79
|
+
} else if (r > 191 && r < 224) {
|
|
80
|
+
c2 = e.charCodeAt(n + 1);
|
|
81
|
+
t += String.fromCharCode((r & 31) << 6 | c2 & 63);
|
|
82
|
+
n += 2;
|
|
83
|
+
} else {
|
|
84
|
+
c2 = e.charCodeAt(n + 1);
|
|
85
|
+
c3 = e.charCodeAt(n + 2);
|
|
86
|
+
t += String.fromCharCode((r & 15) << 12 | (c2 & 63) << 6 | c3 & 63);
|
|
87
|
+
n += 3;
|
|
89
88
|
}
|
|
90
|
-
return t;
|
|
91
89
|
}
|
|
92
|
-
|
|
90
|
+
return t;
|
|
91
|
+
}
|
|
92
|
+
};
|
package/src/CONFIG.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { GlobalProcessor as Processor } from "./Processor";
|
|
|
7
7
|
import { _secretKey } from "./secretKey";
|
|
8
8
|
import { Package } from "./Package";
|
|
9
9
|
import { InheritClass } from "./InheritClass";
|
|
10
|
-
import { ICONFIG } from "
|
|
10
|
+
import { ICONFIG } from "types";
|
|
11
11
|
import { ConfigSettings } from "./ConfigSettings";
|
|
12
12
|
|
|
13
13
|
|
|
@@ -21,7 +21,7 @@ export class CONFIG extends InheritClass implements ICONFIG {
|
|
|
21
21
|
return ConfigSettings.instance._CONFIG as unknown;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
set(name: string, value: unknown) {
|
|
24
|
+
set(name: string, value: unknown):void {
|
|
25
25
|
logger.debug(`CONFIG.set ${name}: ${value as string}`);
|
|
26
26
|
// hack to force update basePath from CONFIG
|
|
27
27
|
if (name === "basePath") {
|
|
@@ -83,7 +83,7 @@ export class CONFIG extends InheritClass implements ICONFIG {
|
|
|
83
83
|
return CONFIG._instance;
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
static set(name: string, value: unknown) {
|
|
86
|
+
static set(name: string, value: unknown):void {
|
|
87
87
|
(CONFIG.instance.set(name, value));
|
|
88
88
|
}
|
|
89
89
|
static get(name: string, value?: unknown): any {
|
package/src/Class.ts
CHANGED
|
@@ -9,7 +9,7 @@ import { __is__forbidden_name__ } from "./is_forbidden_name";
|
|
|
9
9
|
import { _LegacyCopy } from "./LegacyCopy";
|
|
10
10
|
import { logger } from "./Logger";
|
|
11
11
|
import { isBrowser } from "./platform";
|
|
12
|
-
import { IQCObjectsElement, TBody, TClass } from "
|
|
12
|
+
import { IQCObjectsElement, TBody, TClass } from "types";
|
|
13
13
|
import { InheritClass } from "./InheritClass";
|
|
14
14
|
import { _top } from "./top";
|
|
15
15
|
|
package/src/ClassFactory.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
import { __is_raw_class__ } from "./is_raw_class";
|
|
8
8
|
import { _QC_CLASSES, _QC_PACKAGES, get_QC_CLASS } from "./PrimaryCollections";
|
|
9
|
-
import { TClassFactory } from "
|
|
9
|
+
import { TClassFactory } from "types";
|
|
10
10
|
|
|
11
11
|
export const ClassFactory:TClassFactory = (className:string):any => {
|
|
12
12
|
let _classFactory;
|
|
@@ -45,11 +45,11 @@ export class ComplexStorageCache {
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
|
|
48
|
-
setItem(cachedObjectID: string, value: any) {
|
|
48
|
+
setItem(cachedObjectID: string, value: any):void {
|
|
49
49
|
localStorage.setItem(cachedObjectID, _DataStringify(value));
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
isEmpty(object: string | number | null) {
|
|
52
|
+
isEmpty(object: string | number | null):boolean {
|
|
53
53
|
let r = false;
|
|
54
54
|
switch (true) {
|
|
55
55
|
case (typeof object === "undefined"):
|
|
@@ -66,7 +66,7 @@ export class ComplexStorageCache {
|
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
|
|
69
|
-
getID(object: any) {
|
|
69
|
+
getID(object: any):string|undefined {
|
|
70
70
|
let cachedObjectID;
|
|
71
71
|
if (typeof object !== "undefined") {
|
|
72
72
|
cachedObjectID = "cachedObject_" + Base64.encode(_DataStringify(object).replace(/\{|\}|,/g, "_"));
|
|
@@ -74,7 +74,7 @@ export class ComplexStorageCache {
|
|
|
74
74
|
return cachedObjectID;
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
save(object: any, cachedNewResponse: any) {
|
|
77
|
+
save(object: any, cachedNewResponse: any):void {
|
|
78
78
|
const cachedObjectID = this.getID(object);
|
|
79
79
|
logger.debug("CACHING THE RESPONSE OF {{cachedObjectID}} ".replace("{{cachedObjectID}}", cachedObjectID as string));
|
|
80
80
|
this.setItem(cachedObjectID as string, cachedNewResponse);
|
|
@@ -85,7 +85,7 @@ export class ComplexStorageCache {
|
|
|
85
85
|
return this.getItem(cachedObjectID as string);
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
-
clear() {
|
|
88
|
+
clear():void {
|
|
89
89
|
Object.keys(localStorage).filter(function (k) {
|
|
90
90
|
return k.startsWith("cachedObject_");
|
|
91
91
|
}).map(function (c):any {
|
package/src/Component.ts
CHANGED
|
@@ -22,7 +22,7 @@ import { CONFIG } from "./CONFIG";
|
|
|
22
22
|
import { serviceLoader } from "./serviceLoader";
|
|
23
23
|
import { _tag_filter_ } from "./tag_filter";
|
|
24
24
|
import { componentLoader } from "./componentLoader";
|
|
25
|
-
import { IComponent, IController, IEffect, IProcessor, IQCObjectsElement, IQCObjectsShadowedElement, IView, TBody, TComponentDoneResponse, TComponentParams, TComponentRouting, TComponentRoutings } from "
|
|
25
|
+
import { IComponent, IController, IEffect, IProcessor, IQCObjectsElement, IQCObjectsShadowedElement, IView, TBody, TComponentDoneResponse, TComponentParams, TComponentRouting, TComponentRoutings } from "types";
|
|
26
26
|
|
|
27
27
|
export class Component extends InheritClass implements IComponent {
|
|
28
28
|
static shadowed: boolean | undefined = false;
|
|
@@ -35,8 +35,8 @@ export class Component extends InheritClass implements IComponent {
|
|
|
35
35
|
tplextension!: string;
|
|
36
36
|
template!: string;
|
|
37
37
|
validRoutingWays: string[] = ["pathname", "hash", "search"];
|
|
38
|
-
basePath = _basePath_;
|
|
39
|
-
domain = _domain_;
|
|
38
|
+
basePath:string = _basePath_;
|
|
39
|
+
domain:string = _domain_;
|
|
40
40
|
templateHandler = "DefaultTemplateHandler";
|
|
41
41
|
processorHandler?: IProcessor;
|
|
42
42
|
routingWay: string | null = null;
|
|
@@ -179,7 +179,7 @@ export class Component extends InheritClass implements IComponent {
|
|
|
179
179
|
logger.debug("[cacheIndex] This property is readonly");
|
|
180
180
|
}
|
|
181
181
|
|
|
182
|
-
get cacheIndex() {
|
|
182
|
+
get cacheIndex():string {
|
|
183
183
|
const self = this;
|
|
184
184
|
const __routing_path__ = _DataStringify(self.routingPath);
|
|
185
185
|
return Base64.encode(self.name + __routing_path__);
|
|
@@ -349,7 +349,7 @@ export class Component extends InheritClass implements IComponent {
|
|
|
349
349
|
});
|
|
350
350
|
}
|
|
351
351
|
|
|
352
|
-
_bindroute_() {
|
|
352
|
+
_bindroute_():void {
|
|
353
353
|
const _component_ = this;
|
|
354
354
|
if (!(_component_ as any)._bindroute_.loaded) {
|
|
355
355
|
if (isBrowser) {
|
|
@@ -553,13 +553,13 @@ export class Component extends InheritClass implements IComponent {
|
|
|
553
553
|
return _component_.hostElements(tagFilter);
|
|
554
554
|
}
|
|
555
555
|
|
|
556
|
-
get bodyAttributes() {
|
|
556
|
+
get bodyAttributes():any {
|
|
557
557
|
const _component_ = this;
|
|
558
558
|
const c = _component_.body;
|
|
559
559
|
return (isBrowser) ? ([...(c as HTMLElement).getAttributeNames()].map(a => { return { [a]: (c as HTMLElement).getAttribute(a) }; }).reduce((accumulator, colData) => { return Object.assign(accumulator, colData); })) : ({});
|
|
560
560
|
}
|
|
561
561
|
|
|
562
|
-
get dataAttributes() {
|
|
562
|
+
get dataAttributes():any {
|
|
563
563
|
const _component_ = this;
|
|
564
564
|
const c = _component_.body;
|
|
565
565
|
return (isBrowser) ? ([{}].concat([...(c as HTMLElement).getAttributeNames()].filter(n => n.startsWith("data-")).map(a => { return { [a.split("-")[1]]: (c as HTMLElement).getAttribute(a) }; })).reduce((accumulator, colData) => { return Object.assign(accumulator, colData); })) : ({});
|
|
@@ -589,7 +589,7 @@ export class Component extends InheritClass implements IComponent {
|
|
|
589
589
|
return _ret_;
|
|
590
590
|
}
|
|
591
591
|
|
|
592
|
-
set(key: string, value: any) {
|
|
592
|
+
set(key: string, value: any):void {
|
|
593
593
|
this[key] = value;
|
|
594
594
|
}
|
|
595
595
|
|
|
@@ -806,11 +806,11 @@ export class Component extends InheritClass implements IComponent {
|
|
|
806
806
|
return _Cast(this, o);
|
|
807
807
|
}
|
|
808
808
|
|
|
809
|
-
route() {
|
|
809
|
+
route():Promise<void> {
|
|
810
810
|
return (this.constructor as typeof Component).route();
|
|
811
811
|
}
|
|
812
812
|
|
|
813
|
-
static route() {
|
|
813
|
+
static route():Promise<void> {
|
|
814
814
|
const componentClass = this; /* is can be class or object */
|
|
815
815
|
let _route_promise_;
|
|
816
816
|
const isValidInstance = !!((isQCObjects_Object(componentClass) && is_a(componentClass, "Component")));
|
|
@@ -880,7 +880,7 @@ export class Component extends InheritClass implements IComponent {
|
|
|
880
880
|
return _route_promise_;
|
|
881
881
|
}
|
|
882
882
|
|
|
883
|
-
fullscreen() {
|
|
883
|
+
fullscreen():void {
|
|
884
884
|
if (isBrowser) {
|
|
885
885
|
const elem: HTMLElement = this.body as HTMLElement;
|
|
886
886
|
if (elem.requestFullscreen) {
|
|
@@ -903,7 +903,7 @@ export class Component extends InheritClass implements IComponent {
|
|
|
903
903
|
}
|
|
904
904
|
}
|
|
905
905
|
|
|
906
|
-
closefullscreen() {
|
|
906
|
+
closefullscreen():void {
|
|
907
907
|
if (isBrowser) {
|
|
908
908
|
if (document.exitFullscreen) {
|
|
909
909
|
document.exitFullscreen()
|
|
@@ -920,7 +920,7 @@ export class Component extends InheritClass implements IComponent {
|
|
|
920
920
|
}
|
|
921
921
|
}
|
|
922
922
|
|
|
923
|
-
_generateRoutingPaths(componentBody: TBody) {
|
|
923
|
+
_generateRoutingPaths(componentBody: TBody):Promise<void> {
|
|
924
924
|
const component = this;
|
|
925
925
|
return new Promise<void>(function (resolve) {
|
|
926
926
|
if (isBrowser) {
|
|
@@ -1055,7 +1055,7 @@ export class Component extends InheritClass implements IComponent {
|
|
|
1055
1055
|
return null;
|
|
1056
1056
|
}
|
|
1057
1057
|
|
|
1058
|
-
applyTransitionEffect(effectClassName: string) {
|
|
1058
|
+
applyTransitionEffect(effectClassName: string):void {
|
|
1059
1059
|
const _Effect = ClassFactory(effectClassName);
|
|
1060
1060
|
if (typeof _Effect === "undefined") {
|
|
1061
1061
|
throw Error(`${effectClassName} not found.`);
|
|
@@ -1070,7 +1070,7 @@ export class Component extends InheritClass implements IComponent {
|
|
|
1070
1070
|
}
|
|
1071
1071
|
}
|
|
1072
1072
|
|
|
1073
|
-
applyObserveTransitionEffect(effectClassName: any) {
|
|
1073
|
+
applyObserveTransitionEffect(effectClassName: any):void {
|
|
1074
1074
|
if (isBrowser) {
|
|
1075
1075
|
const component = this;
|
|
1076
1076
|
const _componentRoot = component.componentRoot;
|
|
@@ -1100,7 +1100,7 @@ export class Component extends InheritClass implements IComponent {
|
|
|
1100
1100
|
return (this.shadowed) ? (this.shadowRoot) : (this.body);
|
|
1101
1101
|
}
|
|
1102
1102
|
|
|
1103
|
-
scrollIntoHash() {
|
|
1103
|
+
scrollIntoHash():void {
|
|
1104
1104
|
if (isBrowser) {
|
|
1105
1105
|
const component = this;
|
|
1106
1106
|
if (document.location.hash !== "") {
|
|
@@ -1125,7 +1125,7 @@ export class Component extends InheritClass implements IComponent {
|
|
|
1125
1125
|
}
|
|
1126
1126
|
}
|
|
1127
1127
|
|
|
1128
|
-
i18n_translate() {
|
|
1128
|
+
i18n_translate():void {
|
|
1129
1129
|
if (isBrowser) {
|
|
1130
1130
|
if (CONFIG.get("use_i18n")) {
|
|
1131
1131
|
const component = this;
|
|
@@ -1163,12 +1163,12 @@ export class Component extends InheritClass implements IComponent {
|
|
|
1163
1163
|
}
|
|
1164
1164
|
}
|
|
1165
1165
|
|
|
1166
|
-
addComponentHelper(componentHelper: any) {
|
|
1166
|
+
addComponentHelper(componentHelper: any):void {
|
|
1167
1167
|
const component = this;
|
|
1168
1168
|
component._componentHelpers.push(componentHelper as never);
|
|
1169
1169
|
}
|
|
1170
1170
|
|
|
1171
|
-
runComponentHelpers() {
|
|
1171
|
+
runComponentHelpers():void {
|
|
1172
1172
|
if (isBrowser) {
|
|
1173
1173
|
const component = this;
|
|
1174
1174
|
let __component_helpers__ = [];
|
package/src/ComponentFactory.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IQCObjectsElement, TComponentURIParams } from "
|
|
1
|
+
import { IQCObjectsElement, TComponentURIParams } from "types";
|
|
2
2
|
import { Class } from "./Class";
|
|
3
3
|
import { ClassFactory } from "./ClassFactory";
|
|
4
4
|
import { Component } from "./Component";
|
|
@@ -18,12 +18,12 @@ import { _tag_filter_ } from "./tag_filter";
|
|
|
18
18
|
* @author: Jean Machuca <correojean@gmail.com>
|
|
19
19
|
* @param params an object with the params to build the uri path
|
|
20
20
|
*/
|
|
21
|
-
export const ComponentURI = ({ TPL_SOURCE, COMPONENTS_BASE_PATH, COMPONENT_NAME, TPLEXTENSION }:TComponentURIParams) => {
|
|
21
|
+
export const ComponentURI = ({ TPL_SOURCE, COMPONENTS_BASE_PATH, COMPONENT_NAME, TPLEXTENSION }:TComponentURIParams):string => {
|
|
22
22
|
const templateURI = (TPL_SOURCE === "default") ? (`${COMPONENTS_BASE_PATH}${COMPONENT_NAME}.${TPLEXTENSION}`) : ("");
|
|
23
23
|
return templateURI;
|
|
24
24
|
};
|
|
25
25
|
|
|
26
|
-
export const _buildComponentFromElement_ =
|
|
26
|
+
export const _buildComponentFromElement_ = (element: Element, __parent__: any):Component => {
|
|
27
27
|
const __shadowed_not_set = (element.getAttribute("shadowed") === null);
|
|
28
28
|
const __tplsource_attr_not_set = (element.getAttribute("template-source") === null);
|
|
29
29
|
const shadowed = (element.getAttribute("shadowed") === "true");
|
|
@@ -101,7 +101,7 @@ export const _buildComponentFromElement_ = function (element: Element, __parent_
|
|
|
101
101
|
return newComponent;
|
|
102
102
|
};
|
|
103
103
|
|
|
104
|
-
export const _buildComponentsFromElements_ =
|
|
104
|
+
export const _buildComponentsFromElements_ = (elements: HTMLElement[], __parent__: Component | null):Component[] => {
|
|
105
105
|
let componentsBuiltWith:Component[] = [];
|
|
106
106
|
if (isBrowser) {
|
|
107
107
|
componentsBuiltWith = elements.map(
|
package/src/Controller.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IController, IComponent, TControllerParams
|
|
1
|
+
import { IController, IComponent, TControllerParams } from "types";
|
|
2
2
|
import { ClassFactory } from "./ClassFactory";
|
|
3
3
|
import { __getType__ } from "./getType";
|
|
4
4
|
import { InheritClass } from "./InheritClass";
|
|
@@ -37,21 +37,21 @@ export class Controller extends InheritClass implements IController{
|
|
|
37
37
|
}).pop();
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
isTouchable() {
|
|
40
|
+
isTouchable():boolean {
|
|
41
41
|
return ("ontouchstart" in window) ||
|
|
42
42
|
((navigator as any).MaxTouchPoints > 0) ||
|
|
43
43
|
((navigator as any).msMaxTouchPoints > 0);
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
onpress(subelementSelector: string, handler: Function) {
|
|
46
|
+
onpress(subelementSelector: string, handler: Function):void {
|
|
47
47
|
if (isBrowser){
|
|
48
48
|
try {
|
|
49
49
|
if (this.isTouchable()) {
|
|
50
|
-
((this.component?.componentRoot as
|
|
50
|
+
((this.component?.componentRoot as any)?.subelements(subelementSelector) as any[])[0].addEventListener("touchstart", handler, {
|
|
51
51
|
passive: true
|
|
52
52
|
});
|
|
53
53
|
} else {
|
|
54
|
-
((this.component?.componentRoot as
|
|
54
|
+
((this.component?.componentRoot as any)?.subelements(subelementSelector) as any[])[0].addEventListener("click", handler, {
|
|
55
55
|
passive: true
|
|
56
56
|
});
|
|
57
57
|
}
|
|
@@ -63,7 +63,7 @@ export class Controller extends InheritClass implements IController{
|
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
createRoutingController() {
|
|
66
|
+
createRoutingController():void {
|
|
67
67
|
const controller = this;
|
|
68
68
|
const component = controller.component;
|
|
69
69
|
const controllerName = controller.routingSelectedAttr("controllerclass");
|
|
@@ -82,7 +82,7 @@ export class Controller extends InheritClass implements IController{
|
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
-
done() { }
|
|
85
|
+
done():void { }
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
Package("com.qcobjects.controllers", [
|