qcobjects-sdk 2.4.5 → 2.4.8

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 (31) hide show
  1. package/.eslintrc.json +26 -21
  2. package/QCObjects-SDK.js +47 -47
  3. package/VERSION +1 -1
  4. package/demo-tests/test-component-grid.html +43 -30
  5. package/demo-tests/test-component-list.html +31 -23
  6. package/demo-tests/test-component-notifications.html +31 -12
  7. package/demo-tests/test-component-slider.html +47 -31
  8. package/js/org.qcobjects.cloud.auth.session.data.js +106 -47
  9. package/js/org.qcobjects.cloud.auth.session.usertoken.js +64 -54
  10. package/js/org.qcobjects.components.grid.js +46 -34
  11. package/js/org.qcobjects.components.js +137 -80
  12. package/js/org.qcobjects.components.list.js +27 -18
  13. package/js/org.qcobjects.components.notifications.js +73 -58
  14. package/js/org.qcobjects.components.slider.js +174 -151
  15. package/js/org.qcobjects.components.splashscreen.js +480 -460
  16. package/js/org.qcobjects.controllers.form.js +38 -20
  17. package/js/org.qcobjects.controllers.grid.js +46 -25
  18. package/js/org.qcobjects.controllers.js +38 -6
  19. package/js/org.qcobjects.controllers.list.js +169 -157
  20. package/js/org.qcobjects.controllers.slider.js +113 -97
  21. package/js/org.qcobjects.controllers.swagger.js +60 -51
  22. package/js/org.qcobjects.effects.js +149 -124
  23. package/js/org.qcobjects.i18n_messages.js +11 -6
  24. package/js/org.qcobjects.modal.controllers.js +14 -9
  25. package/js/org.qcobjects.modal.effects.js +25 -16
  26. package/js/org.qcobjects.models.js +19 -11
  27. package/js/org.qcobjects.tools.canvas.js +10 -6
  28. package/js/org.qcobjects.tools.js +17 -8
  29. package/js/org.qcobjects.tools.layouts.js +19 -8
  30. package/js/org.qcobjects.views.js +12 -7
  31. package/package.json +3 -4
