qcobjects-sdk 2.4.66 → 2.5.105

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 (177) hide show
  1. package/.github/workflows/npmpublish.yml +47 -0
  2. package/README.md +0 -1
  3. package/VERSION +1 -1
  4. package/build/index.js +137 -25
  5. package/build/ts/org.qcobjects.base.components.js +75 -0
  6. package/build/ts/org.qcobjects.cloud.auth.session.data.js +122 -0
  7. package/build/ts/org.qcobjects.cloud.auth.session.usertoken.js +97 -0
  8. package/build/ts/org.qcobjects.components.grid.js +63 -0
  9. package/build/ts/org.qcobjects.components.js +200 -0
  10. package/build/{js/org.qcobjects.modal.effects.js → ts/org.qcobjects.components.list.js} +40 -29
  11. package/build/ts/org.qcobjects.components.notifications.js +180 -0
  12. package/build/ts/org.qcobjects.components.slider.js +207 -0
  13. package/build/{js → ts}/org.qcobjects.components.splashscreen.js +123 -130
  14. package/build/ts/org.qcobjects.controllers.form.js +180 -0
  15. package/build/ts/org.qcobjects.controllers.grid.js +269 -0
  16. package/build/{js → ts}/org.qcobjects.controllers.js +11 -11
  17. package/build/ts/org.qcobjects.controllers.list.js +235 -0
  18. package/build/ts/org.qcobjects.controllers.slider.js +126 -0
  19. package/build/ts/org.qcobjects.controllers.swagger.js +75 -0
  20. package/build/ts/org.qcobjects.effects.base.js +70 -0
  21. package/build/ts/org.qcobjects.effects.extended.js +270 -0
  22. package/build/ts/org.qcobjects.effects.js +49 -0
  23. package/build/ts/org.qcobjects.i18n_messages.js +59 -0
  24. package/build/{js → ts}/org.qcobjects.modal.controllers.js +16 -15
  25. package/build/ts/org.qcobjects.modal.effects.js +46 -0
  26. package/build/{js → ts}/org.qcobjects.models.js +11 -11
  27. package/{src/js/org.qcobjects.tools.canvas.ts → build/ts/org.qcobjects.tools.canvas.js} +16 -21
  28. package/build/{js → ts}/org.qcobjects.tools.js +10 -3
  29. package/build/ts/org.qcobjects.tools.layouts.js +74 -0
  30. package/build/{js → ts}/org.qcobjects.views.js +11 -11
  31. package/build-esbuild.js +72 -0
  32. package/eslint.config.mjs +88 -0
  33. package/package.json +67 -63
  34. package/postbuild.js +10 -0
  35. package/public/browser/index.js +9829 -0
  36. package/public/browser/index.js.map +7 -0
  37. package/public/cjs/index.cjs +9879 -0
  38. package/public/cjs/index.cjs.map +7 -0
  39. package/public/esm/index.mjs +9819 -0
  40. package/public/esm/index.mjs.map +7 -0
  41. package/public/types/index.d.ts +614 -0
  42. package/spec/helpers/mock-sdk.helper.ts +2 -0
  43. package/spec/mocks/qcobjects-sdk.mock.ts +1 -0
  44. package/spec/support/jasmine.json +7 -4
  45. package/src/index.ts +127 -2
  46. package/src/ts/org.qcobjects.base.components.ts +83 -0
  47. package/src/ts/org.qcobjects.cloud.auth.session.data.ts +134 -0
  48. package/src/ts/org.qcobjects.cloud.auth.session.usertoken.ts +108 -0
  49. package/src/ts/org.qcobjects.components.grid.ts +68 -0
  50. package/src/{js → ts}/org.qcobjects.components.list.ts +15 -31
  51. package/src/{js → ts}/org.qcobjects.components.notifications.ts +12 -12
  52. package/src/ts/org.qcobjects.components.slider.ts +216 -0
  53. package/src/{js → ts}/org.qcobjects.components.splashscreen.ts +31 -39
  54. package/src/ts/org.qcobjects.components.ts +226 -0
  55. package/src/ts/org.qcobjects.controllers.form.ts +209 -0
  56. package/src/ts/org.qcobjects.controllers.grid.ts +291 -0
  57. package/src/ts/org.qcobjects.controllers.list.ts +256 -0
  58. package/src/ts/org.qcobjects.controllers.slider.ts +153 -0
  59. package/src/ts/org.qcobjects.controllers.swagger.ts +83 -0
  60. package/src/{js → ts}/org.qcobjects.controllers.ts +7 -9
  61. package/src/ts/org.qcobjects.effects.base.ts +81 -0
  62. package/src/{js/org.qcobjects.effects.ts → ts/org.qcobjects.effects.extended.ts} +70 -198
  63. package/src/ts/org.qcobjects.effects.ts +42 -0
  64. package/src/ts/org.qcobjects.i18n_messages.ts +68 -0
  65. package/src/{js → ts}/org.qcobjects.modal.controllers.ts +12 -14
  66. package/src/{js → ts}/org.qcobjects.modal.effects.ts +22 -18
  67. package/src/{js → ts}/org.qcobjects.models.ts +8 -11
  68. package/src/ts/org.qcobjects.tools.canvas.ts +57 -0
  69. package/src/ts/org.qcobjects.tools.layouts.ts +82 -0
  70. package/src/{js → ts}/org.qcobjects.tools.ts +7 -1
  71. package/src/{js → ts}/org.qcobjects.views.ts +9 -8
  72. package/src/types/global/index.d.ts +181 -0
  73. package/transpile.js +65 -0
  74. package/tsconfig.d.json +65 -3
  75. package/tsconfig.jasmine.json +64 -0
  76. package/tsconfig.json +71 -7
  77. package/.eslintignore +0 -4
  78. package/.eslintrc.cjs +0 -6
  79. package/.github/workflows/npmpublish-beta.yml +0 -38
  80. package/.github/workflows/npmpublish-lts.yml +0 -38
  81. package/.github/workflows/npmpublish-main.yml +0 -40
  82. package/.gitmodules +0 -4
  83. package/build/QCObjects-SDK.js +0 -97
  84. package/build/css/base-modal.css +0 -43
  85. package/build/css/basic-layout-embedded-nav.css +0 -14
  86. package/build/css/basic-layout.css +0 -76
  87. package/build/css/components/horizontal-list.css +0 -64
  88. package/build/css/components/list.css +0 -57
  89. package/build/css/components/splashscreen.css +0 -111
  90. package/build/css/modal.css +0 -46
  91. package/build/index.cjs +0 -4
  92. package/build/index.mjs +0 -2
  93. package/build/js/org.qcobjects.cloud.auth.session.data.js +0 -125
  94. package/build/js/org.qcobjects.cloud.auth.session.usertoken.js +0 -109
  95. package/build/js/org.qcobjects.components.grid.js +0 -81
  96. package/build/js/org.qcobjects.components.js +0 -292
  97. package/build/js/org.qcobjects.components.list.js +0 -71
  98. package/build/js/org.qcobjects.components.notifications.js +0 -179
  99. package/build/js/org.qcobjects.components.slider.js +0 -193
  100. package/build/js/org.qcobjects.controllers.form.js +0 -178
  101. package/build/js/org.qcobjects.controllers.grid.js +0 -258
  102. package/build/js/org.qcobjects.controllers.list.js +0 -228
  103. package/build/js/org.qcobjects.controllers.slider.js +0 -131
  104. package/build/js/org.qcobjects.controllers.swagger.js +0 -50
  105. package/build/js/org.qcobjects.effects.js +0 -417
  106. package/build/js/org.qcobjects.i18n_messages.js +0 -72
  107. package/build/js/org.qcobjects.tools.canvas.js +0 -53
  108. package/build/js/org.qcobjects.tools.layouts.js +0 -73
  109. package/build/templates/components/modalyoulose.tpl.html +0 -3
  110. package/build/templates/components/modalyouwin.tpl.html +0 -4
  111. package/build/templates/components/splashscreen.tpl.html +0 -128
  112. package/build/templates/components/swagger-ui.tpl.html +0 -22
  113. package/docs/CNAME +0 -1
  114. package/public/QCObjects-SDK.js +0 -696
  115. package/public/QCObjects-SDK.js.map +0 -7
  116. package/public/css/base-modal.css +0 -2
  117. package/public/css/base-modal.css.map +0 -7
  118. package/public/css/basic-layout-embedded-nav.css +0 -2
  119. package/public/css/basic-layout-embedded-nav.css.map +0 -7
  120. package/public/css/basic-layout.css +0 -2
  121. package/public/css/basic-layout.css.map +0 -7
  122. package/public/css/components/horizontal-list.css +0 -2
  123. package/public/css/components/horizontal-list.css.map +0 -7
  124. package/public/css/components/list.css +0 -2
  125. package/public/css/components/list.css.map +0 -7
  126. package/public/css/components/splashscreen.css +0 -2
  127. package/public/css/components/splashscreen.css.map +0 -7
  128. package/public/css/modal.css +0 -2
  129. package/public/css/modal.css.map +0 -7
  130. package/public/index.cjs +0 -4
  131. package/public/index.js +0 -27
  132. package/public/index.mjs +0 -2
  133. package/public/templates/components/modalyoulose.tpl.html +0 -3
  134. package/public/templates/components/modalyouwin.tpl.html +0 -4
  135. package/public/templates/components/splashscreen.tpl.html +0 -128
  136. package/public/templates/components/swagger-ui.tpl.html +0 -22
  137. package/src/QCObjects-SDK.d.ts +0 -26
  138. package/src/QCObjects-SDK.ts +0 -108
  139. package/src/index.cts +0 -2
  140. package/src/index.d.ts +0 -2
  141. package/src/index.mts +0 -2
  142. package/src/js/org.qcobjects.cloud.auth.session.data.d.ts +0 -1
  143. package/src/js/org.qcobjects.cloud.auth.session.data.ts +0 -135
  144. package/src/js/org.qcobjects.cloud.auth.session.usertoken.d.ts +0 -2
  145. package/src/js/org.qcobjects.cloud.auth.session.usertoken.ts +0 -128
  146. package/src/js/org.qcobjects.components.d.ts +0 -10
  147. package/src/js/org.qcobjects.components.grid.d.ts +0 -3
  148. package/src/js/org.qcobjects.components.grid.ts +0 -95
  149. package/src/js/org.qcobjects.components.list.d.ts +0 -3
  150. package/src/js/org.qcobjects.components.notifications.d.ts +0 -1
  151. package/src/js/org.qcobjects.components.slider.d.ts +0 -1
  152. package/src/js/org.qcobjects.components.slider.ts +0 -205
  153. package/src/js/org.qcobjects.components.splashscreen.d.ts +0 -28
  154. package/src/js/org.qcobjects.components.ts +0 -336
  155. package/src/js/org.qcobjects.controllers.d.ts +0 -1
  156. package/src/js/org.qcobjects.controllers.form.d.ts +0 -1
  157. package/src/js/org.qcobjects.controllers.form.ts +0 -206
  158. package/src/js/org.qcobjects.controllers.grid.d.ts +0 -1
  159. package/src/js/org.qcobjects.controllers.grid.ts +0 -287
  160. package/src/js/org.qcobjects.controllers.list.d.ts +0 -1
  161. package/src/js/org.qcobjects.controllers.list.ts +0 -254
  162. package/src/js/org.qcobjects.controllers.slider.d.ts +0 -1
  163. package/src/js/org.qcobjects.controllers.slider.ts +0 -158
  164. package/src/js/org.qcobjects.controllers.swagger.d.ts +0 -1
  165. package/src/js/org.qcobjects.controllers.swagger.ts +0 -83
  166. package/src/js/org.qcobjects.effects.d.ts +0 -20
  167. package/src/js/org.qcobjects.i18n_messages.d.ts +0 -1
  168. package/src/js/org.qcobjects.i18n_messages.ts +0 -82
  169. package/src/js/org.qcobjects.modal.controllers.d.ts +0 -1
  170. package/src/js/org.qcobjects.modal.effects.d.ts +0 -1
  171. package/src/js/org.qcobjects.models.d.ts +0 -1
  172. package/src/js/org.qcobjects.tools.canvas.d.ts +0 -1
  173. package/src/js/org.qcobjects.tools.d.ts +0 -1
  174. package/src/js/org.qcobjects.tools.layouts.d.ts +0 -1
  175. package/src/js/org.qcobjects.tools.layouts.ts +0 -85
  176. package/src/js/org.qcobjects.views.d.ts +0 -1
  177. /package/spec/{testsSpec.js → testsSpec.ts} +0 -0
