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.
- package/.github/workflows/npmpublish.yml +47 -0
- package/README.md +0 -1
- package/VERSION +1 -1
- package/build/index.js +137 -25
- package/build/ts/org.qcobjects.base.components.js +75 -0
- package/build/ts/org.qcobjects.cloud.auth.session.data.js +122 -0
- package/build/ts/org.qcobjects.cloud.auth.session.usertoken.js +97 -0
- package/build/ts/org.qcobjects.components.grid.js +63 -0
- package/build/ts/org.qcobjects.components.js +200 -0
- package/build/{js/org.qcobjects.modal.effects.js → ts/org.qcobjects.components.list.js} +40 -29
- package/build/ts/org.qcobjects.components.notifications.js +180 -0
- package/build/ts/org.qcobjects.components.slider.js +207 -0
- package/build/{js → ts}/org.qcobjects.components.splashscreen.js +123 -130
- package/build/ts/org.qcobjects.controllers.form.js +180 -0
- package/build/ts/org.qcobjects.controllers.grid.js +269 -0
- package/build/{js → ts}/org.qcobjects.controllers.js +11 -11
- package/build/ts/org.qcobjects.controllers.list.js +235 -0
- package/build/ts/org.qcobjects.controllers.slider.js +126 -0
- package/build/ts/org.qcobjects.controllers.swagger.js +75 -0
- package/build/ts/org.qcobjects.effects.base.js +70 -0
- package/build/ts/org.qcobjects.effects.extended.js +270 -0
- package/build/ts/org.qcobjects.effects.js +49 -0
- package/build/ts/org.qcobjects.i18n_messages.js +59 -0
- package/build/{js → ts}/org.qcobjects.modal.controllers.js +16 -15
- package/build/ts/org.qcobjects.modal.effects.js +46 -0
- package/build/{js → ts}/org.qcobjects.models.js +11 -11
- package/{src/js/org.qcobjects.tools.canvas.ts → build/ts/org.qcobjects.tools.canvas.js} +16 -21
- package/build/{js → ts}/org.qcobjects.tools.js +10 -3
- package/build/ts/org.qcobjects.tools.layouts.js +74 -0
- package/build/{js → ts}/org.qcobjects.views.js +11 -11
- package/build-esbuild.js +72 -0
- package/eslint.config.mjs +88 -0
- package/package.json +67 -63
- package/postbuild.js +10 -0
- package/public/browser/index.js +9829 -0
- package/public/browser/index.js.map +7 -0
- package/public/cjs/index.cjs +9879 -0
- package/public/cjs/index.cjs.map +7 -0
- package/public/esm/index.mjs +9819 -0
- package/public/esm/index.mjs.map +7 -0
- package/public/types/index.d.ts +614 -0
- package/spec/helpers/mock-sdk.helper.ts +2 -0
- package/spec/mocks/qcobjects-sdk.mock.ts +1 -0
- package/spec/support/jasmine.json +7 -4
- package/src/index.ts +127 -2
- package/src/ts/org.qcobjects.base.components.ts +83 -0
- package/src/ts/org.qcobjects.cloud.auth.session.data.ts +134 -0
- package/src/ts/org.qcobjects.cloud.auth.session.usertoken.ts +108 -0
- package/src/ts/org.qcobjects.components.grid.ts +68 -0
- package/src/{js → ts}/org.qcobjects.components.list.ts +15 -31
- package/src/{js → ts}/org.qcobjects.components.notifications.ts +12 -12
- package/src/ts/org.qcobjects.components.slider.ts +216 -0
- package/src/{js → ts}/org.qcobjects.components.splashscreen.ts +31 -39
- package/src/ts/org.qcobjects.components.ts +226 -0
- package/src/ts/org.qcobjects.controllers.form.ts +209 -0
- package/src/ts/org.qcobjects.controllers.grid.ts +291 -0
- package/src/ts/org.qcobjects.controllers.list.ts +256 -0
- package/src/ts/org.qcobjects.controllers.slider.ts +153 -0
- package/src/ts/org.qcobjects.controllers.swagger.ts +83 -0
- package/src/{js → ts}/org.qcobjects.controllers.ts +7 -9
- package/src/ts/org.qcobjects.effects.base.ts +81 -0
- package/src/{js/org.qcobjects.effects.ts → ts/org.qcobjects.effects.extended.ts} +70 -198
- package/src/ts/org.qcobjects.effects.ts +42 -0
- package/src/ts/org.qcobjects.i18n_messages.ts +68 -0
- package/src/{js → ts}/org.qcobjects.modal.controllers.ts +12 -14
- package/src/{js → ts}/org.qcobjects.modal.effects.ts +22 -18
- package/src/{js → ts}/org.qcobjects.models.ts +8 -11
- package/src/ts/org.qcobjects.tools.canvas.ts +57 -0
- package/src/ts/org.qcobjects.tools.layouts.ts +82 -0
- package/src/{js → ts}/org.qcobjects.tools.ts +7 -1
- package/src/{js → ts}/org.qcobjects.views.ts +9 -8
- package/src/types/global/index.d.ts +181 -0
- package/transpile.js +65 -0
- package/tsconfig.d.json +65 -3
- package/tsconfig.jasmine.json +64 -0
- package/tsconfig.json +71 -7
- package/.eslintignore +0 -4
- package/.eslintrc.cjs +0 -6
- package/.github/workflows/npmpublish-beta.yml +0 -38
- package/.github/workflows/npmpublish-lts.yml +0 -38
- package/.github/workflows/npmpublish-main.yml +0 -40
- package/.gitmodules +0 -4
- package/build/QCObjects-SDK.js +0 -97
- package/build/css/base-modal.css +0 -43
- package/build/css/basic-layout-embedded-nav.css +0 -14
- package/build/css/basic-layout.css +0 -76
- package/build/css/components/horizontal-list.css +0 -64
- package/build/css/components/list.css +0 -57
- package/build/css/components/splashscreen.css +0 -111
- package/build/css/modal.css +0 -46
- package/build/index.cjs +0 -4
- package/build/index.mjs +0 -2
- package/build/js/org.qcobjects.cloud.auth.session.data.js +0 -125
- package/build/js/org.qcobjects.cloud.auth.session.usertoken.js +0 -109
- package/build/js/org.qcobjects.components.grid.js +0 -81
- package/build/js/org.qcobjects.components.js +0 -292
- package/build/js/org.qcobjects.components.list.js +0 -71
- package/build/js/org.qcobjects.components.notifications.js +0 -179
- package/build/js/org.qcobjects.components.slider.js +0 -193
- package/build/js/org.qcobjects.controllers.form.js +0 -178
- package/build/js/org.qcobjects.controllers.grid.js +0 -258
- package/build/js/org.qcobjects.controllers.list.js +0 -228
- package/build/js/org.qcobjects.controllers.slider.js +0 -131
- package/build/js/org.qcobjects.controllers.swagger.js +0 -50
- package/build/js/org.qcobjects.effects.js +0 -417
- package/build/js/org.qcobjects.i18n_messages.js +0 -72
- package/build/js/org.qcobjects.tools.canvas.js +0 -53
- package/build/js/org.qcobjects.tools.layouts.js +0 -73
- package/build/templates/components/modalyoulose.tpl.html +0 -3
- package/build/templates/components/modalyouwin.tpl.html +0 -4
- package/build/templates/components/splashscreen.tpl.html +0 -128
- package/build/templates/components/swagger-ui.tpl.html +0 -22
- package/docs/CNAME +0 -1
- package/public/QCObjects-SDK.js +0 -696
- package/public/QCObjects-SDK.js.map +0 -7
- package/public/css/base-modal.css +0 -2
- package/public/css/base-modal.css.map +0 -7
- package/public/css/basic-layout-embedded-nav.css +0 -2
- package/public/css/basic-layout-embedded-nav.css.map +0 -7
- package/public/css/basic-layout.css +0 -2
- package/public/css/basic-layout.css.map +0 -7
- package/public/css/components/horizontal-list.css +0 -2
- package/public/css/components/horizontal-list.css.map +0 -7
- package/public/css/components/list.css +0 -2
- package/public/css/components/list.css.map +0 -7
- package/public/css/components/splashscreen.css +0 -2
- package/public/css/components/splashscreen.css.map +0 -7
- package/public/css/modal.css +0 -2
- package/public/css/modal.css.map +0 -7
- package/public/index.cjs +0 -4
- package/public/index.js +0 -27
- package/public/index.mjs +0 -2
- package/public/templates/components/modalyoulose.tpl.html +0 -3
- package/public/templates/components/modalyouwin.tpl.html +0 -4
- package/public/templates/components/splashscreen.tpl.html +0 -128
- package/public/templates/components/swagger-ui.tpl.html +0 -22
- package/src/QCObjects-SDK.d.ts +0 -26
- package/src/QCObjects-SDK.ts +0 -108
- package/src/index.cts +0 -2
- package/src/index.d.ts +0 -2
- package/src/index.mts +0 -2
- package/src/js/org.qcobjects.cloud.auth.session.data.d.ts +0 -1
- package/src/js/org.qcobjects.cloud.auth.session.data.ts +0 -135
- package/src/js/org.qcobjects.cloud.auth.session.usertoken.d.ts +0 -2
- package/src/js/org.qcobjects.cloud.auth.session.usertoken.ts +0 -128
- package/src/js/org.qcobjects.components.d.ts +0 -10
- package/src/js/org.qcobjects.components.grid.d.ts +0 -3
- package/src/js/org.qcobjects.components.grid.ts +0 -95
- package/src/js/org.qcobjects.components.list.d.ts +0 -3
- package/src/js/org.qcobjects.components.notifications.d.ts +0 -1
- package/src/js/org.qcobjects.components.slider.d.ts +0 -1
- package/src/js/org.qcobjects.components.slider.ts +0 -205
- package/src/js/org.qcobjects.components.splashscreen.d.ts +0 -28
- package/src/js/org.qcobjects.components.ts +0 -336
- package/src/js/org.qcobjects.controllers.d.ts +0 -1
- package/src/js/org.qcobjects.controllers.form.d.ts +0 -1
- package/src/js/org.qcobjects.controllers.form.ts +0 -206
- package/src/js/org.qcobjects.controllers.grid.d.ts +0 -1
- package/src/js/org.qcobjects.controllers.grid.ts +0 -287
- package/src/js/org.qcobjects.controllers.list.d.ts +0 -1
- package/src/js/org.qcobjects.controllers.list.ts +0 -254
- package/src/js/org.qcobjects.controllers.slider.d.ts +0 -1
- package/src/js/org.qcobjects.controllers.slider.ts +0 -158
- package/src/js/org.qcobjects.controllers.swagger.d.ts +0 -1
- package/src/js/org.qcobjects.controllers.swagger.ts +0 -83
- package/src/js/org.qcobjects.effects.d.ts +0 -20
- package/src/js/org.qcobjects.i18n_messages.d.ts +0 -1
- package/src/js/org.qcobjects.i18n_messages.ts +0 -82
- package/src/js/org.qcobjects.modal.controllers.d.ts +0 -1
- package/src/js/org.qcobjects.modal.effects.d.ts +0 -1
- package/src/js/org.qcobjects.models.d.ts +0 -1
- package/src/js/org.qcobjects.tools.canvas.d.ts +0 -1
- package/src/js/org.qcobjects.tools.d.ts +0 -1
- package/src/js/org.qcobjects.tools.layouts.d.ts +0 -1
- package/src/js/org.qcobjects.tools.layouts.ts +0 -85
- package/src/js/org.qcobjects.views.d.ts +0 -1
- /package/spec/{testsSpec.js → testsSpec.ts} +0 -0
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
|
-
* QCObjects SDK 2.
|
|
2
|
+
* QCObjects SDK 2.5.0
|
|
4
3
|
* ________________
|
|
5
4
|
*
|
|
6
5
|
* Author: Jean Machuca <correojean@gmail.com>
|
|
@@ -23,125 +22,120 @@
|
|
|
23
22
|
* Everyone is permitted to copy and distribute verbatim copies of this
|
|
24
23
|
* license document, but changing it is not allowed.
|
|
25
24
|
*/
|
|
25
|
+
"use strict";
|
|
26
26
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
27
|
exports.CubeSplashScreenComponent = exports.VideoSplashScreenComponent = exports.SplashScreenComponent = void 0;
|
|
28
28
|
const qcobjects_1 = require("qcobjects");
|
|
29
29
|
const org_qcobjects_effects_1 = require("./org.qcobjects.effects");
|
|
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
|
-
|
|
30
|
+
class SplashScreenComponent extends qcobjects_1.Component {
|
|
31
|
+
_enabled_;
|
|
32
|
+
_bgcolor;
|
|
33
|
+
cached = false;
|
|
34
|
+
shadowed = true;
|
|
35
|
+
body;
|
|
36
|
+
shadowRoot;
|
|
37
|
+
constructor(component) {
|
|
38
|
+
component.name = (typeof component.name === "undefined") ? ("splashscreen") : (component.name);
|
|
39
|
+
const isBrowser = typeof window !== "undefined" && typeof window.self !== "undefined" && window === window.self;
|
|
40
|
+
const isStartURL = (location.hash === ""
|
|
41
|
+
&& location.pathname === "/" && location.search === "")
|
|
42
|
+
|| qcobjects_1.CONFIG.get("routingWay", "pathname") === "hash" && qcobjects_1.CONFIG.get("start_url", "/") === location.hash
|
|
43
|
+
|| qcobjects_1.CONFIG.get("routingWay", "pathname") === "pathname" && qcobjects_1.CONFIG.get("start_url", "/") === location.pathname
|
|
44
|
+
|| qcobjects_1.CONFIG.get("routingWay", "pathname") === "search" && qcobjects_1.CONFIG.get("start_url", "/") === location.search;
|
|
45
|
+
const _enabled_ = isBrowser && isStartURL;
|
|
46
|
+
if (_enabled_) {
|
|
47
|
+
component.basePath = qcobjects_1.CONFIG.get("splashscreenBasePath", qcobjects_1.CONFIG.get("remoteSDKPath", ""));
|
|
48
|
+
if (typeof component.data === "undefined") {
|
|
49
|
+
component.data = {};
|
|
50
|
+
}
|
|
51
|
+
component.data.basePath = component.basePath;
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
if (typeof component !== "undefined" && typeof component.body !== "undefined") {
|
|
55
|
+
component.body.style.display = "none";
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
super(component);
|
|
59
|
+
this._bgcolor = "";
|
|
60
|
+
this._enabled_ = _enabled_;
|
|
61
|
+
if (this._enabled_) {
|
|
62
|
+
const displayEffectDuration = 1000;
|
|
63
|
+
let duration = this.body.getAttribute("duration");
|
|
64
|
+
if (duration === null) {
|
|
65
|
+
duration = displayEffectDuration;
|
|
58
66
|
}
|
|
59
67
|
else {
|
|
60
|
-
|
|
61
|
-
component.body.style.display = "none";
|
|
62
|
-
}
|
|
68
|
+
duration = parseInt(duration.toString());
|
|
63
69
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
setTimeout(() => {
|
|
81
|
-
if (!_helper_.executed) {
|
|
82
|
-
const _componentRoot = (this.shadowed) ? this.shadowRoot?.host : this.body;
|
|
83
|
-
if (typeof global.componentsStack !== "undefined") {
|
|
84
|
-
global.componentsStack.filter((c) => c.body.hasAttribute("splashscreen")).map((mainComponent) => {
|
|
85
|
-
qcobjects_1.logger.debug(`Splash Screen of Main Component: ${mainComponent.name}`);
|
|
86
|
-
mainComponent.splashScreenComponent = this;
|
|
87
|
-
const SplashScreenHandler = () => {
|
|
88
|
-
if (!SplashScreenHandler.executed) {
|
|
89
|
-
const component = mainComponent.splashScreenComponent;
|
|
90
|
-
const mainElement = (mainComponent.shadowed) ? mainComponent.shadowRoot?.host : mainComponent.body;
|
|
91
|
-
mainComponent._mainPosition = mainElement.style.position;
|
|
92
|
-
if (typeof mainElement !== "undefined") {
|
|
93
|
-
mainElement.style.position = "fixed";
|
|
94
|
-
}
|
|
95
|
-
mainComponent._mainOpacity = mainElement.style.opacity;
|
|
96
|
-
_componentRoot.style.width = "100%";
|
|
97
|
-
_componentRoot.style.height = "100%";
|
|
98
|
-
document.body.style.backgroundColor = "#111111";
|
|
99
|
-
mainElement.style.opacity = "0";
|
|
100
|
-
setTimeout(function () {
|
|
101
|
-
if (typeof _componentRoot !== "undefined") {
|
|
102
|
-
document.body.style.backgroundColor = component?._bgcolor;
|
|
103
|
-
_componentRoot.subelements("#slot-logo").map((slotlogo) => {
|
|
104
|
-
slotlogo.style.display = "block";
|
|
105
|
-
slotlogo.style.transformOrigin = "center";
|
|
106
|
-
return (new org_qcobjects_effects_1.Resize()).apply(slotlogo, 1, 0);
|
|
107
|
-
});
|
|
108
|
-
(new org_qcobjects_effects_1.Fade()).apply(_componentRoot, 1, 0);
|
|
109
|
-
}
|
|
110
|
-
}, (duration - displayEffectDuration));
|
|
111
|
-
setTimeout(function () {
|
|
112
|
-
(new org_qcobjects_effects_1.Fade()).apply(mainElement, 0, 1);
|
|
113
|
-
mainElement.style.position = mainComponent._mainPosition;
|
|
114
|
-
document.body.style.backgroundColor = component._bgcolor;
|
|
115
|
-
if (_componentRoot.parentElement !== null) {
|
|
116
|
-
_componentRoot.parentElement.remove();
|
|
117
|
-
}
|
|
118
|
-
}, duration);
|
|
70
|
+
this._bgcolor = this.body.style.backgroundColor;
|
|
71
|
+
const _helper_ = () => {
|
|
72
|
+
setTimeout(() => {
|
|
73
|
+
if (!_helper_.executed) {
|
|
74
|
+
const _componentRoot = (this.shadowed) ? this.shadowRoot?.host : this.body;
|
|
75
|
+
if (typeof qcobjects_1.global.componentsStack !== "undefined") {
|
|
76
|
+
qcobjects_1.global.componentsStack.filter((c) => c.body.hasAttribute("splashscreen")).map((mainComponent) => {
|
|
77
|
+
qcobjects_1.logger.debug(`Splash Screen of Main Component: ${mainComponent.name}`);
|
|
78
|
+
mainComponent.splashScreenComponent = this;
|
|
79
|
+
const SplashScreenHandler = () => {
|
|
80
|
+
if (!SplashScreenHandler.executed) {
|
|
81
|
+
const component = mainComponent.splashScreenComponent;
|
|
82
|
+
const mainElement = (mainComponent.shadowed) ? mainComponent.shadowRoot?.host : mainComponent.body;
|
|
83
|
+
mainComponent._mainPosition = mainElement.style.position;
|
|
84
|
+
if (typeof mainElement !== "undefined") {
|
|
85
|
+
mainElement.style.position = "fixed";
|
|
119
86
|
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
87
|
+
mainComponent._mainOpacity = mainElement.style.opacity;
|
|
88
|
+
_componentRoot.style.width = "100%";
|
|
89
|
+
_componentRoot.style.height = "100%";
|
|
90
|
+
document.body.style.backgroundColor = "#111111";
|
|
91
|
+
mainElement.style.opacity = "0";
|
|
92
|
+
setTimeout(function () {
|
|
93
|
+
if (typeof _componentRoot !== "undefined") {
|
|
94
|
+
document.body.style.backgroundColor = component?._bgcolor;
|
|
95
|
+
_componentRoot.subelements("#slot-logo").map((slotlogo) => {
|
|
96
|
+
slotlogo.style.display = "block";
|
|
97
|
+
slotlogo.style.transformOrigin = "center";
|
|
98
|
+
return (new org_qcobjects_effects_1.Resize()).apply(slotlogo, 1, 0);
|
|
99
|
+
});
|
|
100
|
+
(new org_qcobjects_effects_1.Fade()).apply(_componentRoot, 1, 0);
|
|
101
|
+
}
|
|
102
|
+
}, (duration - displayEffectDuration));
|
|
103
|
+
setTimeout(function () {
|
|
104
|
+
(new org_qcobjects_effects_1.Fade()).apply(mainElement, 0, 1);
|
|
105
|
+
mainElement.style.position = mainComponent._mainPosition;
|
|
106
|
+
document.body.style.backgroundColor = component._bgcolor;
|
|
107
|
+
if (_componentRoot.parentElement !== null) {
|
|
108
|
+
_componentRoot.parentElement.remove();
|
|
109
|
+
}
|
|
110
|
+
}, duration);
|
|
111
|
+
}
|
|
112
|
+
SplashScreenHandler.executed = true;
|
|
113
|
+
};
|
|
114
|
+
return mainComponent.addComponentHelper(SplashScreenHandler.bind(mainComponent));
|
|
115
|
+
});
|
|
126
116
|
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
117
|
+
_helper_.executed = true;
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
};
|
|
121
|
+
_helper_.executed = false;
|
|
122
|
+
this.addComponentHelper(_helper_.bind(component));
|
|
132
123
|
}
|
|
133
124
|
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
125
|
+
// eslint-disable-next-line no-unused-vars
|
|
126
|
+
addComponentHelper(arg0) {
|
|
127
|
+
throw new Error("Method not implemented.");
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
exports.SplashScreenComponent = SplashScreenComponent;
|
|
131
|
+
(0, qcobjects_1.Package)("org.qcobjects.components.base", [
|
|
132
|
+
SplashScreenComponent
|
|
133
|
+
]);
|
|
134
|
+
class VideoSplashScreenComponent extends SplashScreenComponent {
|
|
135
|
+
cached = false;
|
|
136
|
+
shadowed = true;
|
|
137
|
+
tplsource = "inline";
|
|
138
|
+
template = `
|
|
145
139
|
<style>
|
|
146
140
|
:host * {
|
|
147
141
|
box-sizing: border-box;
|
|
@@ -305,16 +299,17 @@ const _top = (typeof module === "object" && typeof module.exports === "object")
|
|
|
305
299
|
</div>
|
|
306
300
|
|
|
307
301
|
`;
|
|
308
|
-
|
|
302
|
+
constructor(o) {
|
|
303
|
+
o.name = "videosplashscreen";
|
|
304
|
+
super(o);
|
|
309
305
|
}
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
this.template = `
|
|
306
|
+
}
|
|
307
|
+
exports.VideoSplashScreenComponent = VideoSplashScreenComponent;
|
|
308
|
+
class CubeSplashScreenComponent extends SplashScreenComponent {
|
|
309
|
+
cached = false;
|
|
310
|
+
shadowed = true;
|
|
311
|
+
tplsource = "inline";
|
|
312
|
+
template = `
|
|
318
313
|
<style>
|
|
319
314
|
@keyframes spin {
|
|
320
315
|
0% {
|
|
@@ -627,16 +622,14 @@ const _top = (typeof module === "object" && typeof module.exports === "object")
|
|
|
627
622
|
</div>
|
|
628
623
|
|
|
629
624
|
`;
|
|
630
|
-
|
|
625
|
+
constructor(o) {
|
|
626
|
+
o.name = "cubesplashscreen";
|
|
627
|
+
super(o);
|
|
631
628
|
}
|
|
632
|
-
|
|
633
|
-
VideoSplashScreenComponent,
|
|
634
|
-
CubeSplashScreenComponent
|
|
635
|
-
]);
|
|
636
|
-
})(_top);
|
|
637
|
-
const SplashScreenComponent = _top.SplashScreenComponent;
|
|
638
|
-
exports.SplashScreenComponent = SplashScreenComponent;
|
|
639
|
-
const VideoSplashScreenComponent = _top.VideoSplashScreenComponent;
|
|
640
|
-
exports.VideoSplashScreenComponent = VideoSplashScreenComponent;
|
|
641
|
-
const CubeSplashScreenComponent = _top.CubeSplashScreenComponent;
|
|
629
|
+
}
|
|
642
630
|
exports.CubeSplashScreenComponent = CubeSplashScreenComponent;
|
|
631
|
+
(0, qcobjects_1.Package)("org.qcobjects.components.splashscreen", [
|
|
632
|
+
SplashScreenComponent,
|
|
633
|
+
VideoSplashScreenComponent,
|
|
634
|
+
CubeSplashScreenComponent
|
|
635
|
+
]);
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* QCObjects SDK 2.5
|
|
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
|
+
"use strict";
|
|
26
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
+
exports.FormController = exports.FormValidations = void 0;
|
|
28
|
+
const qcobjects_1 = require("qcobjects");
|
|
29
|
+
const org_qcobjects_components_1 = require("./org.qcobjects.components");
|
|
30
|
+
class FormValidations extends qcobjects_1.Controller {
|
|
31
|
+
getDefault() {
|
|
32
|
+
return function (fieldName, dataValue, element) {
|
|
33
|
+
const _regex = {
|
|
34
|
+
name: "^[a-zA-Z]+(([',. -][a-zA-Z ])?[a-zA-Z]*)*$",
|
|
35
|
+
email: "^([A-Za-z0-9]+)@([A-Za-z0-9]+).([A-Za-z0-9]+)$"
|
|
36
|
+
};
|
|
37
|
+
const _pattern_ = (element.getAttribute("pattern") || _regex[fieldName]);
|
|
38
|
+
const pattern = new RegExp(_pattern_);
|
|
39
|
+
return pattern.test(dataValue);
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.FormValidations = FormValidations;
|
|
44
|
+
class FormController extends qcobjects_1.Controller {
|
|
45
|
+
validations = [];
|
|
46
|
+
formValidatorModal;
|
|
47
|
+
serviceClass = "";
|
|
48
|
+
formSettings = {
|
|
49
|
+
backRouting: "#",
|
|
50
|
+
loadingRouting: "#loading",
|
|
51
|
+
nextRouting: "#signupsuccessful"
|
|
52
|
+
};
|
|
53
|
+
component;
|
|
54
|
+
hasValidation(element) {
|
|
55
|
+
const fieldName = element.getAttribute("data-field");
|
|
56
|
+
let _hasValidation = false;
|
|
57
|
+
if (typeof this.validations !== "undefined"
|
|
58
|
+
&& Object.hasOwnProperty.call(this.validations, fieldName)) {
|
|
59
|
+
_hasValidation = true;
|
|
60
|
+
}
|
|
61
|
+
return _hasValidation;
|
|
62
|
+
}
|
|
63
|
+
isInvalid(element) {
|
|
64
|
+
let _isInvalid = false;
|
|
65
|
+
const fieldName = element.getAttribute("data-field");
|
|
66
|
+
const dataValue = this.component.data[fieldName];
|
|
67
|
+
const _execValidation = (fieldName, dataValue, element) => {
|
|
68
|
+
return (typeof this.validations !== "undefined"
|
|
69
|
+
&& Object.hasOwnProperty.call(this.validations, fieldName)
|
|
70
|
+
&& this.validations[fieldName].call(null, fieldName, dataValue, element));
|
|
71
|
+
};
|
|
72
|
+
if (typeof this.validations !== "undefined" && (!_execValidation(fieldName, dataValue, element))) {
|
|
73
|
+
_isInvalid = true;
|
|
74
|
+
}
|
|
75
|
+
return _isInvalid;
|
|
76
|
+
}
|
|
77
|
+
isValid(element) {
|
|
78
|
+
return !this.isInvalid(element);
|
|
79
|
+
}
|
|
80
|
+
save() {
|
|
81
|
+
if (this.serviceClass !== "") {
|
|
82
|
+
location.href = this.formSettings.loadingRouting;
|
|
83
|
+
(0, qcobjects_1.serviceLoader)((0, qcobjects_1.New)((0, qcobjects_1.ClassFactory)(this.serviceClass), {
|
|
84
|
+
data: this.component.data
|
|
85
|
+
}), false).then(() => {
|
|
86
|
+
// This will show the service response as a plain text
|
|
87
|
+
console.log("DONE SERVICE COMPONENT");
|
|
88
|
+
location.href = this.formSettings.nextRouting;
|
|
89
|
+
}, (failedResponse) => {
|
|
90
|
+
qcobjects_1.logger.debug(failedResponse);
|
|
91
|
+
location.href = this.formSettings.backRouting;
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
qcobjects_1.logger.debug("No service name declared on serviceClass property");
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
formSaveTouchHandler() {
|
|
99
|
+
qcobjects_1.logger.debug("Saving data...");
|
|
100
|
+
const _componentRoot_ = (this.component.shadowed) ? ((this.component?.shadowRoot).host) : (this.component.body);
|
|
101
|
+
(this.component).executeBindings();
|
|
102
|
+
if (this.formValidatorModal != null) {
|
|
103
|
+
const componentElementFields = _componentRoot_.subelements("*[data-field]");
|
|
104
|
+
const fieldsToValidate = componentElementFields.filter((f) => this.hasValidation(f));
|
|
105
|
+
const _labelledby = function (parentElement, element) {
|
|
106
|
+
const _arialabelledby = (parentElement, element) => {
|
|
107
|
+
return (element.getAttribute("aria-labelledby") !== null) ? ((element.getAttribute("aria-labelledby") || "").split(" ").map(e => parentElement.subelements(`#${e}`).map((_e) => _e.innerHTML)).join(" ")) : (null);
|
|
108
|
+
};
|
|
109
|
+
return (_arialabelledby(parentElement, element)
|
|
110
|
+
|| element.getAttribute("aria-label")
|
|
111
|
+
|| element.getAttribute("placeholder")
|
|
112
|
+
|| element.getAttribute("name")
|
|
113
|
+
|| element.getAttribute("data-field"));
|
|
114
|
+
};
|
|
115
|
+
const _ariatitle = function (element) {
|
|
116
|
+
return (element.getAttribute("title") || element.getAttribute("aria-title") || "");
|
|
117
|
+
};
|
|
118
|
+
const invalidFields = fieldsToValidate.filter((f) => this.isInvalid(f));
|
|
119
|
+
if (invalidFields.length > 0) {
|
|
120
|
+
const validationMessage = `
|
|
121
|
+
<details>
|
|
122
|
+
<summary>Please verify the following incorrect fields:</summary>
|
|
123
|
+
<ul>
|
|
124
|
+
<div>
|
|
125
|
+
${invalidFields.map((element) => "<li><div>" + _labelledby(_componentRoot_, element) + "</div><div>" + _ariatitle(element) + "</div></li>").join("")}
|
|
126
|
+
</div>
|
|
127
|
+
</ul>
|
|
128
|
+
</details>
|
|
129
|
+
`;
|
|
130
|
+
this.formValidatorModal.body.subelements(".validationMessage")[0].innerHTML = validationMessage;
|
|
131
|
+
this.formValidatorModal.modal();
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
this.save();
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
else {
|
|
138
|
+
qcobjects_1.logger.debug("Unable to find the modal validator...");
|
|
139
|
+
qcobjects_1.logger.debug("Saving data...");
|
|
140
|
+
this.save();
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
constructor(o) {
|
|
144
|
+
super(o);
|
|
145
|
+
this.component = o.component;
|
|
146
|
+
this.component = this.component.Cast(org_qcobjects_components_1.FormField);
|
|
147
|
+
}
|
|
148
|
+
done() {
|
|
149
|
+
qcobjects_1.logger.debugEnabled = true;
|
|
150
|
+
try {
|
|
151
|
+
(this.component).createBindingEvents();
|
|
152
|
+
const modalBody = (0, qcobjects_1._DOMCreateElement)("div");
|
|
153
|
+
modalBody.className = "modal_body";
|
|
154
|
+
this.formValidatorModal = (0, qcobjects_1.New)(org_qcobjects_components_1.ModalComponent, {
|
|
155
|
+
body: modalBody,
|
|
156
|
+
subcomponents: [],
|
|
157
|
+
data: {
|
|
158
|
+
content: "<div class=\"validationMessage\"></div>"
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
(0, qcobjects_1.Tag)(".modal_body").map((e) => document.body.removeChild(e));
|
|
162
|
+
document.body.append(this.formValidatorModal.body);
|
|
163
|
+
}
|
|
164
|
+
catch (e) {
|
|
165
|
+
qcobjects_1.logger.debug(`Unable to create the modal: ${e}`);
|
|
166
|
+
}
|
|
167
|
+
this.onpress(".submit", () => {
|
|
168
|
+
this.formSaveTouchHandler();
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
// eslint-disable-next-line no-unused-vars
|
|
172
|
+
onpress(arg0, arg1) {
|
|
173
|
+
throw new Error("Method not implemented.");
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
exports.FormController = FormController;
|
|
177
|
+
(0, qcobjects_1.Package)("org.qcobjects.controllers.form", [
|
|
178
|
+
FormController,
|
|
179
|
+
FormValidations
|
|
180
|
+
]);
|