qcobjects 2.5.105-beta → 2.5.107-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/top.js +5 -4
- package/package.json +8 -4
- 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/{build → public/types}/index.d.ts +110 -106
- 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/tsconfig.d.json +1 -1
|
@@ -20,72 +20,6 @@ declare module "platform" {
|
|
|
20
20
|
export const _require_: (name: string) => any;
|
|
21
21
|
export const is_phonegap: boolean;
|
|
22
22
|
}
|
|
23
|
-
declare module "Logger" {
|
|
24
|
-
export class Logger {
|
|
25
|
-
debugEnabled: boolean;
|
|
26
|
-
infoEnabled: boolean;
|
|
27
|
-
warnEnabled: boolean;
|
|
28
|
-
debug(message: string): void;
|
|
29
|
-
info(message: string): void;
|
|
30
|
-
warn(message: string): void;
|
|
31
|
-
}
|
|
32
|
-
export const logger: Logger;
|
|
33
|
-
}
|
|
34
|
-
declare module "New" {
|
|
35
|
-
/**
|
|
36
|
-
* Creates an object from a Class definition
|
|
37
|
-
*
|
|
38
|
-
* @param {QC_Object} o
|
|
39
|
-
* @param {Object} args
|
|
40
|
-
*/
|
|
41
|
-
export const New: (__class__: any, args?: {}) => any;
|
|
42
|
-
}
|
|
43
|
-
declare module "mathFunctions" {
|
|
44
|
-
export const __to_number: (value: any) => number;
|
|
45
|
-
}
|
|
46
|
-
declare module "ArrayCollection" {
|
|
47
|
-
import { IArrayCollection, IArrayList } from "types";
|
|
48
|
-
export class ArrayList extends Array implements IArrayList {
|
|
49
|
-
prototype: any;
|
|
50
|
-
unique(): any[];
|
|
51
|
-
table(): void;
|
|
52
|
-
sum(): number;
|
|
53
|
-
avg(): number;
|
|
54
|
-
min(): number;
|
|
55
|
-
max(): number;
|
|
56
|
-
sortBy(propName: string, sortAsc?: boolean): any[];
|
|
57
|
-
matrix(length: number, fillValue?: number): any[];
|
|
58
|
-
matrix2d(length: number, fillValue?: number): any[][];
|
|
59
|
-
matrix3d(length: number, fillValue?: number): any[][][];
|
|
60
|
-
}
|
|
61
|
-
export class ArrayCollection implements IArrayCollection {
|
|
62
|
-
source: ArrayList;
|
|
63
|
-
changed(prop: string, value: any): void;
|
|
64
|
-
push(value: any): void;
|
|
65
|
-
pop(): void;
|
|
66
|
-
_new_(source: ArrayList): void;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
declare module "basePath" {
|
|
70
|
-
export var _basePath_: string;
|
|
71
|
-
export const setBasePath: (value: string) => void;
|
|
72
|
-
}
|
|
73
|
-
declare module "LegacyCopy" {
|
|
74
|
-
export const _LegacyCopy: (obj: any, _ignore?: string[]) => any;
|
|
75
|
-
}
|
|
76
|
-
declare module "DataStringify" {
|
|
77
|
-
export const _DataStringify: (data: any) => string;
|
|
78
|
-
}
|
|
79
|
-
declare module "domain" {
|
|
80
|
-
export const _domain_: string;
|
|
81
|
-
}
|
|
82
|
-
declare module "IncrementInstanceID" {
|
|
83
|
-
/**
|
|
84
|
-
* Primary instance ID of all objects
|
|
85
|
-
*/
|
|
86
|
-
export var __instanceID: number;
|
|
87
|
-
export const IncrementInstanceID: () => void;
|
|
88
|
-
}
|
|
89
23
|
declare module "Cast" {
|
|
90
24
|
/**
|
|
91
25
|
* Casts an object to another object class type
|
|
@@ -100,7 +34,7 @@ declare module "Cast" {
|
|
|
100
34
|
* @param {Object} obj_source
|
|
101
35
|
* @param {Object} obj_dest
|
|
102
36
|
*/
|
|
103
|
-
export const _CastProps: (obj_source: any, obj_dest: any) => any;
|
|
37
|
+
export const _CastProps: (obj_source: any, obj_dest: any, _ignoreError?: boolean) => any;
|
|
104
38
|
}
|
|
105
39
|
declare module "DOMCreateElement" {
|
|
106
40
|
import { IQCObjectsElement } from "types";
|
|
@@ -122,10 +56,57 @@ declare module "getType" {
|
|
|
122
56
|
*/
|
|
123
57
|
export const __getType__: (o_c: any) => any;
|
|
124
58
|
}
|
|
59
|
+
declare module "IncrementInstanceID" {
|
|
60
|
+
/**
|
|
61
|
+
* Primary instance ID of all objects
|
|
62
|
+
*/
|
|
63
|
+
export var __instanceID: number;
|
|
64
|
+
export const IncrementInstanceID: () => void;
|
|
65
|
+
}
|
|
125
66
|
declare module "introspection" {
|
|
126
67
|
export const _protected_code_: (_: any) => void;
|
|
127
68
|
export const _methods_: <T>(_: any) => T[];
|
|
128
69
|
}
|
|
70
|
+
declare module "RegisterClass" {
|
|
71
|
+
export const __register_class__: (_class_: any, __namespace?: string) => any;
|
|
72
|
+
export const RegisterClass: (_class_: any, __namespace?: string) => any;
|
|
73
|
+
}
|
|
74
|
+
declare module "Package" {
|
|
75
|
+
/**
|
|
76
|
+
* Defines a package for Class classification
|
|
77
|
+
*
|
|
78
|
+
* @param {Object} namespace
|
|
79
|
+
* @param {Object} classes
|
|
80
|
+
*/
|
|
81
|
+
export const Package: (namespace: string, classes?: any[]) => any[] | undefined;
|
|
82
|
+
}
|
|
83
|
+
declare module "InheritClass" {
|
|
84
|
+
import { type IInheritClass, type TBody } from "types";
|
|
85
|
+
export class InheritClass implements IInheritClass {
|
|
86
|
+
[key: string]: any;
|
|
87
|
+
__definition: any;
|
|
88
|
+
private _body;
|
|
89
|
+
get body(): TBody;
|
|
90
|
+
set body(value: TBody);
|
|
91
|
+
childs: any;
|
|
92
|
+
__instanceID: number;
|
|
93
|
+
constructor(_o_?: any);
|
|
94
|
+
static get __classType(): any;
|
|
95
|
+
get __classType(): string;
|
|
96
|
+
static hierarchy(__class__: any): any[];
|
|
97
|
+
__namespace?: string | undefined;
|
|
98
|
+
__new__(_o_: any): void;
|
|
99
|
+
_new_(_o_?: any): void;
|
|
100
|
+
static getParentClass(): any;
|
|
101
|
+
getParentClass(): any;
|
|
102
|
+
static getClass(): any;
|
|
103
|
+
getClass(): any;
|
|
104
|
+
css(_css: any): any;
|
|
105
|
+
hierarchy(): any;
|
|
106
|
+
append(_child?: any): void;
|
|
107
|
+
attachIn(tag: any): void;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
129
110
|
declare module "isQCObjects" {
|
|
130
111
|
export const isQCObjects_Object: (_: any) => boolean;
|
|
131
112
|
export const isQCObjects_Class: (_: any) => boolean;
|
|
@@ -149,6 +130,9 @@ declare module "is_forbidden_name" {
|
|
|
149
130
|
*/
|
|
150
131
|
export const __is__forbidden_name__: (name: string) => boolean;
|
|
151
132
|
}
|
|
133
|
+
declare module "LegacyCopy" {
|
|
134
|
+
export const _LegacyCopy: (obj: any, _ignore?: string[]) => any;
|
|
135
|
+
}
|
|
152
136
|
declare module "Class" {
|
|
153
137
|
import { TClass } from "types";
|
|
154
138
|
/**
|
|
@@ -188,6 +172,25 @@ declare module "Base64" {
|
|
|
188
172
|
_utf8_decode(e: string): string;
|
|
189
173
|
};
|
|
190
174
|
}
|
|
175
|
+
declare module "basePath" {
|
|
176
|
+
export var _basePath_: string;
|
|
177
|
+
export const setBasePath: (value: string) => void;
|
|
178
|
+
}
|
|
179
|
+
declare module "DataStringify" {
|
|
180
|
+
export const _DataStringify: (data: any) => string;
|
|
181
|
+
}
|
|
182
|
+
declare module "domain" {
|
|
183
|
+
export const _domain_: string;
|
|
184
|
+
}
|
|
185
|
+
declare module "New" {
|
|
186
|
+
/**
|
|
187
|
+
* Creates an object from a Class definition
|
|
188
|
+
*
|
|
189
|
+
* @param {QC_Object} o
|
|
190
|
+
* @param {Object} args
|
|
191
|
+
*/
|
|
192
|
+
export const New: (__class__: any, args?: {}) => any;
|
|
193
|
+
}
|
|
191
194
|
declare module "secretKey" {
|
|
192
195
|
export const _secretKey: string;
|
|
193
196
|
}
|
|
@@ -280,9 +283,6 @@ declare module "routings" {
|
|
|
280
283
|
export const __valid_routings__: (routings: TComponentRouting[], routingPath: string) => TComponentRouting[];
|
|
281
284
|
export const __valid_routing_way__: (validRoutingWays: string[], routingWay: string) => boolean;
|
|
282
285
|
}
|
|
283
|
-
declare module "Export" {
|
|
284
|
-
export const Export: (f: any) => void;
|
|
285
|
-
}
|
|
286
286
|
declare module "asyncLoad" {
|
|
287
287
|
import { TAsyncLoadCallback } from "types";
|
|
288
288
|
export const _asyncLoad: never[];
|
|
@@ -517,12 +517,16 @@ declare module "Service" {
|
|
|
517
517
|
declare module "globalSettings" {
|
|
518
518
|
import { IGlobalSettings } from "types";
|
|
519
519
|
import { InheritClass } from "InheritClass";
|
|
520
|
+
import { Logger } from "Logger";
|
|
520
521
|
export class GlobalSettings extends InheritClass implements IGlobalSettings {
|
|
521
522
|
static __start__(): Promise<any>;
|
|
522
523
|
[key: string]: any;
|
|
523
524
|
_GLOBAL: any;
|
|
524
525
|
private static _instance;
|
|
525
526
|
static get instance(): GlobalSettings;
|
|
527
|
+
protected _logger: Logger;
|
|
528
|
+
get logger(): Logger;
|
|
529
|
+
set logger(value: Logger);
|
|
526
530
|
set(name: string, value: any): void;
|
|
527
531
|
get(name: string, _default?: any): any;
|
|
528
532
|
__start__(): Promise<any>;
|
|
@@ -626,44 +630,44 @@ declare module "top" {
|
|
|
626
630
|
declare module "make_global" {
|
|
627
631
|
export const __make_global__: (f: any) => void;
|
|
628
632
|
}
|
|
629
|
-
declare module "
|
|
630
|
-
export const
|
|
631
|
-
export const RegisterClass: (_class_: any, __namespace?: string) => any;
|
|
633
|
+
declare module "Export" {
|
|
634
|
+
export const Export: (f: any) => void;
|
|
632
635
|
}
|
|
633
|
-
declare module "
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
636
|
+
declare module "Logger" {
|
|
637
|
+
export class Logger {
|
|
638
|
+
debugEnabled: boolean;
|
|
639
|
+
infoEnabled: boolean;
|
|
640
|
+
warnEnabled: boolean;
|
|
641
|
+
debug(message: string): void;
|
|
642
|
+
info(message: string): void;
|
|
643
|
+
warn(message: string): void;
|
|
644
|
+
}
|
|
645
|
+
export const logger: Logger;
|
|
641
646
|
}
|
|
642
|
-
declare module "
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
attachIn(tag: any): void;
|
|
647
|
+
declare module "mathFunctions" {
|
|
648
|
+
export const __to_number: (value: any) => number;
|
|
649
|
+
}
|
|
650
|
+
declare module "ArrayCollection" {
|
|
651
|
+
import { IArrayCollection, IArrayList } from "types";
|
|
652
|
+
export class ArrayList extends Array implements IArrayList {
|
|
653
|
+
prototype: any;
|
|
654
|
+
unique(): any[];
|
|
655
|
+
table(): void;
|
|
656
|
+
sum(): number;
|
|
657
|
+
avg(): number;
|
|
658
|
+
min(): number;
|
|
659
|
+
max(): number;
|
|
660
|
+
sortBy(propName: string, sortAsc?: boolean): any[];
|
|
661
|
+
matrix(length: number, fillValue?: number): any[];
|
|
662
|
+
matrix2d(length: number, fillValue?: number): any[][];
|
|
663
|
+
matrix3d(length: number, fillValue?: number): any[][][];
|
|
664
|
+
}
|
|
665
|
+
export class ArrayCollection implements IArrayCollection {
|
|
666
|
+
source: ArrayList;
|
|
667
|
+
changed(prop: string, value: any): void;
|
|
668
|
+
push(value: any): void;
|
|
669
|
+
pop(): void;
|
|
670
|
+
_new_(source: ArrayList): void;
|
|
667
671
|
}
|
|
668
672
|
}
|
|
669
673
|
declare module "BackendMicroservice" {
|
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();
|
package/tsconfig.d.json
CHANGED