qcobjects 2.4.107-ts → 2.4.108-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.
Files changed (197) hide show
  1. package/.hintrc +5 -0
  2. package/VERSION +1 -1
  3. package/build/ArrayCollection.js +136 -0
  4. package/build/BackendMicroservice.js +211 -0
  5. package/build/Base64.js +100 -0
  6. package/build/CONFIG.js +85 -0
  7. package/build/Cast.js +53 -0
  8. package/build/Class.js +284 -0
  9. package/build/ClassFactory.js +38 -0
  10. package/build/ComplexStorageCache.js +91 -0
  11. package/build/Component.js +1133 -0
  12. package/build/ComponentFactory.js +113 -0
  13. package/build/ConfigSettings.js +39 -0
  14. package/build/Controller.js +81 -0
  15. package/build/Crypt.js +87 -0
  16. package/build/DDO.js +81 -0
  17. package/build/DOMCreateElement.js +15 -0
  18. package/build/DataStringify.js +22 -0
  19. package/build/DefaultTemplateHandler.js +57 -0
  20. package/build/DocumentLayout.js +20 -0
  21. package/build/Effect.js +46 -0
  22. package/build/Export.js +11 -0
  23. package/build/Import.js +140 -0
  24. package/build/IncrementInstanceID.js +11 -0
  25. package/build/InheritClass.js +194 -0
  26. package/build/LegacyCopy.js +31 -0
  27. package/build/Logger.js +33 -0
  28. package/build/MainProcess.js +549 -0
  29. package/build/NamespaceRef.js +29 -0
  30. package/build/New.js +17 -0
  31. package/build/ObjectName.js +22 -0
  32. package/build/Package.js +67 -0
  33. package/build/PrimaryCollections.js +7 -0
  34. package/build/Processor.js +81 -0
  35. package/build/QCObjects.js +182 -4843
  36. package/build/Ready.js +49 -0
  37. package/build/RegisterClass.js +28 -0
  38. package/build/Service.js +112 -0
  39. package/build/SourceCSS.js +56 -0
  40. package/build/SourceJS.js +73 -0
  41. package/build/Tag.js +77 -0
  42. package/build/Timer.js +30 -0
  43. package/build/Toggle.js +59 -0
  44. package/build/TransitionEffect.js +65 -0
  45. package/build/VO.js +11 -0
  46. package/build/View.js +18 -0
  47. package/build/WidgetsFactory.js +537 -0
  48. package/build/assign.js +32 -0
  49. package/build/asyncLoad.js +43 -0
  50. package/build/basePath.js +32 -0
  51. package/build/captureFalseTouch.js +32 -0
  52. package/build/componentLoader.js +258 -0
  53. package/build/defaultProcessors.js +130 -0
  54. package/build/domain.js +4 -0
  55. package/build/findPackageNodePath.js +47 -0
  56. package/build/getType.js +38 -0
  57. package/build/globalSettings.js +115 -0
  58. package/build/index.d.ts +1045 -0
  59. package/build/index.js +24 -4
  60. package/build/index.mjs +1 -1
  61. package/build/introspection.js +86 -0
  62. package/build/isQCObjects.js +20 -0
  63. package/build/is_a.js +19 -0
  64. package/build/is_forbidden_name.js +15 -0
  65. package/build/is_raw_class.js +7 -0
  66. package/build/loadSDK.js +63 -0
  67. package/build/localStorage.js +19 -0
  68. package/build/make_global.js +24 -0
  69. package/build/mathFunctions.js +7 -0
  70. package/build/platform.js +28 -0
  71. package/build/range.js +17 -0
  72. package/build/routings.js +21 -0
  73. package/build/secretKey.js +5 -0
  74. package/build/serviceLoader.js +300 -0
  75. package/build/shortCode.js +14 -0
  76. package/build/subelements.js +8 -0
  77. package/build/super.js +20 -0
  78. package/build/tag_filter.js +4 -0
  79. package/build/top.js +23 -0
  80. package/build/uniqueID.js +5 -0
  81. package/build/waitUntil.js +31 -0
  82. package/build-esbuild.js +62 -0
  83. package/eslint.config.mjs +87 -0
  84. package/package.json +26 -23
  85. package/public/browser/index.js +6502 -0
  86. package/public/browser/index.js.map +7 -0
  87. package/public/cjs/index.cjs +6586 -0
  88. package/public/cjs/index.cjs.map +7 -0
  89. package/public/esm/index.mjs +6494 -0
  90. package/public/esm/index.mjs.map +7 -0
  91. package/spec/helpers/mock-sdk.helper.ts +5 -0
  92. package/spec/mocks/qcobjects-sdk.mock.ts +1 -0
  93. package/spec/support/jasmine.json +3 -3
  94. package/spec/testsClassFactorySpec.ts +40 -0
  95. package/spec/{testsConfigSpec.js → testsConfigSpec.ts} +2 -2
  96. package/spec/{testsGlobalFeaturesSpec.js → testsGlobalFeaturesSpec.ts} +10 -8
  97. package/spec/{testsSpec.js → testsSpec.ts} +11 -10
  98. package/spec/{testsTypeSpec.js → testsTypeSpec.ts} +5 -3
  99. package/src/ArrayCollection.ts +143 -0
  100. package/src/BackendMicroservice.ts +229 -0
  101. package/src/Base64.ts +92 -0
  102. package/src/CONFIG.ts +96 -0
  103. package/src/Cast.ts +46 -0
  104. package/src/Class.ts +303 -0
  105. package/src/ClassFactory.ts +34 -0
  106. package/src/ComplexStorageCache.ts +97 -0
  107. package/src/Component.ts +1222 -0
  108. package/src/ComponentFactory.ts +122 -0
  109. package/src/ConfigSettings.ts +62 -0
  110. package/src/Controller.ts +90 -0
  111. package/src/Crypt.ts +87 -0
  112. package/src/DDO.ts +93 -0
  113. package/src/DOMCreateElement.ts +12 -0
  114. package/src/DataStringify.ts +19 -0
  115. package/src/DefaultTemplateHandler.ts +55 -0
  116. package/src/DocumentLayout.ts +16 -0
  117. package/src/Effect.ts +56 -0
  118. package/src/Export.ts +8 -0
  119. package/src/Import.ts +135 -0
  120. package/src/IncrementInstanceID.ts +8 -0
  121. package/src/InheritClass.ts +210 -0
  122. package/src/LegacyCopy.ts +27 -0
  123. package/src/Logger.ts +32 -0
  124. package/src/MainProcess.ts +629 -0
  125. package/src/NamespaceRef.ts +26 -0
  126. package/src/New.ts +15 -0
  127. package/src/ObjectName.ts +16 -0
  128. package/src/Package.ts +67 -0
  129. package/src/PrimaryCollections.ts +7 -0
  130. package/src/Processor.ts +93 -0
  131. package/src/QCObjects.ts +100 -0
  132. package/src/Ready.ts +44 -0
  133. package/src/RegisterClass.ts +26 -0
  134. package/src/Service.ts +127 -0
  135. package/src/SourceCSS.ts +59 -0
  136. package/src/SourceJS.ts +76 -0
  137. package/src/Tag.ts +76 -0
  138. package/src/Timer.ts +42 -0
  139. package/src/Toggle.ts +65 -0
  140. package/src/TransitionEffect.ts +80 -0
  141. package/src/VO.ts +8 -0
  142. package/src/View.ts +17 -0
  143. package/src/WidgetsFactory.ts +543 -0
  144. package/src/assign.ts +33 -0
  145. package/src/asyncLoad.ts +42 -0
  146. package/src/basePath.ts +29 -0
  147. package/src/captureFalseTouch.ts +29 -0
  148. package/src/componentLoader.ts +252 -0
  149. package/src/defaultProcessors.ts +145 -0
  150. package/src/domain.ts +1 -0
  151. package/src/findPackageNodePath.ts +43 -0
  152. package/src/getType.ts +36 -0
  153. package/src/globalSettings.ts +118 -0
  154. package/src/index.mts +1 -1
  155. package/src/index.ts +1 -1
  156. package/src/introspection.ts +80 -0
  157. package/src/isQCObjects.ts +19 -0
  158. package/src/is_a.ts +16 -0
  159. package/src/is_forbidden_name.ts +12 -0
  160. package/src/is_raw_class.ts +3 -0
  161. package/src/loadSDK.ts +59 -0
  162. package/src/localStorage.ts +17 -0
  163. package/src/make_global.ts +19 -0
  164. package/src/mathFunctions.ts +3 -0
  165. package/src/platform.ts +30 -0
  166. package/src/range.ts +15 -0
  167. package/src/routings.ts +18 -0
  168. package/src/secretKey.ts +3 -0
  169. package/src/serviceLoader.ts +306 -0
  170. package/src/shortCode.ts +11 -0
  171. package/src/subelements.ts +4 -0
  172. package/src/super.ts +17 -0
  173. package/src/tag_filter.ts +1 -0
  174. package/src/top.ts +111 -0
  175. package/src/types/global/index.d.ts +597 -0
  176. package/src/uniqueID.ts +3 -0
  177. package/src/waitUntil.ts +26 -0
  178. package/tsconfig.d.json +35 -8
  179. package/tsconfig.jasmine.json +39 -0
  180. package/tsconfig.json +46 -12
  181. package/.eslintignore +0 -5
  182. package/.eslintrc.cjs +0 -21
  183. package/.eslintrc.json +0 -24
  184. package/browser/QCObjects.js +0 -2
  185. package/browser/QCObjects.js.map +0 -7
  186. package/browser/chunks/chunk-O2PFFZVJ.js +0 -713
  187. package/browser/chunks/chunk-O2PFFZVJ.js.map +0 -7
  188. package/browser/chunks/chunk-TBLBK5VV.js +0 -713
  189. package/browser/chunks/chunk-TBLBK5VV.js.map +0 -7
  190. package/browser/chunks/chunk-ZYLXOA35.js +0 -713
  191. package/browser/chunks/chunk-ZYLXOA35.js.map +0 -7
  192. package/browser/index.js +0 -2
  193. package/browser/index.js.map +0 -7
  194. package/spec/testsClassFactorySpec.js +0 -41
  195. package/src/QCObjects.js +0 -5247
  196. package/src/index.d.ts +0 -8
  197. package/types/index.d.ts +0 -472