@@ -1,179 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const qcobjects_1 = require("qcobjects");
4
- const org_qcobjects_effects_1 = require("./org.qcobjects.effects");
5
- /**
6
- * QCObjects SDK 2.4
7
- * ________________
8
- *
9
- * Author: Jean Machuca <correojean@gmail.com>
10
- *
11
- * Cross Browser Javascript Framework for MVC Patterns
12
- * QuickCorp/QCObjects is licensed under the
13
- * GNU Lesser General Public License v3.0
14
- * [LICENSE] (https://github.com/QuickCorp/QCObjects/blob/master/LICENSE.txt)
15
- *
16
- * Permissions of this copyleft license are conditioned on making available
17
- * complete source code of licensed works and modifications under the same
18
- * license or the GNU GPLv3. Copyright and license notices must be preserved.
19
- * Contributors provide an express grant of patent rights. However, a larger
20
- * work using the licensed work through interfaces provided by the licensed
21
- * work may be distributed under different terms and without source code for
22
- * the larger work.
23
- *
24
- * Copyright (C) 2015 Jean Machuca,<correojean@gmail.com>
25
- *
26
- * Everyone is permitted to copy and distribute verbatim copies of this
27
- * license document, but changing it is not allowed.
28
- */
29
- (function () {
30
- "use strict";
31
- class NotificationComponent extends qcobjects_1.Component {
32
- constructor(o) {
33
- o.name = "notification";
34
- o.body = (0, qcobjects_1._DOMCreateElement)("div");
35
- super(o);
36
- this.cached = false;
37
- this.tplsource = "inline";
38
- this.shadowed = false;
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
- display(element) {
88
- const _display_ = function (element) {
89
- element.style.display = "block";
90
- const appearEffect = (0, qcobjects_1.New)(org_qcobjects_effects_1.Move, {
91
- duration: 900,
92
- apply(element) {
93
- (0, qcobjects_1._super_)("Fade", "apply").call(this, element, 0, 1);
94
- (0, qcobjects_1._super_)("Move", "apply").call(this, element, 0, -document.body.clientHeight, 0, 0);
95
- }
96
- });
97
- const disappearEffect = (0, qcobjects_1.New)(org_qcobjects_effects_1.Move, {
98
- duration: 650,
99
- apply(element) {
100
- (0, qcobjects_1._super_)("Fade", "apply").call(this, element, 1, 0);
101
- (0, qcobjects_1._super_)("Move", "apply").call(this, element, 0, 0, 0, -document.body.clientHeight);
102
- }
103
- });
104
- appearEffect.apply(element);
105
- setTimeout(function () {
106
- disappearEffect.apply(element);
107
- }, 2000);
108
- };
109
- element.subelements("div.notification_background").map(element => (0, qcobjects_1.New)(org_qcobjects_effects_1.Fade, { duration: 500 }).apply(element, 0, 1));
110
- element.subelements("div.notification").map(element => _display_(element));
111
- setTimeout(function () {
112
- element.remove();
113
- }, 2200);
114
- }
115
- static success(message) {
116
- const c = (0, qcobjects_1.New)(NotificationComponent, {
117
- name: "notification",
118
- shadowed: true,
119
- body: (0, qcobjects_1._DOMCreateElement)("div"),
120
- data: {
121
- kind: "success",
122
- title: "Success!",
123
- message: `${message}...`
124
- }
125
- });
126
- document.body.append(c);
127
- const _componentRoot = (c.shadowed) ? (c.shadowRoot.host) : (c.body);
128
- c.display(_componentRoot);
129
- }
130
- static danger(message) {
131
- const c = (0, qcobjects_1.New)(NotificationComponent, {
132
- name: "notification",
133
- shadowed: true,
134
- body: (0, qcobjects_1._DOMCreateElement)("div"),
135
- data: {
136
- kind: "danger",
137
- title: "Danger!",
138
- message: `${message}...`
139
- }
140
- });
141
- document.body.append(c);
142
- const _componentRoot = (c.shadowed) ? (c.shadowRoot.host) : (c.body);
143
- c.display(_componentRoot);
144
- }
145
- static info(message) {
146
- const c = (0, qcobjects_1.New)(NotificationComponent, {
147
- name: "notification",
148
- shadowed: true,
149
- body: (0, qcobjects_1._DOMCreateElement)("div"),
150
- data: {
151
- kind: "info",
152
- title: "Info!",
153
- message: `${message}...`
154
- }
155
- });
156
- document.body.append(c);
157
- const _componentRoot = (c.shadowed) ? (c.shadowRoot.host) : (c.body);
158
- c.display(_componentRoot);
159
- }
160
- static warning(message) {
161
- const c = (0, qcobjects_1.New)(NotificationComponent, {
162
- name: "notification",
163
- shadowed: true,
164
- body: (0, qcobjects_1._DOMCreateElement)("div"),
165
- data: {
166
- kind: "warning",
167
- title: "Warning!",
168
- message: `${message}...`
169
- }
170
- });
171
- document.body.append(c);
172
- const _componentRoot = (c.shadowed) ? (c.shadowRoot.host) : (c.body);
173
- c.display(_componentRoot);
174
- }
175
- }
176
- (0, qcobjects_1.Package)("org.quickcorp.components.notifications", [
177
- NotificationComponent
178
- ]);
179
- })();
@@ -1,193 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const qcobjects_1 = require("qcobjects");
4
- /**
5
- * QCObjects SDK 2.4
6
- * ________________
7
- *
8
- * Author: Jean Machuca <correojean@gmail.com>
9
- *
10
- * Cross Browser Javascript Framework for MVC Patterns
11
- * QuickCorp/QCObjects is licensed under the
12
- * GNU Lesser General Public License v3.0
13
- * [LICENSE] (https://github.com/QuickCorp/QCObjects/blob/master/LICENSE.txt)
14
- *
15
- * Permissions of this copyleft license are conditioned on making available
16
- * complete source code of licensed works and modifications under the same
17
- * license or the GNU GPLv3. Copyright and license notices must be preserved.
18
- * Contributors provide an express grant of patent rights. However, a larger
19
- * work using the licensed work through interfaces provided by the licensed
20
- * work may be distributed under different terms and without source code for
21
- * the larger work.
22
- *
23
- * Copyright (C) 2015 Jean Machuca,<correojean@gmail.com>
24
- *
25
- * Everyone is permitted to copy and distribute verbatim copies of this
26
- * license document, but changing it is not allowed.
27
- */
28
- (function () {
29
- "use strict";
30
- (0, qcobjects_1.Package)("org.qcobjects.components.slider", [
31
- class SlideListComponent extends qcobjects_1.Component {
32
- constructor(o) {
33
- super(o);
34
- this.tplsource = "inline";
35
- this.template = "<p>Loading...</p>";
36
- this.name = "slidelist";
37
- this.body.setAttribute("controllerClass", "DataGridController");
38
- const subcomponentClass = (this.body.getAttribute("subcomponentClass") !== null) ? (this.body.getAttribute("subcomponentClass")) : ("GridItemComponent");
39
- this.body.setAttribute("subcomponentClass", subcomponentClass);
40
- }
41
- },
42
- class SlideItemComponent extends qcobjects_1.Component {
43
- constructor(o) {
44
- super(o);
45
- this.effectClass = "Fade";
46
- this.name = "slider_item";
47
- this.data.slideNumber = this.data.__dataIndex + 1;
48
- this.template = `
49
- <div class="qcoSlides" style="display:none">
50
- <div class="qco-slider__numbertext">{{slideNumber}} / {{__dataLength}}</div>
51
- <img src="{{image}}" alt="{{title}}"/>
52
- <div class="qco-slider__text">
53
- <p>{{label}} <a href="{{link}}">{{category}}</a></p>
54
- </div>
55
- </div>
56
- `;
57
- this.tplsource = "inline";
58
- }
59
- },
60
- class SliderComponent extends qcobjects_1.Component {
61
- constructor(o) {
62
- super(o);
63
- this.name = "slider";
64
- this.template = `
65
- <style>
66
- /* Slideshow container */
67
-
68
- :host a:hover,
69
- :host a:active,
70
- :host a:visited {
71
- color: #ffffff;
72
- }
73
-
74
- {
75
- color: #ffffff;
76
- }
77
-
78
- :host .prev {left:0;}
79
- .qco-slider__container {
80
- max-width: 100%;
81
- position: relative;
82
- margin: auto;
83
- height: 300px;
84
- }
85
- :host .qco-slider__container .qcoSlides img {
86
- object-fit: cover;
87
- width: 100%;
88
- height: 300px;
89
- }
90
-
91
- /* Next & previous buttons */
92
- :host .prev,
93
- :host .next {
94
- cursor: pointer;
95
- position: absolute;
96
- top: 50%;
97
- width: auto;
98
- margin-top: -22px;
99
- padding: 16px;
100
- color: white;
101
- font-weight: bold;
102
- font-size: 18px;
103
- transition: 0.6s ease;
104
- border-radius: 0 3px 3px 0;
105
- background-color: rgba(1, 1, 1, 0.1);
106
- }
107
-
108
- /* Position the "next button" to the right */
109
- :host .next {
110
- right: 0;
111
- border-radius: 3px 0 0 3px;
112
- }
113
-
114
- /* On hover, add a black background color with a little bit see-through */
115
- :host .prev:hover,
116
- :host .next:hover {
117
- background-color: rgba(0, 0, 0, 0.8);
118
- }
119
-
120
- /* Caption text */
121
- :host .qco-slider__text {
122
- color: #f2f2f2;
123
- font-size: 15px;
124
- /* padding: 8px 12px;*/
125
- position: absolute;
126
- bottom: 8px;
127
- width: 100%;
128
- text-align: center;
129
- text-shadow: -1px 1px 3px #111111;
130
- background-color: rgba(1,1,1,0.7);
131
- }
132
-
133
- /* Number text (1/3 etc) */
134
- :host .qco-slider__numbertext {
135
- color: #f2f2f2;
136
- text-shadow: 0px 2px 3px #111111;
137
- font-size: 12px;
138
- padding: 8px 12px;
139
- position: absolute;
140
- top: 0;
141
- padding-top: 0;
142
- margin-top: 10px;
143
- }
144
-
145
- /* The dots/bullets/indicators */
146
- :host .qcoSlider__dots {
147
- text-align: center;
148
- margin: 0 auto;
149
- padding: 0;
150
- }
151
- :host .qcoSlider__dots--dot {
152
- cursor: pointer;
153
- height: 10px;
154
- width: 10px;
155
- margin: 0 2px;
156
- background-color: #bbb;
157
- border-radius: 50%;
158
- display: inline-block;
159
- transition: background-color 0.6s ease;
160
- }
161
-
162
- :host .active,
163
- :host .qcoSlider__dots--dot:hover {
164
- background-color: #717171;
165
- }
166
-
167
- :host .qco-slider__container .qcoSlides img {
168
- border-radius: 30px 30px 0px 0px;
169
- }
170
-
171
- </style>
172
-
173
- <div class="qco-slider__container">
174
- <component name="slidelist" componentClass="SlideListComponent" subcomponentClass="SlideItemComponent" serviceClass="{{SERVICE_CLASS}}" ></component>
175
-
176
- <a class="prev" onclick="global.get('{{sliderHandler}}').plusSlidesAndStop(-1)">&#10094;</a>
177
- <a class="next" onclick="global.get('{{sliderHandler}}').plusSlidesAndStop(1)">&#10095;</a>
178
- </div>
179
- <br>
180
-
181
- <div class="qcoSlider__dots" style="text-align:center">
182
- </div>
183
-
184
- `;
185
- this.tplsource = "inline";
186
- this.shadowed = true;
187
- this.data.SERVICE_CLASS = this.body.getAttribute("serviceClass");
188
- this.data.sliderHandler = "slider_" + this.__instanceID.toString();
189
- this.body.setAttribute("controllerClass", "SliderController");
190
- }
191
- }
192
- ]);
193
- })();
@@ -1,178 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const qcobjects_1 = require("qcobjects");
4
- const org_qcobjects_components_1 = require("./org.qcobjects.components");
5
- /**
6
- * QCObjects SDK 2.4
7
- * ________________
8
- *
9
- * Author: Jean Machuca <correojean@gmail.com>
10
- *
11
- * Cross Browser Javascript Framework for MVC Patterns
12
- * QuickCorp/QCObjects is licensed under the
13
- * GNU Lesser General Public License v3.0
14
- * [LICENSE] (https://github.com/QuickCorp/QCObjects/blob/master/LICENSE.txt)
15
- *
16
- * Permissions of this copyleft license are conditioned on making available
17
- * complete source code of licensed works and modifications under the same
18
- * license or the GNU GPLv3. Copyright and license notices must be preserved.
19
- * Contributors provide an express grant of patent rights. However, a larger
20
- * work using the licensed work through interfaces provided by the licensed
21
- * work may be distributed under different terms and without source code for
22
- * the larger work.
23
- *
24
- * Copyright (C) 2015 Jean Machuca,<correojean@gmail.com>
25
- *
26
- * Everyone is permitted to copy and distribute verbatim copies of this
27
- * license document, but changing it is not allowed.
28
- */
29
- (function () {
30
- "use strict";
31
- (0, qcobjects_1.Package)("org.qcobjects.controllers.form", [
32
- class FormValidations extends qcobjects_1.Controller {
33
- getDefault() {
34
- return function (fieldName, dataValue, element) {
35
- const _regex = {
36
- name: "^[a-zA-Z]+(([',. -][a-zA-Z ])?[a-zA-Z]*)*$",
37
- email: "^([A-Za-z0-9]+)@([A-Za-z0-9]+).([A-Za-z0-9]+)$"
38
- };
39
- const _pattern_ = (element.getAttribute("pattern") || _regex[fieldName]);
40
- const pattern = new RegExp(_pattern_);
41
- return pattern.test(dataValue);
42
- };
43
- }
44
- },
45
- class FormController extends qcobjects_1.Controller {
46
- hasValidation(element) {
47
- const fieldName = element.getAttribute("data-field");
48
- let _hasValidation = false;
49
- if (typeof this.validations !== "undefined"
50
- && Object.hasOwnProperty.call(this.validations, fieldName)) {
51
- _hasValidation = true;
52
- }
53
- return _hasValidation;
54
- }
55
- isInvalid(element) {
56
- let _isInvalid = false;
57
- const fieldName = element.getAttribute("data-field");
58
- const dataValue = this.component.data[fieldName];
59
- const _execValidation = (fieldName, dataValue, element) => {
60
- return (typeof this.validations !== "undefined"
61
- && Object.hasOwnProperty.call(this.validations, fieldName)
62
- && this.validations[fieldName].call(null, fieldName, dataValue, element));
63
- };
64
- if (typeof this.validations !== "undefined" && (!_execValidation(fieldName, dataValue, element))) {
65
- _isInvalid = true;
66
- }
67
- return _isInvalid;
68
- }
69
- isValid(element) {
70
- return !this.isInvalid(element);
71
- }
72
- save() {
73
- if (this.serviceClass !== "") {
74
- location.href = this.formSettings.loadingRouting;
75
- (0, qcobjects_1.serviceLoader)((0, qcobjects_1.New)((0, qcobjects_1.ClassFactory)(this.serviceClass), {
76
- data: this.component.data
77
- }), false).then((successfulResponse) => {
78
- // This will show the service response as a plain text
79
- console.log("DONE SERVICE COMPONENT");
80
- try {
81
- console.log(successfulResponse.service.JSONresponse);
82
- }
83
- catch (e) {
84
- // no json
85
- }
86
- location.href = this.formSettings.nextRouting;
87
- }, (failedResponse) => {
88
- qcobjects_1.logger.debug(failedResponse);
89
- location.href = this.formSettings.backRouting;
90
- });
91
- }
92
- else {
93
- qcobjects_1.logger.debug("No service name declared on serviceClass property");
94
- }
95
- }
96
- formSaveTouchHandler() {
97
- qcobjects_1.logger.debug("Saving data...");
98
- const _componentRoot_ = (this.component.shadowed) ? ((this.component?.shadowRoot).host) : (this.component.body);
99
- this.component.executeBindings();
100
- if (this.formValidatorModal != null) {
101
- const componentElementFields = _componentRoot_.subelements("*[data-field]");
102
- const fieldsToValidate = componentElementFields.filter(f => this.hasValidation(f));
103
- const _labelledby = function (parentElement, element) {
104
- const _arialabelledby = (parentElement, element) => {
105
- return (element.getAttribute("aria-labelledby") !== null) ? ((element.getAttribute("aria-labelledby") || "").split(" ").map(e => parentElement.subelements(`#${e}`).map(_e => _e.innerHTML)).join(" ")) : (null);
106
- };
107
- return (_arialabelledby(parentElement, element)
108
- || element.getAttribute("aria-label")
109
- || element.getAttribute("placeholder")
110
- || element.getAttribute("name")
111
- || element.getAttribute("data-field"));
112
- };
113
- const _ariatitle = function (element) {
114
- return (element.getAttribute("title") || element.getAttribute("aria-title") || "");
115
- };
116
- const invalidFields = fieldsToValidate.filter(f => this.isInvalid(f));
117
- if (invalidFields.length > 0) {
118
- const validationMessage = `
119
- <details>
120
- <summary>Please verify the following incorrect fields:</summary>
121
- <ul>
122
- <div>
123
- ${invalidFields.map(element => "<li><div>" + _labelledby(_componentRoot_, element) + "</div><div>" + _ariatitle(element) + "</div></li>").join("")}
124
- </div>
125
- </ul>
126
- </details>
127
- `;
128
- this.formValidatorModal.body.subelements(".validationMessage")[0].innerHTML = validationMessage;
129
- this.formValidatorModal.modal();
130
- }
131
- else {
132
- this.save();
133
- }
134
- }
135
- else {
136
- qcobjects_1.logger.debug("Unable to find the modal validator...");
137
- qcobjects_1.logger.debug("Saving data...");
138
- this.save();
139
- }
140
- }
141
- constructor(o) {
142
- super(o);
143
- this.validations = [];
144
- this.serviceClass = "";
145
- this.formSettings = {
146
- backRouting: "#",
147
- loadingRouting: "#loading",
148
- nextRouting: "#signupsuccessful"
149
- };
150
- this.component = o.component;
151
- this.component = this.component.Cast(org_qcobjects_components_1.FormField);
152
- }
153
- done() {
154
- qcobjects_1.logger.debugEnabled = true;
155
- try {
156
- this.component.createBindingEvents();
157
- const modalBody = (0, qcobjects_1._DOMCreateElement)("div");
158
- modalBody.className = "modal_body";
159
- this.formValidatorModal = (0, qcobjects_1.New)(org_qcobjects_components_1.ModalComponent, {
160
- body: modalBody,
161
- subcomponents: [],
162
- data: {
163
- content: "<div class=\"validationMessage\"></div>"
164
- }
165
- });
166
- (0, qcobjects_1.Tag)(".modal_body").map(e => document.body.removeChild(e));
167
- document.body.append(this.formValidatorModal);
168
- }
169
- catch (e) {
170
- qcobjects_1.logger.debug("Unable to create the modal");
171
- }
172
- this.onpress(".submit", () => {
173
- this.formSaveTouchHandler();
174
- });
175
- }
176
- }
177
- ]);
178
- })();