qcobjects-sdk 2.4.22 → 2.4.25

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 CHANGED
@@ -1 +1 @@
1
- 2.4.22
1
+ 2.4.25
@@ -21,142 +21,140 @@
21
21
  *
22
22
  * Everyone is permitted to copy and distribute verbatim copies of this
23
23
  * license document, but changing it is not allowed.
24
- */
24
+ */
25
25
  "use strict";
26
- (function() {
26
+ (function () {
27
27
  Package("org.qcobjects.base.components", [
28
28
  class FormField extends Component {
29
- constructor (){
29
+ constructor() {
30
30
  super(...arguments);
31
31
  this.cached = false;
32
32
  this.reload = true;
33
-
33
+
34
34
  }
35
-
36
- createBindingEvents(){
35
+
36
+ createBindingEvents() {
37
37
  var thisobj = this;
38
38
  var _objList;
39
- if (typeof this.fieldType =="undefined" || this.fieldType == null ){
39
+ if (typeof this.fieldType == "undefined" || this.fieldType == null) {
40
40
  _objList = this.body.subelements("*[data-field]"); // every child with data-field set
41
41
  } else {
42
- _objList = this.body.subelements(this.fieldType+"[data-field]"); // every child with data-field set and tagname is equal to fieldType property
42
+ _objList = this.body.subelements(this.fieldType + "[data-field]"); // every child with data-field set and tagname is equal to fieldType property
43
43
  }
44
- for (var _datak=0;_datak<_objList.length;_datak++){
44
+ for (var _datak = 0; _datak < _objList.length; _datak++) {
45
45
  var _obj = _objList[_datak];
46
- _obj.addEventListener("change",function(e){
46
+ _obj.addEventListener("change", function (e) {
47
47
  logger.debug("Executing change event binding");
48
48
  thisobj.executeBindings(e);
49
49
  });
50
- _obj.addEventListener("blur",function(e){
50
+ _obj.addEventListener("blur", function (e) {
51
51
  logger.debug("Executing change event binding");
52
52
  thisobj.executeBindings(e);
53
53
  });
54
- _obj.addEventListener("focus",function(e){
54
+ _obj.addEventListener("focus", function (e) {
55
55
  logger.debug("Executing change event binding");
56
56
  thisobj.executeBindings(e);
57
57
  });
58
- _obj.addEventListener("keydown",function(e){
58
+ _obj.addEventListener("keydown", function (e) {
59
59
  logger.debug("Executing keydown event binding");
60
- thisobj.executeBindings(e);
60
+ thisobj.executeBindings(e);
61
61
  });
62
62
  }
63
63
  }
64
- executeBinding(_obj){
64
+ executeBinding(_obj) {
65
65
  var _datamodel = _obj.getAttribute("data-field");
66
- logger.debug("Binding "+_datamodel+" for "+this.name);
67
- this.data[_datamodel]=_obj.value;
66
+ logger.debug("Binding " + _datamodel + " for " + this.name);
67
+ this.data[_datamodel] = _obj.value;
68
68
  }
69
- executeBindings(){
69
+ executeBindings() {
70
70
  var _objList;
71
- if (typeof this.fieldType =="undefined" || this.fieldType == null ){
71
+ if (typeof this.fieldType == "undefined" || this.fieldType == null) {
72
72
  _objList = this.body.subelements("*[data-field]"); // every child with data-field set
73
73
  } else {
74
- _objList = this.body.subelements(this.fieldType+"[data-field]"); // every child with data-field set and tagname is equal to fieldType property
74
+ _objList = this.body.subelements(this.fieldType + "[data-field]"); // every child with data-field set and tagname is equal to fieldType property
75
75
  }
76
- for (var _datak=0;_datak<_objList.length;_datak++){
76
+ for (var _datak = 0; _datak < _objList.length; _datak++) {
77
77
  var _obj = _objList[_datak];
78
78
  var _datamodel = _obj.getAttribute("data-field");
79
- logger.debug("Binding "+_datamodel+" for "+this.name);
80
- this.data[_datamodel]=_obj.value;
79
+ logger.debug("Binding " + _datamodel + " for " + this.name);
80
+ this.data[_datamodel] = _obj.value;
81
81
  }
82
82
  }
83
- done(){
83
+ done() {
84
+ super.done(...arguments);
84
85
  var thisobj = this;
85
86
  thisobj.executeBindings();
86
87
  thisobj.createBindingEvents();
87
- logger.debug("Field loaded: "+thisobj.fieldType+"[name="+thisobj.name+"]");
88
+ logger.debug("Field loaded: " + thisobj.fieldType + "[name=" + thisobj.name + "]");
88
89
  }
89
-
90
-
90
+
91
+
91
92
  }
92
-
93
+
93
94
  ]);
94
- Package("org.qcobjects.form.components",[
95
+ Package("org.qcobjects.form.components", [
95
96
 
96
97
  class ShadowedComponent extends Component {
97
- constructor (){
98
+ constructor() {
98
99
  super(...arguments);
99
- this.container=null;
100
- this.body=null;
101
- this.shadowed=true;
102
- this.cached=false;
103
- this.controller=null;
104
- this.view=null;
105
- this.data={};
106
- }
107
-
108
- _new_ (){
109
- super._new_();
100
+ this.container = null;
101
+ this.body = null;
102
+ this.shadowed = true;
103
+ this.cached = false;
104
+ this.controller = null;
105
+ this.view = null;
106
+ this.data = {};
110
107
  this.body = _DOMCreateElement("div");
111
108
  }
112
109
 
110
+
113
111
  },
114
112
 
115
113
 
116
114
  class ButtonField extends FormField {
117
- constructor (){
115
+ constructor() {
118
116
  super(...arguments);
119
- this.fieldType="button";
117
+ this.fieldType = "button";
120
118
 
121
119
  }
122
120
  },
123
121
 
124
122
  class InputField extends FormField {
125
- constructor (){
123
+ constructor() {
126
124
  super(...arguments);
127
- this.fieldType="input";
125
+ this.fieldType = "input";
128
126
 
129
127
  }
130
128
 
131
129
  },
132
130
 
133
131
  class TextField extends FormField {
134
- constructor (){
132
+ constructor() {
135
133
  super(...arguments);
136
- this.fieldType="textarea";
134
+ this.fieldType = "textarea";
137
135
 
138
136
  }
139
137
 
140
138
  },
141
139
 
142
140
  class EmailField extends FormField {
143
- constructor (){
141
+ constructor() {
144
142
  super(...arguments);
145
- this.fieldType="input";
143
+ this.fieldType = "input";
146
144
 
147
145
  }
148
146
 
149
147
  },
150
148
 
151
149
  class ModalEnclosureComponent extends Component {
152
- constructor (){
150
+ constructor() {
153
151
  super(...arguments);
154
- this.name="modal";
155
- this.tplsource="inline";
156
- this.cached=false;
157
- this.basePath=CONFIG.get("modalBasePath",CONFIG.get("remoteSDKPath"));
158
- this.data={};
159
- this.template=`
152
+ this.name = "modal";
153
+ this.tplsource = "inline";
154
+ this.cached = false;
155
+ this.basePath = CONFIG.get("modalBasePath", CONFIG.get("remoteSDKPath"));
156
+ this.data = {};
157
+ this.template = `
160
158
  <!-- The Modal -->
161
159
  <style>
162
160
  @import url('https://sdk.qcobjects.dev/css/modal.css');
@@ -177,106 +175,99 @@
177
175
  },
178
176
 
179
177
  class ModalComponent extends Component {
180
- constructor (){
178
+ constructor() {
181
179
  super(...arguments);
182
- this.name="modal";
183
- this.cached=false;
184
- this.modalEnclosureComponentClass="ModalEnclosureComponent";
185
- this.basePath= CONFIG.get("modalBasePath",CONFIG.get("remoteSDKPath"));
186
- this.controller=null;
187
- this.view=null;
188
- this.tplsource="none";
189
- this.closeOnClickOutside=false;
190
- this.data={
191
- content:"",
192
- modalId:0
180
+ this.name = "modal";
181
+ this.cached = false;
182
+ this.modalEnclosureComponentClass = "ModalEnclosureComponent";
183
+ this.basePath = CONFIG.get("modalBasePath", CONFIG.get("remoteSDKPath"));
184
+ this.controller = null;
185
+ this.view = null;
186
+ this.tplsource = "none";
187
+ this.closeOnClickOutside = false;
188
+ this.data = {
189
+ content: "",
190
+ modalId: 0
193
191
  };
194
- this.submodal=null;
195
-
192
+ this.submodal = null;
193
+ var component = this;
194
+ component.data.modalId = component.__instanceID;
195
+ var submodal = New(ClassFactory(component.modalEnclosureComponentClass), {
196
+ name: component.name,
197
+ basePath: component.basePath,
198
+ data: component.data
199
+ });
200
+ component.subcomponents.push(submodal);
201
+ component.submodal = submodal;
202
+ if (submodal.tplsource == "none") {
203
+ component.body.innerHTML = submodal.parsedAssignmentText;
204
+ } else {
205
+ component.body.append(submodal.body);
206
+ }
207
+
196
208
  }
197
209
 
198
- modal(){
210
+ modal() {
199
211
  var modalId = this.data.modalId;
200
212
  var modalComponent = this;
201
213
 
202
- Tag("#modalInstance_"+parseInt(modalId)+".modal").map(function (modal){
203
- modal.style.display="block";
204
- ModalFade.apply(modal,0,1);
214
+ Tag("#modalInstance_" + parseInt(modalId) + ".modal").map(function (modal) {
215
+ modal.style.display = "block";
216
+ ModalFade.apply(modal, 0, 1);
205
217
  });
206
- Tag("#modalInstance_"+parseInt(modalId)+".modal .modal-content").map(function (modalcontent){
207
- ModalMoveDown.apply(modalcontent,0,-document.body.clientHeight,0,0);
218
+ Tag("#modalInstance_" + parseInt(modalId) + ".modal .modal-content").map(function (modalcontent) {
219
+ ModalMoveDown.apply(modalcontent, 0, -document.body.clientHeight, 0, 0);
208
220
  });
209
- Tag("#modalInstance_"+parseInt(modalId)+".modal .modal-content .close").map(function (closebtn){
210
- closebtn.addEventListener("click",function (){
221
+ Tag("#modalInstance_" + parseInt(modalId) + ".modal .modal-content .close").map(function (closebtn) {
222
+ closebtn.addEventListener("click", function () {
211
223
  modalComponent.close();
212
- },false);
224
+ }, false);
213
225
  });
214
- if (modalComponent.closeOnClickOutside){
215
- window.addEventListener("click",function (){
226
+ if (modalComponent.closeOnClickOutside) {
227
+ window.addEventListener("click", function () {
216
228
  modalComponent.close();
217
- },false);
229
+ }, false);
218
230
  }
219
231
  }
220
232
 
221
- close(){
233
+ close() {
222
234
  var modalId = this.data.modalId;
223
- Tag("#modalInstance_"+parseInt(modalId)+".modal").map(function (modal){
224
- modal.style.display="block";
225
- ModalFade.apply(modal,1,0);
235
+ Tag("#modalInstance_" + parseInt(modalId) + ".modal").map(function (modal) {
236
+ modal.style.display = "block";
237
+ ModalFade.apply(modal, 1, 0);
226
238
  });
227
- Tag("#modalInstance_"+parseInt(modalId)+".modal .modal-content").map(function (modalcontent){
228
- ModalMoveUp.apply(modalcontent,0,0,0,-document.body.clientHeight);
239
+ Tag("#modalInstance_" + parseInt(modalId) + ".modal .modal-content").map(function (modalcontent) {
240
+ ModalMoveUp.apply(modalcontent, 0, 0, 0, -document.body.clientHeight);
229
241
  });
230
- setTimeout(function (){
231
- Tag("#modalInstance_"+parseInt(modalId)+".modal").map(function (modal){
232
- modal.style.display="none";
242
+ setTimeout(function () {
243
+ Tag("#modalInstance_" + parseInt(modalId) + ".modal").map(function (modal) {
244
+ modal.style.display = "none";
233
245
  });
234
- },900);
235
- }
236
-
237
- _new_(o){
238
- super._new_(o);
239
- var component = this;
240
- component.data.modalId = component.__instanceID;
241
- var submodal = New(ClassFactory(component.modalEnclosureComponentClass),{
242
- name:component.name,
243
- basePath:component.basePath,
244
- data:component.data
245
- });
246
- component.subcomponents.push(submodal);
247
- component.submodal = submodal;
248
- if (submodal.tplsource == "none"){
249
- component.body.innerHTML = submodal.parsedAssignmentText;
250
- } else {
251
- component.body.append(submodal.body);
252
- }
246
+ }, 900);
253
247
  }
254
248
 
255
- done({request,component}){
256
- _super_("Component","done").call(this,{request:request,component:component}); // parent call
257
- }
258
-
259
- rebuild(){
249
+ rebuild() {
250
+ let _ret_ = super.rebuild(...arguments);
260
251
  this.templateURI = ComponentURI({
261
- "COMPONENTS_BASE_PATH":CONFIG.get("componentsBasePath"),
262
- "COMPONENT_NAME":"modal",
263
- "TPLEXTENSION":CONFIG.get("tplextension"),
264
- "TPL_SOURCE":"default" //here is always default in order to get the right uri
252
+ "COMPONENTS_BASE_PATH": CONFIG.get("componentsBasePath"),
253
+ "COMPONENT_NAME": "modal",
254
+ "TPLEXTENSION": CONFIG.get("tplextension"),
255
+ "TPL_SOURCE": "default" //here is always default in order to get the right uri
265
256
  });
266
- return _super_("Component","rebuild").call(this); // parent call
257
+ return _ret_; // parent call
267
258
  }
268
259
 
269
260
 
270
261
  },
271
262
 
272
263
  class SwaggerUIComponent extends Component {
273
- constructor (){
264
+ constructor() {
274
265
  super(...arguments);
275
- this.name="swagger-ui";
276
- this.cached=false;
277
- this.basePath= CONFIG.get("remoteSDKPath");
278
- this.tplextension="tpl.html";
279
-
266
+ this.name = "swagger-ui";
267
+ this.cached = false;
268
+ this.basePath = CONFIG.get("remoteSDKPath");
269
+ this.tplextension = "tpl.html";
270
+
280
271
  }
281
272
 
282
273
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qcobjects-sdk",
3
- "version": "2.4.22",
3
+ "version": "2.4.25",
4
4
  "description": "QCObjects SDK is a set of Controllers, Views and Components that are elementary and useful to assist developers to build applications under MVC patterns using QCObjects, Cross Browser Javascript Framework for MVC Patterns",
5
5
  "main": "QCObjects-SDK.js",
6
6
  "scripts": {
@@ -42,6 +42,6 @@
42
42
  "jasmine": "^3.6.3"
43
43
  },
44
44
  "peerDependencies": {
45
- "qcobjects": ">=2.4.28-beta"
45
+ "qcobjects": "^2.4.32-beta"
46
46
  }
47
47
  }
package/spec/testsSpec.js CHANGED
@@ -6,4 +6,4 @@ describe('QCObjects SDK Main Test', function () {
6
6
  expect(true).toEqual(true);
7
7
  });
8
8
 
9
- })
9
+ });