qcobjects-sdk 2.4.66 → 2.5.105-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.
Files changed (147) hide show
  1. package/.github/workflows/npmpublish-beta.yml +4 -2
  2. package/.github/workflows/npmpublish-lts.yml +4 -2
  3. package/.github/workflows/npmpublish-main.yml +2 -2
  4. package/README.md +0 -1
  5. package/VERSION +1 -1
  6. package/build/QCObjects-SDK.js +83 -41
  7. package/build/index.js +17 -7
  8. package/build/js/org.qcobjects.base.components.js +75 -0
  9. package/build/js/org.qcobjects.cloud.auth.session.data.js +98 -101
  10. package/build/js/org.qcobjects.cloud.auth.session.usertoken.js +68 -80
  11. package/build/js/org.qcobjects.components.grid.js +35 -53
  12. package/build/js/org.qcobjects.components.js +145 -237
  13. package/build/js/org.qcobjects.components.list.js +36 -45
  14. package/build/js/org.qcobjects.components.notifications.js +107 -106
  15. package/build/js/org.qcobjects.components.slider.js +183 -169
  16. package/build/js/org.qcobjects.components.splashscreen.js +123 -130
  17. package/build/js/org.qcobjects.controllers.form.js +149 -147
  18. package/build/js/org.qcobjects.controllers.grid.js +226 -215
  19. package/build/js/org.qcobjects.controllers.js +11 -11
  20. package/build/js/org.qcobjects.controllers.list.js +195 -188
  21. package/build/js/org.qcobjects.controllers.slider.js +101 -106
  22. package/build/js/org.qcobjects.controllers.swagger.js +71 -46
  23. package/build/js/org.qcobjects.effects.base.js +86 -0
  24. package/build/js/org.qcobjects.effects.extended.js +318 -0
  25. package/build/js/org.qcobjects.effects.js +26 -394
  26. package/build/js/org.qcobjects.i18n_messages.js +33 -46
  27. package/build/js/org.qcobjects.modal.controllers.js +16 -15
  28. package/build/js/org.qcobjects.modal.effects.js +23 -28
  29. package/build/js/org.qcobjects.models.js +11 -11
  30. package/build/js/org.qcobjects.tools.canvas.js +28 -27
  31. package/build/js/org.qcobjects.tools.js +10 -3
  32. package/build/js/org.qcobjects.tools.layouts.js +46 -45
  33. package/build/js/org.qcobjects.views.js +11 -11
  34. package/build-esbuild.js +72 -0
  35. package/eslint.config.mjs +88 -0
  36. package/package.json +67 -63
  37. package/postbuild.js +10 -0
  38. package/public/browser/index.js +9902 -0
  39. package/public/browser/index.js.map +7 -0
  40. package/public/cjs/index.cjs +9894 -0
  41. package/public/cjs/index.cjs.map +7 -0
  42. package/public/esm/index.mjs +9894 -0
  43. package/public/esm/index.mjs.map +7 -0
  44. package/public/types/index.d.ts +698 -0
  45. package/spec/helpers/mock-sdk.helper.ts +2 -0
  46. package/spec/mocks/qcobjects-sdk.mock.ts +1 -0
  47. package/spec/support/jasmine.json +7 -4
  48. package/src/QCObjects-SDK.ts +72 -53
  49. package/src/js/org.qcobjects.base.components.ts +83 -0
  50. package/src/js/org.qcobjects.cloud.auth.session.data.ts +98 -99
  51. package/src/js/org.qcobjects.cloud.auth.session.usertoken.ts +72 -92
  52. package/src/js/org.qcobjects.components.grid.ts +31 -58
  53. package/src/js/org.qcobjects.components.list.ts +15 -31
  54. package/src/js/org.qcobjects.components.notifications.ts +12 -12
  55. package/src/js/org.qcobjects.components.slider.ts +182 -171
  56. package/src/js/org.qcobjects.components.splashscreen.ts +31 -39
  57. package/src/js/org.qcobjects.components.ts +151 -261
  58. package/src/js/org.qcobjects.controllers.form.ts +151 -148
  59. package/src/js/org.qcobjects.controllers.grid.ts +226 -222
  60. package/src/js/org.qcobjects.controllers.list.ts +207 -205
  61. package/src/js/org.qcobjects.controllers.slider.ts +120 -125
  62. package/src/js/org.qcobjects.controllers.swagger.ts +51 -51
  63. package/src/js/org.qcobjects.controllers.ts +7 -9
  64. package/src/js/org.qcobjects.effects.base.ts +97 -0
  65. package/src/js/org.qcobjects.effects.extended.ts +350 -0
  66. package/src/js/org.qcobjects.effects.ts +6 -394
  67. package/src/js/org.qcobjects.i18n_messages.ts +37 -51
  68. package/src/js/org.qcobjects.modal.controllers.ts +12 -14
  69. package/src/js/org.qcobjects.modal.effects.ts +22 -18
  70. package/src/js/org.qcobjects.models.ts +8 -11
  71. package/src/js/org.qcobjects.tools.canvas.ts +26 -28
  72. package/src/js/org.qcobjects.tools.layouts.ts +44 -47
  73. package/src/js/org.qcobjects.tools.ts +7 -1
  74. package/src/js/org.qcobjects.views.ts +9 -8
  75. package/src/types/global/index.d.ts +181 -0
  76. package/transpile.js +65 -0
  77. package/tsconfig.d.json +65 -3
  78. package/tsconfig.jasmine.json +64 -0
  79. package/tsconfig.json +71 -7
  80. package/.eslintignore +0 -4
  81. package/.eslintrc.cjs +0 -6
  82. package/.gitmodules +0 -4
  83. package/build/css/base-modal.css +0 -43
  84. package/build/css/basic-layout-embedded-nav.css +0 -14
  85. package/build/css/basic-layout.css +0 -76
  86. package/build/css/components/horizontal-list.css +0 -64
  87. package/build/css/components/list.css +0 -57
  88. package/build/css/components/splashscreen.css +0 -111
  89. package/build/css/modal.css +0 -46
  90. package/build/index.cjs +0 -4
  91. package/build/index.mjs +0 -2
  92. package/build/templates/components/modalyoulose.tpl.html +0 -3
  93. package/build/templates/components/modalyouwin.tpl.html +0 -4
  94. package/build/templates/components/splashscreen.tpl.html +0 -128
  95. package/build/templates/components/swagger-ui.tpl.html +0 -22
  96. package/docs/CNAME +0 -1
  97. package/public/QCObjects-SDK.js +0 -696
  98. package/public/QCObjects-SDK.js.map +0 -7
  99. package/public/css/base-modal.css +0 -2
  100. package/public/css/base-modal.css.map +0 -7
  101. package/public/css/basic-layout-embedded-nav.css +0 -2
  102. package/public/css/basic-layout-embedded-nav.css.map +0 -7
  103. package/public/css/basic-layout.css +0 -2
  104. package/public/css/basic-layout.css.map +0 -7
  105. package/public/css/components/horizontal-list.css +0 -2
  106. package/public/css/components/horizontal-list.css.map +0 -7
  107. package/public/css/components/list.css +0 -2
  108. package/public/css/components/list.css.map +0 -7
  109. package/public/css/components/splashscreen.css +0 -2
  110. package/public/css/components/splashscreen.css.map +0 -7
  111. package/public/css/modal.css +0 -2
  112. package/public/css/modal.css.map +0 -7
  113. package/public/index.cjs +0 -4
  114. package/public/index.js +0 -27
  115. package/public/index.mjs +0 -2
  116. package/public/templates/components/modalyoulose.tpl.html +0 -3
  117. package/public/templates/components/modalyouwin.tpl.html +0 -4
  118. package/public/templates/components/splashscreen.tpl.html +0 -128
  119. package/public/templates/components/swagger-ui.tpl.html +0 -22
  120. package/src/QCObjects-SDK.d.ts +0 -26
  121. package/src/index.cts +0 -2
  122. package/src/index.d.ts +0 -2
  123. package/src/index.mts +0 -2
  124. package/src/js/org.qcobjects.cloud.auth.session.data.d.ts +0 -1
  125. package/src/js/org.qcobjects.cloud.auth.session.usertoken.d.ts +0 -2
  126. package/src/js/org.qcobjects.components.d.ts +0 -10
  127. package/src/js/org.qcobjects.components.grid.d.ts +0 -3
  128. package/src/js/org.qcobjects.components.list.d.ts +0 -3
  129. package/src/js/org.qcobjects.components.notifications.d.ts +0 -1
  130. package/src/js/org.qcobjects.components.slider.d.ts +0 -1
  131. package/src/js/org.qcobjects.components.splashscreen.d.ts +0 -28
  132. package/src/js/org.qcobjects.controllers.d.ts +0 -1
  133. package/src/js/org.qcobjects.controllers.form.d.ts +0 -1
  134. package/src/js/org.qcobjects.controllers.grid.d.ts +0 -1
  135. package/src/js/org.qcobjects.controllers.list.d.ts +0 -1
  136. package/src/js/org.qcobjects.controllers.slider.d.ts +0 -1
  137. package/src/js/org.qcobjects.controllers.swagger.d.ts +0 -1
  138. package/src/js/org.qcobjects.effects.d.ts +0 -20
  139. package/src/js/org.qcobjects.i18n_messages.d.ts +0 -1
  140. package/src/js/org.qcobjects.modal.controllers.d.ts +0 -1
  141. package/src/js/org.qcobjects.modal.effects.d.ts +0 -1
  142. package/src/js/org.qcobjects.models.d.ts +0 -1
  143. package/src/js/org.qcobjects.tools.canvas.d.ts +0 -1
  144. package/src/js/org.qcobjects.tools.d.ts +0 -1
  145. package/src/js/org.qcobjects.tools.layouts.d.ts +0 -1
  146. package/src/js/org.qcobjects.views.d.ts +0 -1
  147. /package/spec/{testsSpec.js → testsSpec.ts} +0 -0
