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/build/Ready.js ADDED
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports._Ready = exports.ready = exports.Ready = void 0;
4
+ const CONFIG_1 = require("./CONFIG");
5
+ const platform_1 = require("./platform");
6
+ const PrimaryCollections_1 = require("./PrimaryCollections");
7
+ const top_1 = require("./top");
8
+ /**
9
+ * Defines a Custom Ready listener
10
+ */
11
+ const Ready = function Ready(e) {
12
+ if (platform_1.isBrowser) {
13
+ PrimaryCollections_1._QC_READY_LISTENERS.push(e.bind(window));
14
+ }
15
+ else if (typeof global !== "undefined") {
16
+ PrimaryCollections_1._QC_READY_LISTENERS.push(e.bind(global));
17
+ }
18
+ };
19
+ exports.Ready = Ready;
20
+ exports.ready = exports.Ready; // case insensitive ready option
21
+ /**
22
+ * Default Ready event function for window. Executes all micro ready events of Import calls
23
+ *
24
+ * @param {Object} e
25
+ */
26
+ // eslint-disable-next-line no-unused-vars
27
+ const _Ready = function (e) {
28
+ const _execReady = function () {
29
+ // eslint-disable-next-line array-callback-return
30
+ PrimaryCollections_1._QC_READY_LISTENERS.map(function (_ready_listener_, _r) {
31
+ if (typeof _ready_listener_ === "function") {
32
+ _ready_listener_();
33
+ PrimaryCollections_1._QC_READY_LISTENERS.splice(_r, 1);
34
+ }
35
+ });
36
+ };
37
+ if (CONFIG_1.CONFIG.get("delayForReady") > 0) {
38
+ if (platform_1.isBrowser) {
39
+ setTimeout(_execReady.bind(window), CONFIG_1.CONFIG.get("delayForReady"));
40
+ }
41
+ else if (typeof global !== "undefined") {
42
+ setTimeout(_execReady.bind(global), CONFIG_1.CONFIG.get("delayForReady"));
43
+ }
44
+ }
45
+ else {
46
+ _execReady.call(top_1._top);
47
+ }
48
+ };
49
+ exports._Ready = _Ready;
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RegisterClass = exports.__register_class__ = void 0;
4
+ const getType_1 = require("./getType");
5
+ const make_global_1 = require("./make_global");
6
+ const PrimaryCollections_1 = require("./PrimaryCollections");
7
+ const __register_class__ = function (_class_, __namespace) {
8
+ let name = _class_.name || (0, getType_1.__getType__)(_class_);
9
+ if (name.toLowerCase() === "function" && typeof _class_.__classType !== "undefined") {
10
+ name = _class_.__classType;
11
+ }
12
+ if (typeof _class_.__definition === "undefined") {
13
+ _class_.__definition = {};
14
+ }
15
+ _class_.__definition.__classType = name;
16
+ if (typeof __namespace !== "undefined") {
17
+ _class_.__definition.__namespace = __namespace;
18
+ }
19
+ PrimaryCollections_1._QC_CLASSES[name] = _class_;
20
+ (0, make_global_1.__make_global__)(PrimaryCollections_1._QC_CLASSES[name]);
21
+ return PrimaryCollections_1._QC_CLASSES[name];
22
+ };
23
+ exports.__register_class__ = __register_class__;
24
+ const RegisterClass = function (_class_, __namespace) {
25
+ return (0, exports.__register_class__)(_class_, __namespace);
26
+ };
27
+ exports.RegisterClass = RegisterClass;
28
+ (0, make_global_1.__make_global__)(exports.RegisterClass);
@@ -0,0 +1,112 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ConfigService = exports.JSONService = exports.Service = void 0;
4
+ const basePath_1 = require("./basePath");
5
+ const Crypt_1 = require("./Crypt");
6
+ const domain_1 = require("./domain");
7
+ const InheritClass_1 = require("./InheritClass");
8
+ const Logger_1 = require("./Logger");
9
+ const Package_1 = require("./Package");
10
+ const secretKey_1 = require("./secretKey");
11
+ const CONFIG_1 = require("./CONFIG");
12
+ class Service extends InheritClass_1.InheritClass {
13
+ options;
14
+ withCredentials;
15
+ useHTTP2;
16
+ // eslint-disable-next-line no-unused-vars
17
+ mockup({ request, service }) {
18
+ throw new Error("Method not implemented.");
19
+ }
20
+ name;
21
+ responseHeaders;
22
+ // eslint-disable-next-line no-unused-vars
23
+ local({ request, service }) {
24
+ throw new Error("Method not implemented.");
25
+ }
26
+ kind = "rest";
27
+ /* it can be rest, mockup, local */
28
+ domain = domain_1._domain_;
29
+ basePath = basePath_1._basePath_;
30
+ url = "";
31
+ method = "GET";
32
+ data = {};
33
+ reload = false;
34
+ cached = false;
35
+ headers;
36
+ template;
37
+ // eslint-disable-next-line no-unused-vars
38
+ done({ request, service }) {
39
+ throw new Error("Method not implemented.");
40
+ }
41
+ // eslint-disable-next-line no-unused-vars
42
+ fail(...args) {
43
+ throw new Error("Method not implemented.");
44
+ }
45
+ set(name, value) {
46
+ this[name] = value;
47
+ }
48
+ get(name, _default) {
49
+ return this[name] || _default;
50
+ }
51
+ }
52
+ exports.Service = Service;
53
+ class JSONService extends Service {
54
+ method = "GET";
55
+ cached = false;
56
+ headers = {
57
+ "Content-Type": "application/json",
58
+ "charset": "utf-8"
59
+ };
60
+ JSONresponse = undefined;
61
+ done(result) {
62
+ Logger_1.logger.debug("***** RECEIVED RESPONSE:");
63
+ Logger_1.logger.debug(result.service.template);
64
+ this.JSONresponse = JSON.parse(result.service.template);
65
+ }
66
+ }
67
+ exports.JSONService = JSONService;
68
+ class ConfigService extends JSONService {
69
+ method = "GET";
70
+ cached = false;
71
+ configFileName = "config.json";
72
+ headers = {
73
+ "Content-Type": "application/json",
74
+ "charset": "utf-8"
75
+ };
76
+ configLoaded() {
77
+ throw Error("Method not implemented.");
78
+ }
79
+ JSONresponse = undefined;
80
+ done(result) {
81
+ Logger_1.logger.debug("***** CONFIG LOADED:");
82
+ Logger_1.logger.debug(result.service.template);
83
+ this.JSONresponse = JSON.parse(result.service.template);
84
+ if (Object.hasOwn(this.JSONresponse, "__encoded__")) {
85
+ const decodedValue = Crypt_1._Crypt.decrypt(this.JSONresponse?.__encoded__, secretKey_1._secretKey);
86
+ this.JSONresponse = JSON.parse(decodedValue);
87
+ }
88
+ const jsonResponse = this.JSONresponse;
89
+ Object.keys(jsonResponse).map((k) => {
90
+ CONFIG_1.CONFIG.set(k, jsonResponse[k]);
91
+ return k;
92
+ });
93
+ this.configLoaded().catch((e) => { throw new Error(`An error ocurred: ${e}`); });
94
+ }
95
+ fail() {
96
+ this.configLoaded().catch((e) => { throw new Error(`An error ocurred: ${e}`); });
97
+ }
98
+ constructor() {
99
+ super();
100
+ this.set("url", `${this.get("basePath")}${this.get("configFileName")}`);
101
+ }
102
+ }
103
+ exports.ConfigService = ConfigService;
104
+ (0, Package_1.Package)("com.qcobjects.api", [
105
+ Service
106
+ ]);
107
+ (0, Package_1.Package)("com.qcobjects.api.services", [
108
+ JSONService
109
+ ]);
110
+ (0, Package_1.Package)("com.qcobjects.api.config", [
111
+ ConfigService
112
+ ]);
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SourceCSS = void 0;
4
+ const basePath_1 = require("./basePath");
5
+ const Cast_1 = require("./Cast");
6
+ const domain_1 = require("./domain");
7
+ const DOMCreateElement_1 = require("./DOMCreateElement");
8
+ const InheritClass_1 = require("./InheritClass");
9
+ const platform_1 = require("./platform");
10
+ const Package_1 = require("./Package");
11
+ class SourceCSS extends InheritClass_1.InheritClass {
12
+ domain = domain_1._domain_;
13
+ basePath = basePath_1._basePath_;
14
+ url = "";
15
+ data = {};
16
+ async = false;
17
+ external = false;
18
+ constructor(o) {
19
+ super(o);
20
+ this.body = (0, DOMCreateElement_1._DOMCreateElement)("link");
21
+ }
22
+ fail() {
23
+ throw new Error("Method not implemented.");
24
+ }
25
+ Cast(o) {
26
+ return (0, Cast_1._Cast)(this, o);
27
+ }
28
+ set(name, value) {
29
+ this[name] = value;
30
+ }
31
+ get(name, _default) {
32
+ return this[name] || _default;
33
+ }
34
+ done() { }
35
+ rebuild() {
36
+ const context = this;
37
+ if (platform_1.isBrowser) {
38
+ window.document.getElementsByTagName("head")[0].appendChild((function (s, url, context) {
39
+ s.type = "text/css";
40
+ s.rel = "stylesheet";
41
+ s.href = url;
42
+ s.crossOrigin = "anonymous";
43
+ s.onreadystatechange = function () {
44
+ if (this.readyState === "complete") {
45
+ context.done.call(context);
46
+ }
47
+ };
48
+ s.onload = context.done;
49
+ context.body = s;
50
+ return s;
51
+ }).call(this, (0, DOMCreateElement_1._DOMCreateElement)("link"), (this.external) ? (this.url) : (this.basePath + this.url), context));
52
+ }
53
+ }
54
+ }
55
+ exports.SourceCSS = SourceCSS;
56
+ (0, Package_1.Package)("com.qcobjects", [SourceCSS]);
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SourceJS = void 0;
4
+ const basePath_1 = require("./basePath");
5
+ const Cast_1 = require("./Cast");
6
+ const domain_1 = require("./domain");
7
+ const DOMCreateElement_1 = require("./DOMCreateElement");
8
+ const InheritClass_1 = require("./InheritClass");
9
+ const Package_1 = require("./Package");
10
+ const Logger_1 = require("./Logger");
11
+ class SourceJS extends InheritClass_1.InheritClass {
12
+ domain = domain_1._domain_;
13
+ basePath = basePath_1._basePath_;
14
+ type = "text/javascript";
15
+ containerTag = "body";
16
+ url = "";
17
+ data = {};
18
+ async = false;
19
+ external = false;
20
+ constructor(o) {
21
+ super(o);
22
+ this.body = (0, DOMCreateElement_1._DOMCreateElement)("script");
23
+ }
24
+ set(name, value) {
25
+ this[name] = value;
26
+ }
27
+ get(name, _default) {
28
+ return this[name] || _default;
29
+ }
30
+ status = false;
31
+ done() { }
32
+ fail() { }
33
+ rebuild() {
34
+ const context = this;
35
+ try {
36
+ document.getElementsByTagName(context.containerTag)[0].appendChild((function (s, url, context) {
37
+ s.type = context.type;
38
+ s.src = url;
39
+ s.crossOrigin = (Object.hasOwn(context, "crossOrigin")) ? (context.crossOrigin) : ("anonymous");
40
+ s.async = context.async;
41
+ s.onreadystatechange = function () {
42
+ if (this.readyState === "complete") {
43
+ context.done.call(context);
44
+ }
45
+ };
46
+ s.onload = function (e) {
47
+ context.status = true;
48
+ context.done.call(context, e);
49
+ };
50
+ s.onerror = function (e) {
51
+ context.status = false;
52
+ context.fail.call(context, e);
53
+ };
54
+ context.body = s;
55
+ return s;
56
+ }).call(this, (0, DOMCreateElement_1._DOMCreateElement)("script"), (this.external) ? (this.url) : (this.basePath + this.url), context));
57
+ }
58
+ catch (e) {
59
+ context.status = false;
60
+ Logger_1.logger.debug(`An error ocurred: ${e}`);
61
+ context.fail();
62
+ }
63
+ }
64
+ Cast(o) {
65
+ return (0, Cast_1._Cast)(this, o);
66
+ }
67
+ _new_(properties) {
68
+ this.__new__(properties);
69
+ this.rebuild();
70
+ }
71
+ }
72
+ exports.SourceJS = SourceJS;
73
+ (0, Package_1.Package)("com.qcobjects", [SourceJS]);
package/build/Tag.js ADDED
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Tag = exports.TagElements = void 0;
4
+ const ClassFactory_1 = require("./ClassFactory");
5
+ const New_1 = require("./New");
6
+ const Package_1 = require("./Package");
7
+ const platform_1 = require("./platform");
8
+ const ArrayCollection_1 = require("./ArrayCollection");
9
+ class TagElements extends ArrayCollection_1.ArrayList {
10
+ show() {
11
+ this.map(function (element) {
12
+ return element.style.opacity = 1;
13
+ });
14
+ }
15
+ hide() {
16
+ this.map(function (element) {
17
+ return element.style.opacity = 0;
18
+ });
19
+ }
20
+ effect(...args) {
21
+ const effectArguments = [...args].slice(1);
22
+ const effectClassName = args[0];
23
+ let effectClass = undefined;
24
+ if ((typeof effectClassName).toLowerCase() === "string") {
25
+ effectClass = (0, ClassFactory_1.ClassFactory)(effectClassName);
26
+ }
27
+ this.map(function (element) {
28
+ return effectClass.apply.apply(effectClass, [element].concat(effectArguments));
29
+ });
30
+ }
31
+ findElements(elementName) {
32
+ const _o = (0, New_1.New)((0, ClassFactory_1.ClassFactory)("TagElements"));
33
+ if (platform_1.isBrowser) {
34
+ for (const _k in this) {
35
+ if (typeof _k === "number" && typeof this[_k] !== "function" && Object.hasOwn(this[_k], "subelements")) {
36
+ _o.push(this[_k].subelements(elementName));
37
+ }
38
+ }
39
+ }
40
+ else {
41
+ // not yet implemented.
42
+ }
43
+ return _o;
44
+ }
45
+ }
46
+ exports.TagElements = TagElements;
47
+ /**
48
+ * Gets the element of DOM found by tag name
49
+ *
50
+ * @param {Object} tagname
51
+ * @param {Object} innerHTML
52
+ */
53
+ const Tag = function (tagname, innerHTML) {
54
+ const _o = (0, New_1.New)(TagElements);
55
+ if (platform_1.isBrowser) {
56
+ const o = document.subelements(tagname);
57
+ const addedKeys = [];
58
+ for (let _i = 0; _i < o.length; _i++) {
59
+ if (typeof innerHTML !== "undefined" && Object.hasOwn(o[_i], "innerHTML")) {
60
+ o[_i].innerHTML = innerHTML;
61
+ }
62
+ if (addedKeys.indexOf(_i) < 0) {
63
+ _o.push(o[_i]);
64
+ addedKeys.push(_i);
65
+ }
66
+ }
67
+ }
68
+ else {
69
+ // not yet implemented.
70
+ }
71
+ return _o;
72
+ };
73
+ exports.Tag = Tag;
74
+ (0, Package_1.Package)("com.qcobjects", [
75
+ TagElements,
76
+ exports.Tag
77
+ ]);
package/build/Timer.js ADDED
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Timer = void 0;
4
+ const InheritClass_1 = require("./InheritClass");
5
+ const Package_1 = require("./Package");
6
+ class Timer extends InheritClass_1.InheritClass {
7
+ duration = 1000;
8
+ alive = true;
9
+ thread({ timing, intervalInterceptor, duration }) {
10
+ const timer = this;
11
+ const start = performance.now();
12
+ requestAnimationFrame(function thread(time) {
13
+ // timeFraction goes from 0 to 1
14
+ const elapsed = (time - start);
15
+ let timeFraction = elapsed / duration;
16
+ if (timeFraction > 1)
17
+ timeFraction = 1;
18
+ // calculate the current progress state
19
+ const progress = timing(timeFraction, elapsed);
20
+ intervalInterceptor(Math.round(progress * 100)); // draw it
21
+ if ((timeFraction < 1 || duration === -1) && timer.alive) {
22
+ requestAnimationFrame(thread);
23
+ }
24
+ });
25
+ }
26
+ }
27
+ exports.Timer = Timer;
28
+ (0, Package_1.Package)("com.qcobjects.timing", [
29
+ Timer
30
+ ]);
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Toggle = void 0;
4
+ const InheritClass_1 = require("./InheritClass");
5
+ const Logger_1 = require("./Logger");
6
+ const Package_1 = require("./Package");
7
+ class Toggle extends InheritClass_1.InheritClass {
8
+ _toggle = false;
9
+ _inverse = true;
10
+ _positive = null;
11
+ _negative = null;
12
+ _dispatched = null;
13
+ _args = {};
14
+ constructor(positive, negative, args) {
15
+ super({ positive, negative, args });
16
+ this._new_({ positive, negative, args });
17
+ }
18
+ changeToggle() {
19
+ this._toggle = !(this._toggle);
20
+ }
21
+ _new_({ positive, negative, args }) {
22
+ this._positive = positive;
23
+ this._negative = negative;
24
+ this._args = args;
25
+ }
26
+ fire() {
27
+ const toggle = this;
28
+ var _promise = new Promise(function (resolve, reject) {
29
+ if (typeof toggle._positive === "function" && typeof toggle._negative === "function") {
30
+ if (toggle._inverse) {
31
+ toggle._dispatched = (toggle._toggle) ? (toggle._negative.bind(toggle)) : (toggle._positive.bind(toggle));
32
+ }
33
+ else {
34
+ toggle._dispatched = (toggle._toggle) ? (toggle._positive.bind(toggle)) : (toggle._negative.bind(toggle));
35
+ }
36
+ toggle._dispatched?.call(toggle, toggle._args);
37
+ resolve.call(_promise, toggle);
38
+ }
39
+ else {
40
+ Logger_1.logger.debug("Toggle functions are not declared");
41
+ reject.call(_promise, toggle);
42
+ }
43
+ return toggle;
44
+ }).then(function (toggle) {
45
+ toggle.changeToggle();
46
+ return toggle;
47
+ }).catch(function (e) {
48
+ Logger_1.logger.debug(e.toString());
49
+ return toggle;
50
+ }).finally(() => {
51
+ return toggle;
52
+ });
53
+ return _promise;
54
+ }
55
+ }
56
+ exports.Toggle = Toggle;
57
+ (0, Package_1.Package)("com.qcobjects.tools.essentials", [
58
+ Toggle
59
+ ]);
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TransitionEffect = void 0;
4
+ const Effect_1 = require("./Effect");
5
+ const Logger_1 = require("./Logger");
6
+ const Package_1 = require("./Package");
7
+ const ClassFactory_1 = require("./ClassFactory");
8
+ class TransitionEffect extends Effect_1.Effect {
9
+ duration = 385;
10
+ defaultParams = {
11
+ alphaFrom: 0,
12
+ alphaTo: 1,
13
+ angleFrom: 180,
14
+ angleTo: 0,
15
+ radiusFrom: 0,
16
+ radiusTo: 30,
17
+ scaleFrom: 0,
18
+ scaleTo: 1
19
+ };
20
+ fitToHeight = false;
21
+ fitToWidth = false;
22
+ component;
23
+ effects;
24
+ apply({ alphaFrom, alphaTo, angleFrom, angleTo, radiusFrom, radiusTo, scaleFrom, scaleTo }) {
25
+ const _transition_ = this;
26
+ Logger_1.logger.info("EXECUTING TransitionEffect ");
27
+ const componentRoot = _transition_.component.componentRoot;
28
+ if (typeof componentRoot !== "undefined" && componentRoot !== null) {
29
+ if (_transition_.fitToHeight) {
30
+ componentRoot.height = (typeof componentRoot.offsetParent === "object" && componentRoot.offsetParent !== null) ? (componentRoot.offsetParent?.scrollHeight) : (componentRoot.getBoundingClientRect().height);
31
+ }
32
+ if (_transition_.fitToWidth) {
33
+ componentRoot.width = (typeof componentRoot.offsetParent === "object" && componentRoot.offsetParent !== null) ? (componentRoot.offsetParent?.scrollWidth) : (componentRoot.getBoundingClientRect().width);
34
+ }
35
+ if (_transition_.component.shadowed) {
36
+ componentRoot.host.style.display = "block";
37
+ }
38
+ else {
39
+ componentRoot.style.display = "block";
40
+ }
41
+ _transition_.effects.map((effectClassName) => {
42
+ const __effectClass__ = (0, ClassFactory_1.ClassFactory)(effectClassName);
43
+ const effectObj = new __effectClass__({});
44
+ const effectClassMethod = effectObj.apply.bind(_transition_);
45
+ const componentHost = (_transition_.component.shadowed) ? (componentRoot.host) : (componentRoot);
46
+ const effectParams = {
47
+ alphaFrom,
48
+ alphaTo,
49
+ angleFrom,
50
+ angleTo,
51
+ radiusFrom,
52
+ radiusTo,
53
+ scaleFrom,
54
+ scaleTo
55
+ };
56
+ effectClassMethod(componentHost, ...Object.values(effectParams));
57
+ return effectClassName;
58
+ });
59
+ }
60
+ }
61
+ }
62
+ exports.TransitionEffect = TransitionEffect;
63
+ (0, Package_1.Package)("com.qcobjects.effects.transitions.base", [
64
+ TransitionEffect
65
+ ]);
package/build/VO.js ADDED
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.VO = void 0;
4
+ const InheritClass_1 = require("./InheritClass");
5
+ const Package_1 = require("./Package");
6
+ class VO extends InheritClass_1.InheritClass {
7
+ }
8
+ exports.VO = VO;
9
+ (0, Package_1.Package)("com.qcobjects.valueObjects", [
10
+ VO
11
+ ]);
package/build/View.js ADDED
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.View = void 0;
4
+ const getType_1 = require("./getType");
5
+ const InheritClass_1 = require("./InheritClass");
6
+ const Package_1 = require("./Package");
7
+ class View extends InheritClass_1.InheritClass {
8
+ constructor({ component = undefined, dependencies = [] }) {
9
+ super({ component, dependencies });
10
+ if (typeof this.component === "undefined" || this.component === "null") {
11
+ throw Error(`${(0, getType_1.__getType__)(this)} must be called with a component`);
12
+ }
13
+ }
14
+ }
15
+ exports.View = View;
16
+ (0, Package_1.Package)("com.qcobjects.views", [
17
+ View
18
+ ]);