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.
- package/.eslintrc.json +26 -21
- package/QCObjects-SDK.js +47 -47
- package/VERSION +1 -1
- package/demo-tests/test-component-grid.html +43 -30
- package/demo-tests/test-component-list.html +31 -23
- package/demo-tests/test-component-notifications.html +31 -12
- package/demo-tests/test-component-slider.html +47 -31
- package/js/org.qcobjects.cloud.auth.session.data.js +106 -47
- package/js/org.qcobjects.cloud.auth.session.usertoken.js +64 -54
- package/js/org.qcobjects.components.grid.js +46 -34
- package/js/org.qcobjects.components.js +137 -80
- package/js/org.qcobjects.components.list.js +27 -18
- package/js/org.qcobjects.components.notifications.js +73 -58
- package/js/org.qcobjects.components.slider.js +174 -151
- package/js/org.qcobjects.components.splashscreen.js +480 -460
- package/js/org.qcobjects.controllers.form.js +38 -20
- package/js/org.qcobjects.controllers.grid.js +46 -25
- package/js/org.qcobjects.controllers.js +38 -6
- package/js/org.qcobjects.controllers.list.js +169 -157
- package/js/org.qcobjects.controllers.slider.js +113 -97
- package/js/org.qcobjects.controllers.swagger.js +60 -51
- package/js/org.qcobjects.effects.js +149 -124
- package/js/org.qcobjects.i18n_messages.js +11 -6
- package/js/org.qcobjects.modal.controllers.js +14 -9
- package/js/org.qcobjects.modal.effects.js +25 -16
- package/js/org.qcobjects.models.js +19 -11
- package/js/org.qcobjects.tools.canvas.js +10 -6
- package/js/org.qcobjects.tools.js +17 -8
- package/js/org.qcobjects.tools.layouts.js +19 -8
- package/js/org.qcobjects.views.js +12 -7
- package/package.json +3 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* QCObjects SDK 2.
|
|
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
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
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
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
done({request,component}){
|
|
205
253
|
_super_("Component","done").call(this,{request:request,component:component}); // parent call
|
|
206
|
-
}
|
|
207
|
-
|
|
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
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
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.
|
|
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
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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.
|
|
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
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
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
|
-
|
|
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);
|