qcobjects 2.5.105-beta → 2.5.106-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/VERSION +1 -1
- package/build/Cast.js +4 -2
- package/build/Logger.js +2 -0
- package/build/MainProcess.js +3 -6
- package/build/globalSettings.js +7 -0
- package/build/index.d.ts +110 -106
- package/build/top.js +5 -4
- package/package.json +1 -1
- package/public/browser/QCObjects.js +64 -55
- package/public/browser/QCObjects.js.map +4 -4
- package/public/cjs/QCObjects.cjs +64 -55
- package/public/cjs/QCObjects.cjs.map +4 -4
- package/public/esm/QCObjects.mjs +64 -55
- package/public/esm/QCObjects.mjs.map +4 -4
- package/src/Cast.ts +4 -2
- package/src/Logger.ts +2 -0
- package/src/MainProcess.ts +4 -8
- package/src/globalSettings.ts +10 -1
- package/src/top.ts +7 -5
package/src/Cast.ts
CHANGED
|
@@ -26,13 +26,15 @@ export const _Cast = function (obj_source: any, obj_dest: any):any {
|
|
|
26
26
|
* @param {Object} obj_source
|
|
27
27
|
* @param {Object} obj_dest
|
|
28
28
|
*/
|
|
29
|
-
export const _CastProps = function (obj_source: any, obj_dest: any):any {
|
|
29
|
+
export const _CastProps = function (obj_source: any, obj_dest: any, _ignoreError:boolean = true):any {
|
|
30
30
|
for (const v in obj_source) {
|
|
31
31
|
if (typeof obj_source[v] !== "undefined" && typeof obj_source[v] !== "function") {
|
|
32
32
|
try {
|
|
33
33
|
obj_dest[v] = obj_source[v];
|
|
34
34
|
} catch (e:any) {
|
|
35
|
-
|
|
35
|
+
if (!_ignoreError){
|
|
36
|
+
logger.debug(`An error ocurred: ${e}.`);
|
|
37
|
+
}
|
|
36
38
|
}
|
|
37
39
|
} else if (typeof obj_source[v] === "function") {
|
|
38
40
|
try {
|
package/src/Logger.ts
CHANGED
package/src/MainProcess.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IQCObjectsElement, IQCObjectsShadowedElement } from "types";
|
|
2
|
+
import { _top } from "./top";
|
|
2
3
|
import { _fireAsyncLoad, asyncLoad } from "./asyncLoad";
|
|
3
4
|
import { captureFalseTouch } from "./captureFalseTouch";
|
|
4
5
|
import { _Cast } from "./Cast";
|
|
@@ -25,7 +26,6 @@ import { _QC_CLASSES, _QC_PACKAGES } from "./PrimaryCollections";
|
|
|
25
26
|
import { _Ready, ready, Ready } from "./Ready";
|
|
26
27
|
import { serviceLoader } from "./serviceLoader";
|
|
27
28
|
import { Tag } from "./Tag";
|
|
28
|
-
import { _top, resetTop } from "./top";
|
|
29
29
|
import { Processor } from "./Processor";
|
|
30
30
|
import { is_a } from "./is_a";
|
|
31
31
|
import { __getType__ } from "./getType";
|
|
@@ -37,6 +37,7 @@ import { waitUntil } from "./waitUntil";
|
|
|
37
37
|
import { subelements } from "./subelements";
|
|
38
38
|
import { GlobalSettings } from "./globalSettings";
|
|
39
39
|
import loadSDK from "./loadSDK";
|
|
40
|
+
import { range } from "./range";
|
|
40
41
|
|
|
41
42
|
(function __qcobjects__(_top: any) {
|
|
42
43
|
if (typeof Object.defineProperty !== "undefined" && typeof _top !== "undefined") {
|
|
@@ -56,10 +57,7 @@ import loadSDK from "./loadSDK";
|
|
|
56
57
|
}
|
|
57
58
|
if (typeof _top.__qcobjects__.loaded === "undefined") {
|
|
58
59
|
_top.__qcobjects__.loaded = true;
|
|
59
|
-
|
|
60
|
-
const global = _top;
|
|
61
|
-
_top.global = global;
|
|
62
|
-
|
|
60
|
+
|
|
63
61
|
if (isBrowser) {
|
|
64
62
|
(Element as unknown as IQCObjectsElement).prototype.subelements = subelements;
|
|
65
63
|
(Document as unknown as IQCObjectsElement).prototype.subelements = subelements;
|
|
@@ -72,7 +70,6 @@ import loadSDK from "./loadSDK";
|
|
|
72
70
|
|
|
73
71
|
logger.debugEnabled = false;
|
|
74
72
|
logger.infoEnabled = true;
|
|
75
|
-
_top.logger = logger;
|
|
76
73
|
|
|
77
74
|
/**
|
|
78
75
|
* Basic Type of all elements
|
|
@@ -381,7 +378,7 @@ import loadSDK from "./loadSDK";
|
|
|
381
378
|
|
|
382
379
|
(String as unknown as any).prototype.list = function ():string[] {
|
|
383
380
|
const __instance = this;
|
|
384
|
-
return
|
|
381
|
+
return range(0, __instance.length - 1).map(function <T>(i:any):T {
|
|
385
382
|
return __instance[i] as T;
|
|
386
383
|
}) as string[];
|
|
387
384
|
};
|
|
@@ -425,7 +422,6 @@ import loadSDK from "./loadSDK";
|
|
|
425
422
|
Export(_methods_);
|
|
426
423
|
Export(GlobalSettings);
|
|
427
424
|
|
|
428
|
-
resetTop();
|
|
429
425
|
|
|
430
426
|
(function (_top) {
|
|
431
427
|
|
package/src/globalSettings.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IGlobalSettings } from "types";
|
|
2
2
|
import { CONFIG } from "./CONFIG";
|
|
3
3
|
import { InheritClass } from "./InheritClass";
|
|
4
|
-
import { logger } from "./Logger";
|
|
4
|
+
import { Logger, logger } from "./Logger";
|
|
5
5
|
import { Package } from "./Package";
|
|
6
6
|
import { isBrowser } from "./platform";
|
|
7
7
|
import { serviceLoader } from "./serviceLoader";
|
|
@@ -23,6 +23,15 @@ export class GlobalSettings extends InheritClass implements IGlobalSettings{
|
|
|
23
23
|
return GlobalSettings._instance;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
+
protected _logger:Logger = new Logger();
|
|
27
|
+
get logger ():Logger {
|
|
28
|
+
return this._logger;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
set logger (value:Logger) {
|
|
32
|
+
this._logger = value;
|
|
33
|
+
}
|
|
34
|
+
|
|
26
35
|
set(name: string, value: any) {
|
|
27
36
|
this._GLOBAL[name] = value;
|
|
28
37
|
}
|
package/src/top.ts
CHANGED
|
@@ -102,8 +102,8 @@ export var _top: QCObjects = (
|
|
|
102
102
|
export let componentsStack:IComponent[] = [];
|
|
103
103
|
|
|
104
104
|
export const resetTop = () => {
|
|
105
|
-
const globalSettings =
|
|
106
|
-
_top = _CastProps(globalSettings, _top);
|
|
105
|
+
const globalSettings = GlobalSettings.instance;
|
|
106
|
+
_top = _CastProps(globalSettings, _top, true);
|
|
107
107
|
};
|
|
108
108
|
|
|
109
109
|
export const buildComponentsStack = () => {
|
|
@@ -116,9 +116,11 @@ export const setConfigService = (_configService:IConfigService) => {
|
|
|
116
116
|
};
|
|
117
117
|
|
|
118
118
|
export const set = (name:string, value:any):void => {
|
|
119
|
-
_top
|
|
119
|
+
_top[name as never] = value;
|
|
120
120
|
};
|
|
121
121
|
|
|
122
122
|
export const get = (name:string, _defaultValue?:any):any => {
|
|
123
|
-
return _top
|
|
124
|
-
};
|
|
123
|
+
return _top[name as never] || _defaultValue;
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
resetTop();
|