package/src/Timer.ts ADDED
@@ -0,0 +1,42 @@
1
+ import { ITimer, TTimerParams } from "types";
2
+ import { InheritClass } from "./InheritClass";
3
+ import { Package } from "./Package";
4
+
5
+ export class Timer extends InheritClass implements ITimer {
6
+
7
+
8
+ duration = 1000;
9
+ alive = true;
10
+ thread({
11
+ timing,
12
+ intervalInterceptor,
13
+ duration
14
+ }:TTimerParams) {
15
+ const timer = this;
16
+
17
+ const start = performance.now();
18
+
19
+ requestAnimationFrame(function thread(time) {
20
+ // timeFraction goes from 0 to 1
21
+ const elapsed = (time - start);
22
+ let timeFraction = elapsed / duration;
23
+ if (timeFraction > 1) timeFraction = 1;
24
+
25
+ // calculate the current progress state
26
+ const progress = timing(timeFraction, elapsed);
27
+
28
+ intervalInterceptor(Math.round(progress * 100)); // draw it
29
+
30
+ if ((timeFraction < 1 || duration === -1) && timer.alive) {
31
+ requestAnimationFrame(thread);
32
+ }
33
+
34
+ });
35
+ }
36
+
37
+
38
+ }
39
+
40
+ Package("com.qcobjects.timing", [
41
+ Timer
42
+ ]);
package/src/Toggle.ts ADDED
@@ -0,0 +1,65 @@
1
+ import { InheritClass } from "./InheritClass";
2
+ import { logger } from "./Logger";
3
+ import { Package } from "./Package";
4
+ export class Toggle extends InheritClass {
5
+ _toggle = false;
6
+ _inverse = true;
7
+ _positive:Function|null = null;
8
+ _negative:Function|null = null;
9
+ _dispatched:Function|null = null;
10
+ _args = {};
11
+
12
+ constructor(positive: Function, negative: Function, args: Array<any>) {
13
+ super({positive, negative, args});
14
+ this._new_({positive, negative, args});
15
+ }
16
+
17
+ changeToggle() {
18
+ this._toggle = !(this._toggle);
19
+ }
20
+
21
+ _new_({
22
+ positive,
23
+ negative,
24
+ args
25
+ }:{positive: Function, negative: Function, args: Array<any>}) {
26
+ this._positive = positive;
27
+ this._negative = negative;
28
+ this._args = args;
29
+ }
30
+
31
+ fire():Promise<Toggle> {
32
+ const toggle = this;
33
+ var _promise = new Promise<Toggle>(function (resolve, reject) {
34
+
35
+ if (typeof toggle._positive === "function" && typeof toggle._negative === "function") {
36
+ if (toggle._inverse) {
37
+ toggle._dispatched = (toggle._toggle) ? (toggle._negative.bind(toggle)) : (toggle._positive.bind(toggle));
38
+ } else {
39
+ toggle._dispatched = (toggle._toggle) ? (toggle._positive.bind(toggle)) : (toggle._negative.bind(toggle));
40
+ }
41
+ toggle._dispatched?.call(toggle, toggle._args);
42
+ resolve.call(_promise, toggle);
43
+ } else {
44
+ logger.debug("Toggle functions are not declared");
45
+ reject.call(_promise, toggle as Toggle);
46
+ }
47
+ return toggle;
48
+ }).then(function (toggle:Toggle) {
49
+ toggle.changeToggle();
50
+ return toggle;
51
+ }).catch(function (e) {
52
+ logger.debug(e.toString());
53
+ return toggle;
54
+ }).finally(()=> {
55
+ return toggle;
56
+ });
57
+ return _promise;
58
+ }
59
+
60
+
61
+ }
62
+
63
+ Package("com.qcobjects.tools.essentials", [
64
+ Toggle
65
+ ]);
@@ -0,0 +1,80 @@
1
+ import { Effect } from "./Effect";
2
+ import { logger } from "./Logger";
3
+ import { Package } from "./Package";
4
+ import { ClassFactory } from "./ClassFactory";
5
+ import { IComponent, IQCObjectsElement, IQCObjectsShadowedElement, ITransitionEffect, TTransitionEffectParams } from "types";
6
+
7
+ export class TransitionEffect extends Effect implements ITransitionEffect{
8
+ duration = 385;
9
+ defaultParams = {
10
+ alphaFrom: 0,
11
+ alphaTo: 1,
12
+ angleFrom: 180,
13
+ angleTo: 0,
14
+ radiusFrom: 0,
15
+ radiusTo: 30,
16
+ scaleFrom: 0,
17
+ scaleTo: 1
18
+ };
19
+
20
+ fitToHeight = false;
21
+ fitToWidth = false;
22
+
23
+ component!: IComponent;
24
+ effects!: string[];
25
+
26
+ apply({
27
+ alphaFrom,
28
+ alphaTo,
29
+ angleFrom,
30
+ angleTo,
31
+ radiusFrom,
32
+ radiusTo,
33
+ scaleFrom,
34
+ scaleTo
35
+ }: TTransitionEffectParams) {
36
+ const _transition_ = this;
37
+ logger.info("EXECUTING TransitionEffect ");
38
+ const componentRoot =_transition_.component.componentRoot as IQCObjectsElement | IQCObjectsShadowedElement | HTMLElement | ShadowRoot;
39
+
40
+ if (typeof componentRoot !== "undefined" && componentRoot !== null){
41
+ if (_transition_.fitToHeight) {
42
+ (componentRoot as any).height = (typeof (componentRoot as HTMLElement).offsetParent === "object" && (componentRoot as HTMLElement).offsetParent !== null) ? ((componentRoot as HTMLElement).offsetParent?.scrollHeight) : ((componentRoot as HTMLElement).getBoundingClientRect().height);
43
+ }
44
+ if (_transition_.fitToWidth) {
45
+ (componentRoot as any).width = (typeof (componentRoot as HTMLElement).offsetParent === "object" && (componentRoot as HTMLElement).offsetParent !== null) ? ((componentRoot as HTMLElement).offsetParent?.scrollWidth) : ((componentRoot as HTMLElement).getBoundingClientRect().width);
46
+ }
47
+ if (_transition_.component.shadowed){
48
+ ((componentRoot as ShadowRoot).host as HTMLElement).style.display = "block";
49
+ } else {
50
+ (componentRoot as HTMLElement).style.display = "block";
51
+ }
52
+ _transition_.effects.map( (effectClassName:string):string => {
53
+
54
+ const __effectClass__ = ClassFactory(effectClassName) as unknown as typeof Effect;
55
+ const effectObj = new __effectClass__({});
56
+ const effectClassMethod = effectObj.apply.bind(_transition_);
57
+ const componentHost = (_transition_.component.shadowed)? ((componentRoot as ShadowRoot).host) : (componentRoot);
58
+ const effectParams = {
59
+ alphaFrom,
60
+ alphaTo,
61
+ angleFrom,
62
+ angleTo,
63
+ radiusFrom,
64
+ radiusTo,
65
+ scaleFrom,
66
+ scaleTo
67
+ };
68
+ effectClassMethod(componentHost,...Object.values(effectParams));
69
+ return effectClassName;
70
+ });
71
+
72
+ }
73
+
74
+ }
75
+
76
+ }
77
+
78
+ Package("com.qcobjects.effects.transitions.base", [
79
+ TransitionEffect
80
+ ]);
package/src/VO.ts ADDED
@@ -0,0 +1,8 @@
1
+ import { InheritClass } from "./InheritClass";
2
+ import { Package } from "./Package";
3
+
4
+ export class VO extends InheritClass {}
5
+
6
+ Package("com.qcobjects.valueObjects", [
7
+ VO
8
+ ]);
package/src/View.ts ADDED
@@ -0,0 +1,17 @@
1
+ import { __getType__ } from "./getType";
2
+ import { InheritClass } from "./InheritClass";
3
+ import { Package } from "./Package";
4
+
5
+ export class View extends InheritClass {
6
+ constructor({ component = undefined, dependencies = [] }) {
7
+ super({component, dependencies});
8
+ if (typeof this.component === "undefined" || this.component === "null") {
9
+ throw Error(`${__getType__(this)} must be called with a component`);
10
+ }
11
+
12
+ }
13
+ }
14
+
15
+ Package("com.qcobjects.views", [
16
+ View
17
+ ]);