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,622 @@
1
+ logger.debugEnabled = true;
2
+ /**
3
+ * QCObjects SDK 2.4.0
4
+ * ________________
5
+ *
6
+ * Author: Jean Machuca <correojean@gmail.com>
7
+ *
8
+ * Cross Browser Javascript Framework for MVC Patterns
9
+ * QuickCorp/QCObjects is licensed under the
10
+ * GNU Lesser General Public License v3.0
11
+ * [LICENSE] (https://github.com/QuickCorp/QCObjects/blob/master/LICENSE.txt)
12
+ *
13
+ * Permissions of this copyleft license are conditioned on making available
14
+ * complete source code of licensed works and modifications under the same
15
+ * license or the GNU GPLv3. Copyright and license notices must be preserved.
16
+ * Contributors provide an express grant of patent rights. However, a larger
17
+ * work using the licensed work through interfaces provided by the licensed
18
+ * work may be distributed under different terms and without source code for
19
+ * the larger work.
20
+ *
21
+ * Copyright (C) 2015 Jean Machuca,<correojean@gmail.com>
22
+ *
23
+ * Everyone is permitted to copy and distribute verbatim copies of this
24
+ * license document, but changing it is not allowed.
25
+ */
26
+ (function() {
27
+ "use strict";
28
+ Package("org.qcobjects.components.base", [
29
+ class SplashScreenComponent extends Component {
30
+ constructor () {
31
+ super(...arguments);
32
+ this.name= "splashscreen";
33
+ this.cached= false;
34
+ this.shadowed= true;
35
+ var o = this;
36
+
37
+ var isBrowser = typeof window !== "undefined" && typeof window.self !== "undefined" && window === window.self;
38
+ let component = this;
39
+ var isStartURL = (location.hash === ""
40
+ && location.pathname === "/" && location.search === "")
41
+ || CONFIG.get("routingWay") === "hash" && CONFIG.get("start_url","/") === location.hash
42
+ || CONFIG.get("routingWay") === "pathname" && CONFIG.get("start_url","/") === location.pathname
43
+ || CONFIG.get("routingWay") === "search" && CONFIG.get("start_url","/") === location.search;
44
+ var _enabled_ = isBrowser && isStartURL;
45
+ if (_enabled_){
46
+ component.basePath = CONFIG.get("splashscreenBasePath",CONFIG.get("remoteSDKPath"));
47
+ o.data.basePath = component.basePath;
48
+ var displayEffectDuration = 1000;
49
+ var duration = component.body.getAttribute("duration");
50
+ if (duration === null){
51
+ duration = 3000;
52
+ } else {
53
+ duration = parseInt(duration);
54
+ }
55
+ component._bgcolor = document.body.style.backgroundColor;
56
+ var _helper_ = function (){
57
+ if (!_helper_.executed){
58
+ var component = this;
59
+ var _componentRoot = (component.shadowed)?(component.shadowRoot.host):(component.body);
60
+ global.componentsStack.filter(c=>c.body.hasAttribute("splashscreen")).map(
61
+ function (mainComponent){
62
+ logger.debug("Splash Screen of Main Component:",mainComponent.name);
63
+ mainComponent.splashScreenComponent = component;
64
+ function SplashScreenHandler (){
65
+ if (!SplashScreenHandler.executed){
66
+ var mainComponent = this;
67
+ var component = mainComponent.splashScreenComponent;
68
+ var mainElement = (mainComponent.shadowed)?(mainComponent.shadowRoot.host):(mainComponent.body);
69
+ mainComponent._mainPosition = mainElement.style.position;
70
+ mainElement.style.position = "fixed";
71
+ mainComponent._mainOpacity = mainElement.style.opacity;
72
+ _componentRoot.style.width = "100%";
73
+ _componentRoot.style.height = "100%";
74
+ document.body.style.backgroundColor = "#111111";
75
+ mainElement.style.opacity = 0;
76
+ setTimeout(function() {
77
+ if (typeof _componentRoot !== "undefined"){
78
+ document.body.style.backgroundColor = component._bgcolor;
79
+ _componentRoot.subelements("#slot-logo").map(function (slotlogo){
80
+ slotlogo.style.display = "block";
81
+ slotlogo.style.transformOrigin = "center";
82
+ (new Resize()).apply(slotlogo,1,0);
83
+ });
84
+ (new Fade()).apply(_componentRoot, 1, 0);
85
+ }
86
+ }, (duration-displayEffectDuration));
87
+ setTimeout(function() {
88
+ (new Fade()).apply(mainElement, 0, 1);
89
+ mainElement.style.position = mainComponent._mainPosition;
90
+ document.body.style.backgroundColor = component._bgcolor;
91
+ _componentRoot.parentElement.remove();
92
+ }, duration);
93
+ }
94
+ SplashScreenHandler.executed=true;
95
+ }
96
+ mainComponent.addComponentHelper(SplashScreenHandler.bind(mainComponent));
97
+ }
98
+ );
99
+ _helper_.executed=true;
100
+ }
101
+ };
102
+ _helper_.executed=false;
103
+ component.addComponentHelper(_helper_.bind(component));
104
+ } else {
105
+ component.body.style.display="none";
106
+ }
107
+
108
+ }
109
+
110
+
111
+ }
112
+
113
+ ]);
114
+
115
+ Package("org.qcobjects.components.splashscreen",[
116
+
117
+
118
+ class VideoSplashScreenComponent extends SplashScreenComponent {
119
+ constructor () {
120
+ super(...arguments);
121
+
122
+ this.name= "videosplashscreen";
123
+ this.cached= false;
124
+ this.shadowed= true;
125
+ this.tplsource= "inline";
126
+ this.template= `
127
+ <style>
128
+ :host * {
129
+ box-sizing: border-box;
130
+ }
131
+
132
+ :host {
133
+ zoom: 1.0;
134
+ width: device-width;
135
+ margin: 0;
136
+ top: 0;
137
+ left: 0;
138
+ right: 0;
139
+ bottom: 0;
140
+ position: absolute;
141
+ padding: 0;
142
+ min-width: 100vw;
143
+ min-height: 100vh;
144
+ width: 100vw;
145
+ height: 100vh;
146
+ overflow: hidden;
147
+ background-color: black;
148
+ }
149
+ #slot-logo::slotted(img) {
150
+ vertical-align: middle;
151
+ display: block;
152
+ width: 40vw;
153
+ left: 0;
154
+ margin: 0;
155
+ padding: 0;
156
+ z-index: 9999999999;
157
+ transform-origin: center;
158
+ transform-style: preserve-3d;
159
+ filter: blur(0em);
160
+ transition: filter 0.5s;
161
+ max-width: 300px;
162
+ position: absolute;
163
+ top: 50%;
164
+ left: 50%;
165
+ transform: translate(-50%, -50%);
166
+ animation: fadeIn 5s;
167
+ -webkit-animation: fadeIn 5s;
168
+ -moz-animation: fadeIn 5s;
169
+ -o-animation: fadeIn 5s;
170
+ -ms-animation: fadeIn 5s;
171
+ }
172
+
173
+ :host * {
174
+ -webkit-user-select: none;
175
+ -moz-user-select: none;
176
+ -ms-user-select: none;
177
+ user-select: none;
178
+ -webkit-touch-callout: none;
179
+ /* prevent callout to copy image, etc when tap to hold */
180
+ -webkit-text-size-adjust: none;
181
+ /* prevent webkit from resizing text to fit */
182
+ -webkit-user-select: none;
183
+ /* prevent copy paste, to allow, change 'none' to 'text' */
184
+ }
185
+
186
+ /* FOCUS */
187
+ :host summary:focus,
188
+ :host a:focus,
189
+ :host button:focus {
190
+ outline: none;
191
+ }
192
+
193
+ .splashscreen,
194
+ .fullscreen-bg {
195
+ padding: 0;
196
+ margin: 0;
197
+ top: 0;
198
+ left: 0;
199
+ right: 0;
200
+ bottom: 0;
201
+ padding: 0;
202
+ background-attachment: fixed;
203
+ background-position: center;
204
+ background-clip: content-box;
205
+ background-size: cover;
206
+ position: absolute;
207
+ min-width: 100vw;
208
+ min-height: 100vh;
209
+ width: 100vw;
210
+ height: 100vh;
211
+ z-index: 0;
212
+ overflow: hidden;
213
+ }
214
+
215
+ .splashscreen .splashcontent {
216
+ top: 0;
217
+ left: 0;
218
+ right: 0;
219
+ bottom: 0;
220
+ margin: 0 auto;
221
+ width: 100vw;
222
+ height: 100vh;
223
+ padding: 0;
224
+ overflow: hidden;
225
+ z-index: 1;
226
+ }
227
+
228
+ .splashscreen .splashcontent p {
229
+ color: white;
230
+ }
231
+
232
+ video.fullscreen-bg__video {
233
+ top: 0;
234
+ left: 0;
235
+ bottom: 0;
236
+ right: 0;
237
+ margin: 0;
238
+ padding: 0;
239
+ position: absolute;
240
+ min-width: 100vw;
241
+ min-height: 100vh;
242
+ overflow: hidden;
243
+ z-index: 0;
244
+ object-fit: cover;
245
+ filter: brightness(0.3);
246
+ }
247
+ .splashscreen,
248
+ .fullscreen-bg {
249
+ background-image: url('{{background}}');
250
+ }
251
+
252
+ @keyframes fadeIn {
253
+ 0% {opacity:0;}
254
+ 100% {opacity:1;}
255
+ }
256
+
257
+ @-moz-keyframes fadeIn {
258
+ 0% {opacity:0;}
259
+ 100% {opacity:1;}
260
+ }
261
+
262
+ @-webkit-keyframes fadeIn {
263
+ 0% {opacity:0;}
264
+ 100% {opacity:1;}
265
+ }
266
+
267
+ @-o-keyframes fadeIn {
268
+ 0% {opacity:0;}
269
+ 100% {opacity:1;}
270
+ }
271
+
272
+ @-ms-keyframes fadeIn {
273
+ 0% {opacity:0;}
274
+ 100% {opacity:1;}
275
+ }
276
+
277
+ </style>
278
+ <div class="splashscreen">
279
+ <div class="fullscreen-bg splashcontent">
280
+ <video loop muted autoplay playsinline name="media" poster="{{background}}" class="fullscreen-bg__video" data-setup="{}" height="100%">
281
+ <source src="{{video_mp4}}" type="video/mp4">
282
+ <source src="{{video_ogg}}" type="video/ogg">
283
+ <source src="{{video_webm}}" type="video/webm">
284
+ </video>
285
+ <slot id="slot-logo" name="logo"></slot>
286
+ </div>
287
+ </div>
288
+
289
+ `;
290
+ }
291
+ },
292
+
293
+ class CubeSplashScreenComponent extends SplashScreenComponent {
294
+
295
+ constructor () {
296
+ super(...arguments);
297
+ this.name= "cubesplashscreen";
298
+ this.cached= false;
299
+ this.shadowed= true;
300
+ this.tplsource= "inline";
301
+ this.template= `
302
+ <style>
303
+ @keyframes spin {
304
+ 0% {
305
+ transform: translateZ(-100px) rotateX(0deg) rotateY(0deg) rotateZ(0deg);
306
+ }
307
+
308
+ 16% {
309
+ transform: translateZ(-100px) rotateX(180deg) rotateY(180deg) rotateZ(0deg);
310
+ }
311
+
312
+ 33% {
313
+ transform: translateZ(-100px) rotateX(360deg) rotateY(90deg) rotateZ(180deg);
314
+ }
315
+
316
+ 50% {
317
+ transform: translateZ(-100px) rotateX(360deg) rotateY(360deg) rotateZ(360deg);
318
+ }
319
+
320
+ 66% {
321
+ transform: translateZ(-100px) rotateX(180deg) rotateY(360deg) rotateZ(270deg);
322
+ }
323
+
324
+ 83% {
325
+ transform: translateZ(-100px) rotateX(270deg) rotateY(180deg) rotateZ(180deg);
326
+ }
327
+
328
+ 100% {
329
+ transform: translateZ(-100px) rotateX(360deg) rotateY(360deg) rotateZ(360deg);
330
+ }
331
+ }
332
+
333
+ @keyframes spin-duplicate {
334
+ 0% {
335
+ transform: translateZ(-100px) rotateX(0deg) rotateY(0deg) rotateZ(0deg);
336
+ }
337
+
338
+ 16% {
339
+ transform: translateZ(-100px) rotateX(180deg) rotateY(180deg) rotateZ(0deg);
340
+ }
341
+
342
+ 33% {
343
+ transform: translateZ(-100px) rotateX(360deg) rotateY(90deg) rotateZ(180deg);
344
+ }
345
+
346
+ 50% {
347
+ transform: translateZ(-100px) rotateX(360deg) rotateY(360deg) rotateZ(360deg);
348
+ }
349
+
350
+ 66% {
351
+ transform: translateZ(-100px) rotateX(180deg) rotateY(360deg) rotateZ(270deg);
352
+ }
353
+
354
+ 83% {
355
+ transform: translateZ(-100px) rotateX(270deg) rotateY(180deg) rotateZ(180deg);
356
+ }
357
+
358
+ 100% {
359
+ transform: translateZ(-100px) rotateX(360deg) rotateY(360deg) rotateZ(360deg);
360
+ }
361
+ }
362
+
363
+ @keyframes roll {
364
+ 0% {
365
+ transform: translate3d(-200px, -50px, -400px)
366
+ }
367
+
368
+ 12% {
369
+ transform: translate3d(0px, 0, -100px)
370
+ }
371
+
372
+ 25% {
373
+ transform: translate3d(200px, -50px, -400px)
374
+ }
375
+
376
+ 37% {
377
+ transform: translate3d(0px, -100px, -800px)
378
+ }
379
+
380
+ 50% {
381
+ transform: translate3d(-200px, -50px, -400px)
382
+ }
383
+
384
+ 62% {
385
+ transform: translate3d(0px, 0, -100px)
386
+ }
387
+
388
+ 75% {
389
+ transform: translate3d(200px, -50px, -400px)
390
+ }
391
+
392
+ 87% {
393
+ transform: translate3d(0px, -100px, -800px)
394
+ }
395
+
396
+ 100% {
397
+ transform: translate3d(-200px, -50px, -400px)
398
+ }
399
+ }
400
+
401
+ #wrapper {
402
+ position: relative;
403
+ width: 200px;
404
+ padding-top: 100px;
405
+ margin: 0 auto;
406
+ perspective: 1200px;
407
+ }
408
+
409
+ #platform {
410
+ margin-top: 100px;
411
+ }
412
+
413
+ #dice span {
414
+ position: absolute;
415
+ margin: 100px 0 0 100px;
416
+ display: block;
417
+ font-size: 2.5em;
418
+ padding: 10px;
419
+ }
420
+
421
+ #dice {
422
+ position: absolute;
423
+ width: 200px;
424
+ height: 200px;
425
+ transform-style: preserve-3d;
426
+ animation: spin 50s infinite linear;
427
+ }
428
+
429
+ .side {
430
+ position: absolute;
431
+ width: 200px;
432
+ height: 200px;
433
+ background: none;
434
+ box-shadow: inset 0 0 40px #fff0;
435
+ border-radius: 40px;
436
+ }
437
+
438
+ #dice .cover, #dice .inner {
439
+ background: #e0e0e0;
440
+ box-shadow: none;
441
+ }
442
+
443
+ #dice .cover {
444
+ border-radius: 0;
445
+ transform-origin: center;
446
+ transform: translateZ(0px);
447
+ }
448
+
449
+ #dice .cover.x {
450
+ transform-origin: center;
451
+ transform: rotateY(90deg);
452
+ }
453
+
454
+ #dice .cover.z {
455
+ transform-origin: center;
456
+ transform: rotateX(90deg);
457
+ }
458
+
459
+ #dice .front {
460
+ transform-origin: center;
461
+ transform: translateZ(100px);
462
+ }
463
+
464
+ #dice .front.inner {
465
+ transform-origin: center;
466
+ transform: translateZ(98px);
467
+ }
468
+
469
+ #dice .back {
470
+ transform-origin: center;
471
+ transform: rotateX(-180deg) translateZ(100px);
472
+ }
473
+
474
+ #dice .back.inner {
475
+ transform-origin: center;
476
+ transform: rotateX(-180deg) translateZ(98px);
477
+ }
478
+
479
+ #dice .right {
480
+ transform-origin: center;
481
+ transform: rotateY(90deg) translateZ(100px);
482
+ }
483
+
484
+ #dice .right.inner {
485
+ transform-origin: center;
486
+ transform: rotateY(90deg) translateZ(98px);
487
+ }
488
+
489
+ #dice .left {
490
+ transform-origin: center;
491
+ transform: rotateY(-90deg) translateZ(100px);
492
+ }
493
+
494
+ #dice .left.inner {
495
+ transform-origin: center;
496
+ transform: rotateY(-90deg) translateZ(98px);
497
+ }
498
+
499
+ #dice .top {
500
+ transform-origin: center;
501
+ transform: rotateX(90deg) translateZ(100px);
502
+ }
503
+
504
+ #dice .top.inner {
505
+ transform-origin: center;
506
+ transform: rotateX(90deg) translateZ(98px);
507
+ }
508
+
509
+ #dice .bottom {
510
+ transform-origin: center;
511
+ transform: rotateX(-90deg) translateZ(100px);
512
+ }
513
+
514
+ #dice .bottom.inner {
515
+ transform-origin: center;
516
+ transform: rotateX(-90deg) translateZ(98px);
517
+ }
518
+
519
+ .dot {
520
+ position: absolute;
521
+ width: 46px;
522
+ height: 46px;
523
+ border-radius: 23px;
524
+ background: #444;
525
+ box-shadow: inset 5px 0 10px #000;
526
+ }
527
+
528
+ .dot.center {
529
+ margin: 77px 0 0 77px;
530
+ }
531
+
532
+ .dot.dtop {
533
+ margin-top: 20px;
534
+ }
535
+
536
+ .dot.dleft {
537
+ margin-left: 134px;
538
+ }
539
+
540
+ .dot.dright {
541
+ margin-left: 20px;
542
+ }
543
+
544
+ .dot.dbottom {
545
+ margin-top: 134px;
546
+ }
547
+
548
+ .dot.center.dleft {
549
+ margin: 77px 0 0 20px;
550
+ }
551
+
552
+ .dot.center.dright {
553
+ margin: 77px 0 0 134px;
554
+ }
555
+
556
+ #background {
557
+ top: 0px;
558
+ left: 0px;
559
+ position: fixed;
560
+ z-index: -1;
561
+ width: 100%;
562
+ height: 100%;
563
+ background: var(--root-background, transparent);
564
+ background-size: cover;
565
+ background-origin: border-box;
566
+ }
567
+
568
+ #dice .side.front,
569
+ #dice .side.top,
570
+ #dice .side.right,
571
+ #dice .side.left,
572
+ #dice .side.bottom,
573
+ #dice .side.back {
574
+ background-image: var(--background-3d-cube-image, "none");
575
+ background-size: cover;
576
+ background-origin: border-box;
577
+ }
578
+
579
+
580
+ :root, :host {
581
+ --background-3d-cube-image: url('{{cube_image}}');
582
+ --box-width: 200px;
583
+ font-size:.9em;
584
+ font-family:sans-serif;
585
+ --root-background: {{background}};
586
+ }
587
+ </style>
588
+
589
+ <div id="background"></div>
590
+ <div id="wrapper">
591
+ <div id="platform">
592
+ <div id="dice">
593
+ <div class="side front">
594
+ </div>
595
+ <div class="side front inner"></div>
596
+ <div class="side top"></div>
597
+ <div class="side top inner"></div>
598
+ <div class="side right"></div>
599
+ <div class="side right inner"></div>
600
+ <div class="side left"></div>
601
+ <div class="side left inner"></div>
602
+ <div class="side bottom"></div>
603
+ <div class="side bottom inner"></div>
604
+ <div class="side back"></div>
605
+ <div class="side back inner"></div>
606
+ <div class="side cover x"></div>
607
+ <div class="side cover y"></div>
608
+ <div class="side cover z"></div>
609
+ </div>
610
+ </div>
611
+ </div>
612
+
613
+ `;
614
+
615
+ }
616
+
617
+ }
618
+
619
+ ]);
620
+
621
+
622
+ }).call(null);