qcobjects-sdk 0.0.1 → 0.0.3

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 (57) hide show
  1. package/.eslintrc.json +28 -0
  2. package/.github/FUNDING.yml +12 -0
  3. package/.github/ISSUE_TEMPLATE/bug_report.md +38 -0
  4. package/.github/ISSUE_TEMPLATE/custom.md +10 -0
  5. package/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
  6. package/.github/ISSUE_TEMPLATE/issue-template.md +33 -0
  7. package/.github/workflows/codeql-analysis.yml +71 -0
  8. package/.github/workflows/npmpublish-beta.yml +38 -0
  9. package/.github/workflows/npmpublish-lts.yml +38 -0
  10. package/.github/workflows/npmpublish-main.yml +38 -0
  11. package/CHANGELOG.md +47 -0
  12. package/QCObjects-SDK.js +108 -232
  13. package/README.md +951 -6
  14. package/VERSION +1 -0
  15. package/css/base-modal.css +43 -0
  16. package/css/basic-layout-embedded-nav.css +14 -0
  17. package/css/basic-layout.css +76 -0
  18. package/css/components/horizontal-list.css +64 -0
  19. package/css/components/list.css +57 -0
  20. package/css/components/splashscreen.css +111 -0
  21. package/css/modal.css +46 -0
  22. package/demo-tests/test-component-grid.html +63 -0
  23. package/demo-tests/test-component-list.html +53 -0
  24. package/demo-tests/test-component-notifications.html +49 -0
  25. package/demo-tests/test-component-slider.html +68 -0
  26. package/favicon.ico +0 -0
  27. package/js/org.qcobjects.cloud.auth.session.data.js +136 -0
  28. package/js/org.qcobjects.cloud.auth.session.usertoken.js +107 -0
  29. package/js/org.qcobjects.components.grid.js +71 -0
  30. package/js/org.qcobjects.components.js +277 -0
  31. package/js/org.qcobjects.components.list.js +57 -0
  32. package/js/org.qcobjects.components.notifications.js +190 -0
  33. package/js/org.qcobjects.components.slider.js +217 -0
  34. package/js/org.qcobjects.components.splashscreen.js +622 -0
  35. package/js/org.qcobjects.controllers.form.js +214 -0
  36. package/js/org.qcobjects.controllers.grid.js +289 -0
  37. package/js/org.qcobjects.controllers.js +42 -0
  38. package/js/org.qcobjects.controllers.list.js +241 -0
  39. package/js/org.qcobjects.controllers.slider.js +148 -0
  40. package/js/org.qcobjects.controllers.swagger.js +86 -0
  41. package/js/org.qcobjects.effects.js +388 -0
  42. package/js/org.qcobjects.i18n_messages.js +58 -0
  43. package/js/org.qcobjects.modal.controllers.js +47 -0
  44. package/js/org.qcobjects.modal.effects.js +57 -0
  45. package/js/org.qcobjects.models.js +48 -0
  46. package/js/org.qcobjects.tools.canvas.js +59 -0
  47. package/js/org.qcobjects.tools.js +68 -0
  48. package/js/org.qcobjects.tools.layouts.js +82 -0
  49. package/js/org.qcobjects.views.js +42 -0
  50. package/package.json +17 -4
  51. package/spec/support/jasmine.json +16 -0
  52. package/spec/testsSpec.js +9 -0
  53. package/templates/components/modalyoulose.tpl.html +3 -0
  54. package/templates/components/modalyouwin.tpl.html +4 -0
  55. package/templates/components/splashscreen.tpl.html +128 -0
  56. package/templates/components/swagger-ui.tpl.html +22 -0
  57. package/v2.4 version +1 -0