@@ -1,5 +1,5 @@
1
1
  /**
2
- * QCObjects SDK 2.3
2
+ * QCObjects SDK 2.4
3
3
  * ________________
4
4
  *
5
5
  * Author: Jean Machuca <correojean@gmail.com>
@@ -25,23 +25,35 @@
25
25
  "use strict";
26
26
  (function() {
27
27
  Package("org.qcobjects.components",[
28
- Class("ShadowedComponent",Component,{
29
- container:null,
30
- body:null,
31
- shadowed:true,
32
- cached:false,
33
- controller:null,
34
- view:null,
35
- data:{},
36
- _new_:function (o){
37
- o.body = _DOMCreateElement("div");
38
- _super_("Component","_new_").call(this,o);
39
- }
40
- }),
41
- Class("FormField",Component,{
42
- cached:false,
43
- reload:true,
44
- createBindingEvents:function (){
28
+
29
+ class ShadowedComponent extends Component {
30
+ constructor (){
31
+ super ();
32
+ this.container=null;
33
+ this.body=null;
34
+ this.shadowed=true;
35
+ this.cached=false;
36
+ this.controller=null;
37
+ this.view=null;
38
+ this.data={};
39
+ }
40
+
41
+ _new_ (){
42
+ super._new_();
43
+ this.body = _DOMCreateElement("div");
44
+ }
45
+
46
+ },
47
+
48
+ class FormField extends Component {
49
+ constructor (){
50
+ super ();
51
+ this.cached = false;
52
+ this.reload = true;
53
+
54
+ }
55
+
56
+ createBindingEvents(){
45
57
  var thisobj = this;
46
58
  var _objList;
47
59
  if (typeof this.fieldType =="undefined" || this.fieldType == null ){
@@ -68,13 +80,13 @@
68
80
  thisobj.executeBindings(e);
69
81
  });
70
82
  }
71
- },
72
- executeBinding:function (_obj){
83
+ }
84
+ executeBinding(_obj){
73
85
  var _datamodel = _obj.getAttribute("data-field");
74
86
  logger.debug("Binding "+_datamodel+" for "+this.name);
75
87
  this.data[_datamodel]=_obj.value;
76
- },
77
- executeBindings:function (){
88
+ }
89
+ executeBindings(){
78
90
  var _objList;
79
91
  if (typeof this.fieldType =="undefined" || this.fieldType == null ){
80
92
  _objList = this.body.subelements("*[data-field]"); // every child with data-field set
@@ -87,37 +99,61 @@
87
99
  logger.debug("Binding "+_datamodel+" for "+this.name);
88
100
  this.data[_datamodel]=_obj.value;
89
101
  }
90
- },
91
- done:function (){
102
+ }
103
+ done(){
92
104
  var thisobj = this;
93
105
  thisobj.executeBindings();
94
106
  thisobj.createBindingEvents();
95
107
  logger.debug("Field loaded: "+thisobj.fieldType+"[name="+thisobj.name+"]");
96
108
  }
97
- }),
98
- Class("ButtonField",FormField,{
99
- fieldType:"button"
100
- }),
101
- Class("InputField",FormField,{
102
- fieldType:"input"
103
- }),
104
- Class("TextField",FormField,{
105
- fieldType:"textarea"
106
- }),
107
- Class("EmailField",FormField,{
108
- fieldType:"input"
109
- }),
110
- Class("ModalEnclosureComponent",Component,{
111
- name:"modal",
112
- tplsource:"inline",
113
- cached:false,
114
- basePath:CONFIG.get("modalBasePath",CONFIG.get("remoteSDKPath")),
115
- data:{},
116
- _new_:function (o){
117
- o.body = _DOMCreateElement("div");
118
- _super_("Component","_new_").call(this,o);
119
- },
120
- template:`
109
+
110
+
111
+ },
112
+
113
+ class ButtonField extends FormField {
114
+ constructor (){
115
+ super();
116
+ this.fieldType="button";
117
+
118
+ }
119
+ },
120
+
121
+ class InputField extends FormField {
122
+ constructor (){
123
+ super();
124
+ this.fieldType="input";
125
+
126
+ }
127
+
128
+ },
129
+
130
+ class TextField extends FormField {
131
+ constructor (){
132
+ super();
133
+ this.fieldType="textarea";
134
+
135
+ }
136
+
137
+ },
138
+
139
+ class EmailField extends FormField {
140
+ constructor (){
141
+ super();
142
+ this.fieldType="input";
143
+
144
+ }
145
+
146
+ },
147
+
148
+ class ModalEnclosureComponent extends Component {
149
+ constructor (){
150
+ super();
151
+ this.name="modal";
152
+ this.tplsource="inline";
153
+ this.cached=false;
154
+ this.basePath=CONFIG.get("modalBasePath",CONFIG.get("remoteSDKPath"));
155
+ this.data={};
156
+ this.template=`
121
157
  <!-- The Modal -->
122
158
  <style>
123
159
  @import url('https://sdk.qcobjects.dev/css/modal.css');
@@ -131,23 +167,32 @@
131
167
  </div>
132
168
 
133
169
  </div>
134
- `
135
- }),
136
- Class("ModalComponent",Component,{
137
- name:"modal",
138
- cached:false,
139
- modalEnclosureComponentClass:"ModalEnclosureComponent",
140
- basePath: CONFIG.get("modalBasePath",CONFIG.get("remoteSDKPath")),
141
- controller:null,
142
- view:null,
143
- tplsource:"none",
144
- closeOnClickOutside:false,
145
- data:{
146
- content:"",
147
- modalId:0
148
- },
149
- submodal:null,
150
- modal: function (){
170
+ `;
171
+ this.body = _DOMCreateElement("div");
172
+ }
173
+
174
+ },
175
+
176
+ class ModalComponent extends Component {
177
+ constructor (){
178
+ super();
179
+ this.name="modal";
180
+ this.cached=false;
181
+ this.modalEnclosureComponentClass="ModalEnclosureComponent";
182
+ this.basePath= CONFIG.get("modalBasePath",CONFIG.get("remoteSDKPath"));
183
+ this.controller=null;
184
+ this.view=null;
185
+ this.tplsource="none";
186
+ this.closeOnClickOutside=false;
187
+ this.data={
188
+ content:"",
189
+ modalId:0
190
+ };
191
+ this.submodal=null;
192
+
193
+ }
194
+
195
+ modal(){
151
196
  var modalId = this.data.modalId;
152
197
  var modalComponent = this;
153
198
 
@@ -168,8 +213,9 @@
168
213
  modalComponent.close();
169
214
  },false);
170
215
  }
171
- },
172
- close: function (){
216
+ }
217
+
218
+ close(){
173
219
  var modalId = this.data.modalId;
174
220
  Tag("#modalInstance_"+parseInt(modalId)+".modal").map(function (modal){
175
221
  modal.style.display="block";
@@ -183,8 +229,9 @@
183
229
  modal.style.display="none";
184
230
  });
185
231
  },900);
186
- },
187
- _new_:function (o){
232
+ }
233
+
234
+ _new_(o){
188
235
  var component = this;
189
236
  component.data.modalId = component.__instanceID;
190
237
  var submodal = New(ClassFactory(component.modalEnclosureComponentClass),{
@@ -200,11 +247,13 @@
200
247
  component.body.append(submodal.body);
201
248
  }
202
249
  _super_("Component","_new_").call(this,o); // parent call
203
- },
204
- done: function ({request,component}){
250
+ }
251
+
252
+ done({request,component}){
205
253
  _super_("Component","done").call(this,{request:request,component:component}); // parent call
206
- },
207
- rebuild:function (){
254
+ }
255
+
256
+ rebuild(){
208
257
  this.templateURI = ComponentURI({
209
258
  "COMPONENTS_BASE_PATH":CONFIG.get("componentsBasePath"),
210
259
  "COMPONENT_NAME":"modal",
@@ -213,13 +262,21 @@
213
262
  });
214
263
  return _super_("Component","rebuild").call(this); // parent call
215
264
  }
216
- }),
217
- Class("SwaggerUIComponent",Component,{
218
- name:"swagger-ui",
219
- cached:false,
220
- basePath: CONFIG.get("remoteSDKPath"),
221
- tplextension:"tpl.html"
222
- })
265
+
266
+
267
+ },
268
+
269
+ class SwaggerUIComponent extends Component {
270
+ constructor (){
271
+ super();
272
+ this.name="swagger-ui";
273
+ this.cached=false;
274
+ this.basePath= CONFIG.get("remoteSDKPath");
275
+ this.tplextension="tpl.html";
276
+
277
+ }
278
+
279
+ }
223
280
 
224
281
  ]);
225
282
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * QCObjects SDK 2.3
2
+ * QCObjects SDK 2.4
3
3
  * ________________
4
4
  *
5
5
  * Author: Jean Machuca <correojean@gmail.com>
@@ -25,24 +25,33 @@
25
25
  (function() {
26
26
  "use strict";
27
27
  Package("org.qcobjects.components.list",[
28
- Class("ListItemComponent",Component,{
29
- name:"list-item",
30
- shadowed: false,
31
- tplsource: "inline",
32
- template:"<a href=\"{{value}}\">{{label}}</a>",
33
- cached: false
34
- }),
35
- Class("ListComponent",Component,{
36
- name:"list",
37
- shadowed: true,
38
- tplsource: "inline",
39
- template: "<p>Loading...</p>",
40
- _new_ (o){
41
- o.body.setAttribute("controllerClass","ListController");
42
- o.body.setAttribute("subcomponentClass","ListItemComponent");
43
- _super_("Component","_new_").call(this,o);
28
+
29
+ class ListItemComponent extends Component {
30
+ constructor (){
31
+ super();
32
+ this.name="list-item";
33
+ this.shadowed= false;
34
+ this.tplsource= "inline";
35
+ this.template="<a href=\"{{value}}\">{{label}}</a>";
36
+ this.cached= false;
37
+
38
+ }
39
+
40
+ },
41
+
42
+ class ListComponent extends Component {
43
+ constructor () {
44
+ super();
45
+ this.name="list";
46
+ this.shadowed= true;
47
+ this.tplsource= "inline";
48
+ this.template= "<p>Loading...</p>";
49
+ this.body.setAttribute("controllerClass","ListController");
50
+ this.body.setAttribute("subcomponentClass","ListItemComponent");
44
51
  }
45
- })
52
+
53
+ },
54
+
46
55
  ]);
47
56
 
48
57
  }).call(null);
@@ -1,5 +1,5 @@
1
1
  /**
2
- * QCObjects SDK 2.3
2
+ * QCObjects SDK 2.4
3
3
  * ________________
4
4
  *
5
5
  * Author: Jean Machuca <correojean@gmail.com>
@@ -25,59 +25,67 @@
25
25
  (function() {
26
26
  "use strict";
27
27
  Package("org.quickcorp.components.notifications", [
28
- Class("NotificationComponent", Component, {
29
- name: "notification",
30
- cached: false,
31
- tplsource: "inline",
32
- shadowed: false,
33
- body: _DOMCreateElement("div"),
34
- template: `
35
- <style>
36
- div.notification_background {
37
- display: block; /* Hidden by default */
38
- position: fixed; /* Stay in place */
39
- z-index: 1; /* Sit on top */
40
- padding-top: 100px; /* Location of the box */
41
- left: 0;
42
- top: 0;
43
- bottom:0;
44
- right:0;
45
- width: 100%; /* Full width */
46
- height: 100%; /* Full height */
47
- overflow: auto; /* Enable scroll if needed */
48
- background-color: rgb(0,0,0); /* Fallback color */
49
- background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
50
- border: none !important;
51
- }
52
- div.notification {
53
- border-radius: 12px !important;
54
- margin-bottom: 15px;
55
- padding: 4px 12px;
56
- }
57
- .notification.danger {
58
- background-color: #ffdddd;
59
- border-left: 6px solid #f44336;
60
- }
61
- .notification.success {
62
- background-color: #ddffdd;
63
- border-left: 6px solid #4CAF50;
64
- }
65
- .notification.info {
66
- background-color: #e7f3fe;
67
- border-left: 6px solid #2196F3;
68
- }
69
- .notification.warning {
70
- background-color: #ffffcc;
71
- border-left: 6px solid #ffeb3b;
28
+
29
+ class NotificationComponent extends Component {
30
+
31
+ constructor (){
32
+ super();
33
+
34
+ this.name= "notification";
35
+ this.cached= false;
36
+ this.tplsource= "inline";
37
+ this.shadowed= false;
38
+ this.body= _DOMCreateElement("div");
39
+ this.template= `
40
+ <style>
41
+ div.notification_background {
42
+ display: block; /* Hidden by default */
43
+ position: fixed; /* Stay in place */
44
+ z-index: 1; /* Sit on top */
45
+ padding-top: 100px; /* Location of the box */
46
+ left: 0;
47
+ top: 0;
48
+ bottom:0;
49
+ right:0;
50
+ width: 100%; /* Full width */
51
+ height: 100%; /* Full height */
52
+ overflow: auto; /* Enable scroll if needed */
53
+ background-color: rgb(0,0,0); /* Fallback color */
54
+ background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
55
+ border: none !important;
56
+ }
57
+ div.notification {
58
+ border-radius: 12px !important;
59
+ margin-bottom: 15px;
60
+ padding: 4px 12px;
61
+ }
62
+ .notification.danger {
63
+ background-color: #ffdddd;
64
+ border-left: 6px solid #f44336;
65
+ }
66
+ .notification.success {
67
+ background-color: #ddffdd;
68
+ border-left: 6px solid #4CAF50;
69
+ }
70
+ .notification.info {
71
+ background-color: #e7f3fe;
72
+ border-left: 6px solid #2196F3;
73
+ }
74
+ .notification.warning {
75
+ background-color: #ffffcc;
76
+ border-left: 6px solid #ffeb3b;
77
+ }
78
+ </style>
79
+ <div class="notification_background">
80
+ <div class="notification {{kind}}">
81
+ <p><strong>{{title}}</strong> {{message}}</p>
82
+ </div>
83
+ </div>
84
+ `;
85
+ this.kinds=["danger", "success", "info", "warning"];
86
+
72
87
  }
73
- </style>
74
- <div class="notification_background">
75
- <div class="notification {{kind}}">
76
- <p><strong>{{title}}</strong> {{message}}</p>
77
- </div>
78
- </div>
79
- `,
80
- kinds: ["danger", "success", "info", "warning"],
88
+
81
89
  display(element) {
82
90
  var _display_ = function (element){
83
91
  element.style.display="block";
@@ -105,7 +113,8 @@ Package("org.quickcorp.components.notifications", [
105
113
  setTimeout(function (){
106
114
  element.remove();
107
115
  },2200);
108
- },
116
+ }
117
+
109
118
  success(message) {
110
119
  var c = New(NotificationComponent, {
111
120
  name: "notification",
@@ -120,7 +129,8 @@ Package("org.quickcorp.components.notifications", [
120
129
  document.body.append(c);
121
130
  var _componentRoot = (c.shadowed)?(c.shadowRoot.host):(c.body);
122
131
  c.display(_componentRoot);
123
- },
132
+ }
133
+
124
134
  danger(message) {
125
135
  var c = New(NotificationComponent, {
126
136
  name: "notification",
@@ -135,7 +145,8 @@ Package("org.quickcorp.components.notifications", [
135
145
  document.body.append(c);
136
146
  var _componentRoot = (c.shadowed)?(c.shadowRoot.host):(c.body);
137
147
  c.display(_componentRoot);
138
- },
148
+ }
149
+
139
150
  info(message) {
140
151
  var c = New(NotificationComponent, {
141
152
  name: "notification",
@@ -150,7 +161,8 @@ Package("org.quickcorp.components.notifications", [
150
161
  document.body.append(c);
151
162
  var _componentRoot = (c.shadowed)?(c.shadowRoot.host):(c.body);
152
163
  c.display(_componentRoot);
153
- },
164
+ }
165
+
154
166
  warning(message) {
155
167
  var c = New(NotificationComponent, {
156
168
  name: "notification",
@@ -166,7 +178,10 @@ Package("org.quickcorp.components.notifications", [
166
178
  var _componentRoot = (c.shadowed)?(c.shadowRoot.host):(c.body);
167
179
  c.display(_componentRoot);
168
180
  }
169
- })
181
+
182
+
183
+ }
184
+
170
185
  ]);
171
186
 
172
187
  }).call(null);