@@ -1,5 +1,5 @@
1
1
  /**
2
- * QCObjects SDK 2.4.0
2
+ * QCObjects SDK 2.5.0
3
3
  * ________________
4
4
  *
5
5
  * Author: Jean Machuca <correojean@gmail.com>
@@ -23,39 +23,35 @@
23
23
  * license document, but changing it is not allowed.
24
24
  */
25
25
 
26
- import { Package, Component, CONFIG, logger, ComponentParams, QCObjectsElement } from "qcobjects";
26
+ "use strict";
27
+ import { Package, Component, CONFIG, logger, global } from "qcobjects";
27
28
  import { Resize, Fade } from "./org.qcobjects.effects";
28
29
 
29
- const _top: any = (typeof module === "object" && typeof module.exports === "object") ? (
30
- module.exports = (typeof globalThis !== "undefined"
31
- ? globalThis
32
- : typeof self !== "undefined"
33
- ? self
34
- : typeof window !== "undefined"
35
- ? window
36
- : typeof global !== "undefined"
37
- ? global
38
- : {})
39
- ) : ((typeof global === "object") ? (global) : (
40
- (typeof window === "object") ? (window) : ({})
41
- ));
42
-
43
- // eslint-disable-next-line camelcase
44
- (function __splash_screen__(global) {
45
- "use strict";
46
- type SplashScreenParams = ComponentParams & {
30
+ type SplashScreenParams = {
31
+ name:string;
47
32
  basePath: string;
48
- }
49
- type MainSplashComponent = Component & {
33
+ data:any;
34
+ body:any;
35
+ }
36
+ type MainSplashComponent = {
37
+ body: any;
38
+ splashScreenComponent: any;
39
+ shadowed: any;
40
+ shadowRoot: any;
41
+ // eslint-disable-next-line no-unused-vars
42
+ addComponentHelper(arg0: () => void): unknown;
43
+ name:string;
50
44
  _mainPosition: string;
51
45
  _mainOpacity: string;
52
46
  }
53
47
 
54
- class SplashScreenComponent extends Component {
48
+ export class SplashScreenComponent extends Component {
55
49
  _enabled_: boolean;
56
50
  _bgcolor: string;
57
51
  cached = false;
58
52
  shadowed = true;
53
+ body: any;
54
+ shadowRoot: any;
59
55
 
60
56
  constructor(component: SplashScreenParams) {
61
57
  component.name = (typeof component.name === "undefined") ? ("splashscreen") : (component.name);
@@ -98,6 +94,7 @@ const _top: any = (typeof module === "object" && typeof module.exports === "obje
98
94
  if (!_helper_.executed) {
99
95
  const _componentRoot = (this.shadowed) ? (this.shadowRoot?.host as HTMLElement) : (this.body as HTMLElement);
100
96
  if (typeof global.componentsStack !== "undefined") {
97
+
101
98
  global.componentsStack.filter((c: MainSplashComponent) => c.body.hasAttribute("splashscreen")).map(
102
99
  (mainComponent: MainSplashComponent) => {
103
100
  logger.debug(`Splash Screen of Main Component: ${mainComponent.name}`);
@@ -106,11 +103,11 @@ const _top: any = (typeof module === "object" && typeof module.exports === "obje
106
103
  if (!(SplashScreenHandler as any).executed) {
107
104
  const component = mainComponent.splashScreenComponent as SplashScreenComponent;
108
105
  const mainElement = (mainComponent.shadowed) ? (mainComponent.shadowRoot?.host as HTMLElement) : (mainComponent.body as HTMLElement);
109
- mainComponent._mainPosition = (mainElement as HTMLElement).style.position;
106
+ mainComponent._mainPosition = mainElement.style.position;
110
107
  if (typeof mainElement !== "undefined") {
111
108
  mainElement.style.position = "fixed";
112
109
  }
113
- mainComponent._mainOpacity = (mainElement as HTMLElement).style.opacity;
110
+ mainComponent._mainOpacity = mainElement.style.opacity;
114
111
  _componentRoot.style.width = "100%";
115
112
  _componentRoot.style.height = "100%";
116
113
  document.body.style.backgroundColor = "#111111";
@@ -118,9 +115,10 @@ const _top: any = (typeof module === "object" && typeof module.exports === "obje
118
115
  setTimeout(function () {
119
116
  if (typeof _componentRoot !== "undefined") {
120
117
  document.body.style.backgroundColor = component?._bgcolor;
121
- (_componentRoot as QCObjectsElement).subelements("#slot-logo").map((slotlogo) => {
118
+ (_componentRoot as any).subelements("#slot-logo").map((slotlogo:any) => {
122
119
  slotlogo.style.display = "block";
123
120
  slotlogo.style.transformOrigin = "center";
121
+
124
122
  return (new Resize()).apply(slotlogo, 1, 0);
125
123
  });
126
124
  (new Fade()).apply(_componentRoot, 1, 0);
@@ -151,6 +149,10 @@ const _top: any = (typeof module === "object" && typeof module.exports === "obje
151
149
  }
152
150
 
153
151
  }
152
+ // eslint-disable-next-line no-unused-vars
153
+ addComponentHelper(arg0: { (): void; executed: boolean; }) {
154
+ throw new Error("Method not implemented.");
155
+ }
154
156
 
155
157
 
156
158
  }
@@ -160,7 +162,7 @@ const _top: any = (typeof module === "object" && typeof module.exports === "obje
160
162
  SplashScreenComponent
161
163
  ]);
162
164
 
163
- class VideoSplashScreenComponent extends SplashScreenComponent {
165
+ export class VideoSplashScreenComponent extends SplashScreenComponent {
164
166
  cached = false;
165
167
  shadowed = true;
166
168
  tplsource = "inline";
@@ -336,7 +338,7 @@ const _top: any = (typeof module === "object" && typeof module.exports === "obje
336
338
  }
337
339
  }
338
340
 
339
- class CubeSplashScreenComponent extends SplashScreenComponent {
341
+ export class CubeSplashScreenComponent extends SplashScreenComponent {
340
342
  cached = false;
341
343
  shadowed = true;
342
344
  tplsource = "inline";
@@ -663,18 +665,8 @@ const _top: any = (typeof module === "object" && typeof module.exports === "obje
663
665
 
664
666
 
665
667
  Package("org.qcobjects.components.splashscreen", [
668
+ SplashScreenComponent,
666
669
  VideoSplashScreenComponent,
667
670
  CubeSplashScreenComponent
668
671
  ]);
669
672
 
670
- })(_top);
671
-
672
- const SplashScreenComponent = _top.SplashScreenComponent;
673
- const VideoSplashScreenComponent = _top.VideoSplashScreenComponent;
674
- const CubeSplashScreenComponent = _top.CubeSplashScreenComponent;
675
-
676
- export {
677
- SplashScreenComponent,
678
- VideoSplashScreenComponent,
679
- CubeSplashScreenComponent
680
- };
@@ -1,5 +1,5 @@
1
1
  /**
2
- * QCObjects SDK 2.4
2
+ * QCObjects SDK 2.5
3
3
  * ________________
4
4
  *
5
5
  * Author: Jean Machuca <correojean@gmail.com>
@@ -24,153 +24,64 @@
24
24
  */
25
25
  "use strict";
26
26
 
27
- import { Package, Component, logger, _DOMCreateElement, CONFIG, New, ClassFactory, Tag, ComponentURI, QCObjectsElement, ComponentDoneResponse, ComponentParams } from "qcobjects";
27
+ import { Package, Component, _DOMCreateElement, CONFIG, New, ClassFactory, Tag, ComponentURI } from "qcobjects";
28
28
  import { ModalFade, ModalMoveDown, ModalMoveUp } from "./org.qcobjects.effects";
29
- const _top:any = (typeof module === "object" && typeof module.exports === "object") ? (
30
- module.exports = (typeof globalThis !== "undefined"
31
- ? globalThis
32
- : typeof self !== "undefined"
33
- ? self
34
- : typeof window !== "undefined"
35
- ? window
36
- : typeof global !== "undefined"
37
- ? global
38
- : {})
39
- ) : ((typeof global === "object") ? (global) : (
40
- (typeof window === "object") ? (window) : ({})
41
- ));
42
- (function (global:any) {
43
-
44
- type FieldComponentParams = ComponentParams & {
45
- basePath?:string;
46
- fieldType:string;
29
+ import {FormField, FieldComponentParams} from "./org.qcobjects.base.components";
30
+ export {FormField};
31
+
32
+ export class ShadowedComponent extends Component {
33
+ container = null;
34
+ shadowed = true;
35
+ cached = false;
36
+ controller = null;
37
+ view = null;
38
+ data = {};
39
+
40
+ constructor(o: FieldComponentParams) {
41
+ o.body = _DOMCreateElement("div");
42
+ super(o);
47
43
  }
48
- class FormField extends Component {
49
- fieldType!:string;
50
- cached = false;
51
- reload = true;
52
- constructor (o:FieldComponentParams){
53
- o.name = (typeof o.name !== "undefined")?(o.name):("form-field");
54
- super(o);
55
- }
56
-
57
- createBindingEvents() {
58
- let _objList;
59
- if (typeof this.fieldType === "undefined" || this.fieldType == null) {
60
- _objList = (this.body as QCObjectsElement).subelements("*[data-field]"); // every child with data-field set
61
- } else {
62
- _objList = (this.body as QCObjectsElement).subelements(this.fieldType + "[data-field]"); // every child with data-field set and tagname is equal to fieldType property
63
- }
64
- for (let _datak = 0; _datak < _objList.length; _datak++) {
65
- const _obj = _objList[_datak];
66
- _obj.addEventListener("change", () => {
67
- logger.debug("Executing change event binding");
68
- this.executeBindings();
69
- });
70
- _obj.addEventListener("blur", () => {
71
- logger.debug("Executing change event binding");
72
- this.executeBindings();
73
- });
74
- _obj.addEventListener("focus", () => {
75
- logger.debug("Executing change event binding");
76
- this.executeBindings();
77
- });
78
- _obj.addEventListener("keydown", () =>{
79
- logger.debug("Executing keydown event binding");
80
- this.executeBindings();
81
- });
82
- }
83
- }
84
-
85
- executeBinding(_obj:HTMLElement & {value:any}) {
86
- const _datamodel = _obj.getAttribute("data-field");
87
- logger.debug("Binding " + _datamodel + " for " + this.name);
88
- this.data[_datamodel as keyof typeof this.data] = _obj.value;
89
- }
90
44
 
91
- executeBindings() {
92
- let _objList;
93
- if (typeof this.fieldType === "undefined" || this.fieldType == null) {
94
- _objList = (this.body as QCObjectsElement).subelements("*[data-field]"); // every child with data-field set
95
- } else {
96
- _objList = (this.body as QCObjectsElement).subelements(this.fieldType + "[data-field]"); // every child with data-field set and tagname is equal to fieldType property
97
- }
98
- for (let _datak = 0; _datak < _objList.length; _datak++) {
99
- const _obj = _objList[_datak] as HTMLElement & {value:any};
100
- const _datamodel = _obj.getAttribute("data-field");
101
- logger.debug("Binding " + _datamodel + " for " + this.name);
102
- this.data[_datamodel as keyof typeof this.data] = _obj.value;
103
- }
104
- }
105
-
106
- done(standardResponse:ComponentDoneResponse):Promise<ComponentDoneResponse> {
107
- const _ret_ = super.done(standardResponse);
108
- this.executeBindings();
109
- this.createBindingEvents();
110
- logger.debug("Field loaded: " + this.fieldType + "[name=" + this.name + "]");
111
- return _ret_;
112
- }
113
45
 
46
+ }
114
47
 
48
+ export class ButtonField extends FormField {
49
+ constructor(o: FieldComponentParams) {
50
+ o.fieldType = "button";
51
+ super(o);
115
52
  }
53
+ }
116
54
 
117
- Package("org.qcobjects.base.components", [
118
- FormField
119
- ]);
120
-
121
- class ShadowedComponent extends Component {
122
- container = null;
123
- shadowed = true;
124
- cached = false;
125
- controller = null;
126
- view = null;
127
- data = {};
128
-
129
- constructor (o:FieldComponentParams){
130
- o.body = _DOMCreateElement("div") as QCObjectsElement;
131
- super(o);
132
- }
133
-
134
-
55
+ export class InputField extends FormField {
56
+ constructor(o: FieldComponentParams) {
57
+ o.fieldType = "input";
58
+ super(o);
135
59
  }
136
60
 
137
- class ButtonField extends FormField {
138
- constructor(o:FieldComponentParams) {
139
- o.fieldType = "button";
140
- super(o);
141
- }
142
- }
143
-
144
- class InputField extends FormField {
145
- constructor(o:FieldComponentParams) {
146
- o.fieldType = "input";
147
- super(o);
148
- }
61
+ }
149
62
 
63
+ export class TextField extends FormField {
64
+ constructor(o: FieldComponentParams) {
65
+ o.fieldType = "textarea";
66
+ super(o);
150
67
  }
151
68
 
152
- class TextField extends FormField {
153
- constructor(o:FieldComponentParams) {
154
- o.fieldType = "textarea";
155
- super(o);
156
- }
69
+ }
157
70
 
71
+ export class EmailField extends FormField {
72
+ constructor(o: FieldComponentParams) {
73
+ o.fieldType = "input";
74
+ super(o);
158
75
  }
159
76
 
160
- class EmailField extends FormField {
161
- constructor(o:FieldComponentParams) {
162
- o.fieldType = "input";
163
- super(o);
164
- }
165
-
166
- }
77
+ }
167
78
 
168
- class ModalEnclosureComponent extends Component {
169
- name = "modalenclosure";
170
- tplsource = "inline";
171
- cached = false;
172
- basePath = CONFIG.get("modalBasePath", CONFIG.get("remoteSDKPath", ""));
173
- template = `
79
+ export class ModalEnclosureComponent extends Component {
80
+ name = "modalenclosure";
81
+ tplsource = "inline";
82
+ cached = false;
83
+ basePath = CONFIG.get("modalBasePath", CONFIG.get("remoteSDKPath", ""));
84
+ template = `
174
85
  <!-- The Modal -->
175
86
  <style>
176
87
  @import url('https://sdk.qcobjects.dev/css/modal.css');
@@ -186,151 +97,130 @@ const _top:any = (typeof module === "object" && typeof module.exports === "objec
186
97
  </div>
187
98
  `;
188
99
 
189
- data = {};
190
- constructor(o:FieldComponentParams) {
191
- o.body = _DOMCreateElement("div") as QCObjectsElement;
192
- super(o);
100
+ data = {};
101
+ constructor(o: FieldComponentParams) {
102
+ o.body = _DOMCreateElement("div");
103
+ super(o);
104
+ }
105
+
106
+ }
107
+
108
+ export class ModalComponent extends Component {
109
+ name = "modal";
110
+ cached = false;
111
+ modalEnclosureComponentClass = "ModalEnclosureComponent";
112
+ controller = null;
113
+ view = null;
114
+ tplsource = "none";
115
+ closeOnClickOutside = false;
116
+ data = {
117
+ content: "",
118
+ modalId: 0
119
+ };
120
+
121
+ submodal = null;
122
+ __instanceID!: number;
123
+ basePath: any;
124
+ subcomponents: any;
125
+ body: any;
126
+ templateURI: any;
127
+
128
+ constructor(o: FieldComponentParams) {
129
+ o.basePath = CONFIG.get("modalBasePath", CONFIG.get("remoteSDKPath", ""));
130
+ super(o);
131
+ this.data.modalId = this.__instanceID;
132
+ const submodal = New(ClassFactory(this.modalEnclosureComponentClass), {
133
+ name: this.name,
134
+ basePath: this.basePath,
135
+ data: this.data
136
+ });
137
+ this.subcomponents.push(submodal);
138
+ this.submodal = submodal;
139
+ if (submodal.tplsource === "none") {
140
+ this.body.innerHTML = submodal.parsedAssignmentText;
141
+ } else {
142
+ this.body.append(submodal.body);
193
143
  }
194
144
 
195
145
  }
196
146
 
197
- class ModalComponent extends Component {
198
- name = "modal";
199
- cached = false;
200
- modalEnclosureComponentClass = "ModalEnclosureComponent";
201
- controller = null;
202
- view = null;
203
- tplsource = "none";
204
- closeOnClickOutside = false;
205
- data = {
206
- content: "",
207
- modalId: 0
208
- };
209
-
210
- submodal = null;
211
-
212
- constructor(o:FieldComponentParams) {
213
- o.basePath = CONFIG.get("modalBasePath", CONFIG.get("remoteSDKPath", ""));
214
- super(o);
215
- this.data.modalId = this.__instanceID;
216
- const submodal = New(ClassFactory(this.modalEnclosureComponentClass), {
217
- name: this.name,
218
- basePath: this.basePath,
219
- data: this.data
220
- });
221
- this.subcomponents.push(submodal);
222
- this.submodal = submodal;
223
- if (submodal.tplsource === "none") {
224
- this.body.innerHTML = submodal.parsedAssignmentText;
225
- } else {
226
- this.body.append(submodal.body);
227
- }
147
+ modal() {
148
+ const modalId = this.data.modalId;
228
149
 
229
- }
150
+ Tag("#modalInstance_" + modalId + ".modal").map((modal: any) => {
151
+ modal.style.display = "block";
230
152
 
231
- modal() {
232
- const modalId = this.data.modalId;
153
+ return (new ModalFade()).apply(modal, 0, 1);
154
+ });
155
+ Tag("#modalInstance_" + modalId + ".modal .modal-content").map((modalcontent: any) => {
233
156
 
234
- Tag("#modalInstance_" + modalId + ".modal").map( (modal) => {
235
- modal.style.display = "block";
236
- return (new ModalFade({})).apply(modal, 0, 1);
237
- });
238
- Tag("#modalInstance_" + modalId + ".modal .modal-content").map( (modalcontent) => {
239
- return (new ModalMoveDown({})).apply(modalcontent, 0, -document.body.clientHeight, 0, 0);
240
- });
241
- Tag("#modalInstance_" + modalId + ".modal .modal-content .close").map( (closebtn) => {
242
- return closebtn.addEventListener("click", () => {
243
- this.close();
244
- }, false);
245
- });
246
- if (this.closeOnClickOutside) {
247
- window.addEventListener("click", () => {
248
- this.close();
249
- }, false);
250
- }
251
- }
157
+ return ModalMoveDown.apply(modalcontent, 0, -document.body.clientHeight, 0, 0);
158
+ });
159
+ Tag("#modalInstance_" + modalId + ".modal .modal-content .close").map((closebtn: any) => {
252
160
 
253
- close() {
254
- const modalId = this.data.modalId;
255
- Tag("#modalInstance_" + modalId + ".modal").map( (modal) => {
256
- modal.style.display = "block";
257
- return (new ModalFade({})).apply(modal, 1, 0);
258
- });
259
- Tag("#modalInstance_" + modalId + ".modal .modal-content").map(function (modalcontent) {
260
- return (new ModalMoveUp({})).apply(modalcontent, 0, 0, 0, -document.body.clientHeight);
261
- });
262
- setTimeout(function () {
263
- Tag("#modalInstance_" + modalId + ".modal").map((modal) => {
264
- modal.style.display = "none";
265
- return true;
266
- });
267
- }, 900);
161
+ return closebtn.addEventListener("click", () => {
162
+ this.close();
163
+ }, false);
164
+ });
165
+ if (this.closeOnClickOutside) {
166
+ window.addEventListener("click", () => {
167
+ this.close();
168
+ }, false);
268
169
  }
170
+ }
269
171
 
270
- rebuild() {
271
- const _ret_ = super.rebuild();
272
- this.templateURI = ComponentURI({
273
- "COMPONENTS_BASE_PATH": CONFIG.get("componentsBasePath", ""),
274
- "COMPONENT_NAME": "modal",
275
- "TPLEXTENSION": CONFIG.get("tplextension", ""),
276
- "TPL_SOURCE": "default" // here is always default in order to get the right uri
172
+ close() {
173
+ const modalId = this.data.modalId;
174
+ Tag("#modalInstance_" + modalId + ".modal").map((modal: any) => {
175
+ modal.style.display = "block";
176
+
177
+ return (new ModalFade({ duration: 3000 })).apply(modal, 1, 0);
178
+ });
179
+ Tag("#modalInstance_" + modalId + ".modal .modal-content").map(function (modalcontent: any) {
180
+
181
+ return ModalMoveUp.apply(modalcontent, 0, 0, 0, -document.body.clientHeight);
182
+ });
183
+ setTimeout(function () {
184
+ Tag("#modalInstance_" + modalId + ".modal").map((modal: any) => {
185
+ modal.style.display = "none";
186
+ return true;
277
187
  });
278
- return _ret_; // parent call
279
- }
188
+ }, 900);
189
+ }
280
190
 
191
+ rebuild() {
192
+ const _ret_ = super.rebuild();
193
+ this.templateURI = ComponentURI({
194
+ "COMPONENTS_BASE_PATH": CONFIG.get("componentsBasePath", ""),
195
+ "COMPONENT_NAME": "modal",
196
+ "TPLEXTENSION": CONFIG.get("tplextension", ""),
197
+ "TPL_SOURCE": "default" // here is always default in order to get the right uri
198
+ });
281
199
 
200
+ return _ret_; // parent call
282
201
  }
283
202
 
284
- class SwaggerUIComponent extends Component {
285
- cached = false;
286
- basePath = CONFIG.get("remoteSDKPath", "");
287
- tplextension = "tpl.html";
288
- name = "swagger-ui";
289
203
 
290
- }
204
+ }
291
205
 
206
+ export class SwaggerUIComponent extends Component {
207
+ cached = false;
208
+ basePath = CONFIG.get("remoteSDKPath", "");
209
+ tplextension = "tpl.html";
210
+ name = "swagger-ui";
292
211
 
293
- Package("org.qcobjects.form.components", [
294
- ShadowedComponent,
295
- ButtonField,
296
- InputField,
297
- TextField,
298
- EmailField,
299
- ModalEnclosureComponent,
300
- ModalComponent,
301
- SwaggerUIComponent
302
- ]);
303
-
304
- global.FormField = FormField;
305
- global.ShadowedComponent = ShadowedComponent;
306
- global.ButtonField = ButtonField;
307
- global.InputField = InputField;
308
- global.TextField = TextField;
309
- global.EmailField = EmailField;
310
- global.ModalEnclosureComponent = ModalEnclosureComponent;
311
- global.ModalComponent = ModalComponent;
312
- global.SwaggerUIComponent = SwaggerUIComponent;
313
-
314
- })(_top);
315
-
316
- const FormField = _top.FormField;
317
- const ShadowedComponent = _top.ShadowedComponent;
318
- const ButtonField = _top.ButtonField;
319
- const InputField = _top.InputField;
320
- const TextField = _top.TextField;
321
- const EmailField = _top.EmailField;
322
- const ModalEnclosureComponent = _top.ModalEnclosureComponent;
323
- const ModalComponent = _top.ModalComponent;
324
- const SwaggerUIComponent = _top.SwaggerUIComponent;
325
-
326
- export {
327
- FormField,
328
- ShadowedComponent,
329
- ButtonField,
330
- InputField,
331
- TextField,
332
- EmailField,
333
- ModalComponent,
334
- ModalEnclosureComponent,
212
+ }
213
+
214
+
215
+ Package("org.qcobjects.form.components", [
216
+ ShadowedComponent,
217
+ ButtonField,
218
+ InputField,
219
+ TextField,
220
+ EmailField,
221
+ ModalEnclosureComponent,
222
+ ModalComponent,
335
223
  SwaggerUIComponent
336
- };
224
+ ]);
225
+
226
+