@@ -0,0 +1,190 @@
1
+ /**
2
+ * QCObjects SDK 2.4
3
+ * ________________
4
+ *
5
+ * Author: Jean Machuca <correojean@gmail.com>
6
+ *
7
+ * Cross Browser Javascript Framework for MVC Patterns
8
+ * QuickCorp/QCObjects is licensed under the
9
+ * GNU Lesser General Public License v3.0
10
+ * [LICENSE] (https://github.com/QuickCorp/QCObjects/blob/master/LICENSE.txt)
11
+ *
12
+ * Permissions of this copyleft license are conditioned on making available
13
+ * complete source code of licensed works and modifications under the same
14
+ * license or the GNU GPLv3. Copyright and license notices must be preserved.
15
+ * Contributors provide an express grant of patent rights. However, a larger
16
+ * work using the licensed work through interfaces provided by the licensed
17
+ * work may be distributed under different terms and without source code for
18
+ * the larger work.
19
+ *
20
+ * Copyright (C) 2015 Jean Machuca,<correojean@gmail.com>
21
+ *
22
+ * Everyone is permitted to copy and distribute verbatim copies of this
23
+ * license document, but changing it is not allowed.
24
+ */
25
+ (function() {
26
+ "use strict";
27
+ Package("org.quickcorp.components.notifications", [
28
+
29
+ class NotificationComponent extends Component {
30
+
31
+ constructor (){
32
+ super(...arguments);
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
+
87
+ }
88
+
89
+ display(element) {
90
+ var _display_ = function (element){
91
+ element.style.display="block";
92
+ var appearEffect = New(Move,{
93
+ duration:900,
94
+ apply (element){
95
+ _super_("Fade","apply").call(this,element,0,1);
96
+ _super_("Move","apply").call(this,element,0,-document.body.clientHeight,0,0);
97
+ }
98
+ });
99
+ var disappearEffect = New(Move,{
100
+ duration:650,
101
+ apply (element){
102
+ _super_("Fade","apply").call(this,element,1,0);
103
+ _super_("Move","apply").call(this,element,0,0,0,-document.body.clientHeight);
104
+ }
105
+ });
106
+ appearEffect.apply(element);
107
+ setTimeout(function (){
108
+ disappearEffect.apply(element);
109
+ },2000);
110
+ };
111
+ element.subelements("div.notification_background").map(element=>New(Fade,{duration:500}).apply(element,0,1));
112
+ element.subelements("div.notification").map(element=>_display_(element));
113
+ setTimeout(function (){
114
+ element.remove();
115
+ },2200);
116
+ }
117
+
118
+ success(message) {
119
+ var c = New(NotificationComponent, {
120
+ name: "notification",
121
+ shadowed: this.shadowed,
122
+ body: _DOMCreateElement("div"),
123
+ data: {
124
+ kind: "success",
125
+ title: "Success!",
126
+ message: `${message}...`
127
+ }
128
+ });
129
+ document.body.append(c);
130
+ var _componentRoot = (c.shadowed)?(c.shadowRoot.host):(c.body);
131
+ c.display(_componentRoot);
132
+ }
133
+
134
+ danger(message) {
135
+ var c = New(NotificationComponent, {
136
+ name: "notification",
137
+ shadowed: this.shadowed,
138
+ body: _DOMCreateElement("div"),
139
+ data: {
140
+ kind: "danger",
141
+ title: "Danger!",
142
+ message: `${message}...`
143
+ }
144
+ });
145
+ document.body.append(c);
146
+ var _componentRoot = (c.shadowed)?(c.shadowRoot.host):(c.body);
147
+ c.display(_componentRoot);
148
+ }
149
+
150
+ info(message) {
151
+ var c = New(NotificationComponent, {
152
+ name: "notification",
153
+ shadowed: this.shadowed,
154
+ body: _DOMCreateElement("div"),
155
+ data: {
156
+ kind: "info",
157
+ title: "Info!",
158
+ message: `${message}...`
159
+ }
160
+ });
161
+ document.body.append(c);
162
+ var _componentRoot = (c.shadowed)?(c.shadowRoot.host):(c.body);
163
+ c.display(_componentRoot);
164
+ }
165
+
166
+ warning(message) {
167
+ var c = New(NotificationComponent, {
168
+ name: "notification",
169
+ shadowed: this.shadowed,
170
+ body: _DOMCreateElement("div"),
171
+ data: {
172
+ kind: "warning",
173
+ title: "Warning!",
174
+ message: `${message}...`
175
+ }
176
+ });
177
+ document.body.append(c);
178
+ var _componentRoot = (c.shadowed)?(c.shadowRoot.host):(c.body);
179
+ c.display(_componentRoot);
180
+ }
181
+
182
+
183
+ }
184
+
185
+ ]);
186
+ NotificationComponent.success = (message) => (new NotificationComponent({name:"notification",tplsource:"none"})).success(message);
187
+ NotificationComponent.danger = (message) => (new NotificationComponent({name:"notification",tplsource:"none"})).danger(message);
188
+ NotificationComponent.info = (message) => (new NotificationComponent({name:"notification",tplsource:"none"})).info(message);
189
+ NotificationComponent.warning = (message) => (new NotificationComponent({name:"notification",tplsource:"none"})).warning(message);
190
+ }).call(null);
@@ -0,0 +1,217 @@
1
+ /**
2
+ * QCObjects SDK 2.4
3
+ * ________________
4
+ *
5
+ * Author: Jean Machuca <correojean@gmail.com>
6
+ *
7
+ * Cross Browser Javascript Framework for MVC Patterns
8
+ * QuickCorp/QCObjects is licensed under the
9
+ * GNU Lesser General Public License v3.0
10
+ * [LICENSE] (https://github.com/QuickCorp/QCObjects/blob/master/LICENSE.txt)
11
+ *
12
+ * Permissions of this copyleft license are conditioned on making available
13
+ * complete source code of licensed works and modifications under the same
14
+ * license or the GNU GPLv3. Copyright and license notices must be preserved.
15
+ * Contributors provide an express grant of patent rights. However, a larger
16
+ * work using the licensed work through interfaces provided by the licensed
17
+ * work may be distributed under different terms and without source code for
18
+ * the larger work.
19
+ *
20
+ * Copyright (C) 2015 Jean Machuca,<correojean@gmail.com>
21
+ *
22
+ * Everyone is permitted to copy and distribute verbatim copies of this
23
+ * license document, but changing it is not allowed.
24
+ */
25
+ (function() {
26
+ "use strict";
27
+ Package("org.qcobjects.components.slider",[
28
+
29
+ class SlideListComponent extends Component {
30
+
31
+ constructor (){
32
+ super(...arguments);
33
+ this.name="slidelist";
34
+ this.tplsource="inline";
35
+ this.template="<p>Loading...</p>";
36
+
37
+ }
38
+
39
+ _new_ (o){
40
+ super._new_(o);
41
+ o.body.setAttribute("controllerClass","DataGridController");
42
+ var subcomponentClass = (o.body.getAttribute("subcomponentClass") !== null)?(o.body.getAttribute("subcomponentClass")):("GridItemComponent");
43
+ o.body.setAttribute("subcomponentClass",subcomponentClass);
44
+ }
45
+
46
+
47
+ },
48
+
49
+ class SlideItemComponent extends Component {
50
+
51
+ constructor () {
52
+ super(...arguments);
53
+ this.name="slider_item";
54
+ this.template= `
55
+ <div class="qcoSlides" style="display:none">
56
+ <div class="qco-slider__numbertext">{{slideNumber}} / {{__dataLength}}</div>
57
+ <img src="{{image}}" alt="{{name}}"/>
58
+ <div class="qco-slider__text">
59
+ <p>{{label}} <a href="{{link}}">{{category}}</a></p>
60
+ </div>
61
+ </div>
62
+ `;
63
+ this.tplsource= "inline";
64
+
65
+ }
66
+
67
+ _new_ (o){
68
+ super._new_(o);
69
+ this.data.slideNumber = o.data.__dataIndex + 1;
70
+ }
71
+
72
+
73
+ },
74
+
75
+ class SliderComponent extends Component {
76
+
77
+ constructor () {
78
+ super(...arguments);
79
+ this.name="slider";
80
+ this.template= `
81
+ <style>
82
+ /* Slideshow container */
83
+
84
+ :host a:hover,
85
+ :host a:active,
86
+ :host a:visited {
87
+ color: #ffffff;
88
+ }
89
+
90
+ {
91
+ color: #ffffff;
92
+ }
93
+
94
+ :host .prev {left:0;}
95
+ .qco-slider__container {
96
+ max-width: 100%;
97
+ position: relative;
98
+ margin: auto;
99
+ height: 300px;
100
+ }
101
+ :host .qco-slider__container .qcoSlides img {
102
+ object-fit: cover;
103
+ width: 100%;
104
+ height: 300px;
105
+ }
106
+
107
+ /* Next & previous buttons */
108
+ :host .prev,
109
+ :host .next {
110
+ cursor: pointer;
111
+ position: absolute;
112
+ top: 50%;
113
+ width: auto;
114
+ margin-top: -22px;
115
+ padding: 16px;
116
+ color: white;
117
+ font-weight: bold;
118
+ font-size: 18px;
119
+ transition: 0.6s ease;
120
+ border-radius: 0 3px 3px 0;
121
+ background-color: rgba(1, 1, 1, 0.1);
122
+ }
123
+
124
+ /* Position the "next button" to the right */
125
+ :host .next {
126
+ right: 0;
127
+ border-radius: 3px 0 0 3px;
128
+ }
129
+
130
+ /* On hover, add a black background color with a little bit see-through */
131
+ :host .prev:hover,
132
+ :host .next:hover {
133
+ background-color: rgba(0, 0, 0, 0.8);
134
+ }
135
+
136
+ /* Caption text */
137
+ :host .qco-slider__text {
138
+ color: #f2f2f2;
139
+ font-size: 15px;
140
+ /* padding: 8px 12px;*/
141
+ position: absolute;
142
+ bottom: 8px;
143
+ width: 100%;
144
+ text-align: center;
145
+ text-shadow: -1px 1px 3px #111111;
146
+ background-color: rgba(1,1,1,0.7);
147
+ }
148
+
149
+ /* Number text (1/3 etc) */
150
+ :host .qco-slider__numbertext {
151
+ color: #f2f2f2;
152
+ text-shadow: 0px 2px 3px #111111;
153
+ font-size: 12px;
154
+ padding: 8px 12px;
155
+ position: absolute;
156
+ top: 0;
157
+ padding-top: 0;
158
+ margin-top: 10px;
159
+ }
160
+
161
+ /* The dots/bullets/indicators */
162
+ :host .qcoSlider__dots {
163
+ text-align: center;
164
+ margin: 0 auto;
165
+ padding: 0;
166
+ }
167
+ :host .qcoSlider__dots--dot {
168
+ cursor: pointer;
169
+ height: 10px;
170
+ width: 10px;
171
+ margin: 0 2px;
172
+ background-color: #bbb;
173
+ border-radius: 50%;
174
+ display: inline-block;
175
+ transition: background-color 0.6s ease;
176
+ }
177
+
178
+ :host .active,
179
+ :host .qcoSlider__dots--dot:hover {
180
+ background-color: #717171;
181
+ }
182
+
183
+ :host .qco-slider__container .qcoSlides img {
184
+ border-radius: 30px 30px 0px 0px;
185
+ }
186
+
187
+ </style>
188
+
189
+ <div class="qco-slider__container">
190
+ <component name="slidelist" componentClass="SlideListComponent" subcomponentClass="SlideItemComponent" serviceClass="{{SERVICE_CLASS}}" ></component>
191
+
192
+ <a class="prev" onclick="global.get('{{sliderHandler}}').plusSlidesAndStop(-1)">&#10094;</a>
193
+ <a class="next" onclick="global.get('{{sliderHandler}}').plusSlidesAndStop(1)">&#10095;</a>
194
+ </div>
195
+ <br>
196
+
197
+ <div class="qcoSlider__dots" style="text-align:center">
198
+ </div>
199
+
200
+ `;
201
+ this.tplsource= "inline";
202
+ this.shadowed= true;
203
+
204
+ }
205
+
206
+ _new_(){
207
+ super._new_();
208
+ this.data.SERVICE_CLASS = this.body.getAttribute("serviceClass");
209
+ this.data.sliderHandler = "slider_"+this.__instanceID.toString();
210
+ this.body.setAttribute("controllerClass","SliderController");
211
+ }
212
+
213
+ }
214
+
215
+ ]);
216
+
217
+ }).call(null);