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
|
@@ -0,0 +1,200 @@
|
|
|
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.SwaggerUIComponent = exports.ModalComponent = exports.ModalEnclosureComponent = exports.EmailField = exports.TextField = exports.InputField = exports.ButtonField = exports.ShadowedComponent = exports.FormField = void 0;
|
|
28
|
+
const qcobjects_1 = require("qcobjects");
|
|
29
|
+
const org_qcobjects_effects_1 = require("./org.qcobjects.effects");
|
|
30
|
+
const org_qcobjects_base_components_1 = require("./org.qcobjects.base.components");
|
|
31
|
+
Object.defineProperty(exports, "FormField", { enumerable: true, get: function () { return org_qcobjects_base_components_1.FormField; } });
|
|
32
|
+
class ShadowedComponent extends qcobjects_1.Component {
|
|
33
|
+
container = null;
|
|
34
|
+
shadowed = true;
|
|
35
|
+
cached = false;
|
|
36
|
+
controller = null;
|
|
37
|
+
view = null;
|
|
38
|
+
data = {};
|
|
39
|
+
constructor(o) {
|
|
40
|
+
o.body = (0, qcobjects_1._DOMCreateElement)("div");
|
|
41
|
+
super(o);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.ShadowedComponent = ShadowedComponent;
|
|
45
|
+
class ButtonField extends org_qcobjects_base_components_1.FormField {
|
|
46
|
+
constructor(o) {
|
|
47
|
+
o.fieldType = "button";
|
|
48
|
+
super(o);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
exports.ButtonField = ButtonField;
|
|
52
|
+
class InputField extends org_qcobjects_base_components_1.FormField {
|
|
53
|
+
constructor(o) {
|
|
54
|
+
o.fieldType = "input";
|
|
55
|
+
super(o);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
exports.InputField = InputField;
|
|
59
|
+
class TextField extends org_qcobjects_base_components_1.FormField {
|
|
60
|
+
constructor(o) {
|
|
61
|
+
o.fieldType = "textarea";
|
|
62
|
+
super(o);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
exports.TextField = TextField;
|
|
66
|
+
class EmailField extends org_qcobjects_base_components_1.FormField {
|
|
67
|
+
constructor(o) {
|
|
68
|
+
o.fieldType = "input";
|
|
69
|
+
super(o);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
exports.EmailField = EmailField;
|
|
73
|
+
class ModalEnclosureComponent extends qcobjects_1.Component {
|
|
74
|
+
name = "modalenclosure";
|
|
75
|
+
tplsource = "inline";
|
|
76
|
+
cached = false;
|
|
77
|
+
basePath = qcobjects_1.CONFIG.get("modalBasePath", qcobjects_1.CONFIG.get("remoteSDKPath", ""));
|
|
78
|
+
template = `
|
|
79
|
+
<!-- The Modal -->
|
|
80
|
+
<style>
|
|
81
|
+
@import url('https://sdk.qcobjects.dev/css/modal.css');
|
|
82
|
+
</style>
|
|
83
|
+
<div id="modalInstance_{{modalId}}" class="modal">
|
|
84
|
+
|
|
85
|
+
<!-- Modal content -->
|
|
86
|
+
<div class="modal-content">
|
|
87
|
+
<span class="close">×</span>
|
|
88
|
+
{{content}}
|
|
89
|
+
</div>
|
|
90
|
+
|
|
91
|
+
</div>
|
|
92
|
+
`;
|
|
93
|
+
data = {};
|
|
94
|
+
constructor(o) {
|
|
95
|
+
o.body = (0, qcobjects_1._DOMCreateElement)("div");
|
|
96
|
+
super(o);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
exports.ModalEnclosureComponent = ModalEnclosureComponent;
|
|
100
|
+
class ModalComponent extends qcobjects_1.Component {
|
|
101
|
+
name = "modal";
|
|
102
|
+
cached = false;
|
|
103
|
+
modalEnclosureComponentClass = "ModalEnclosureComponent";
|
|
104
|
+
controller = null;
|
|
105
|
+
view = null;
|
|
106
|
+
tplsource = "none";
|
|
107
|
+
closeOnClickOutside = false;
|
|
108
|
+
data = {
|
|
109
|
+
content: "",
|
|
110
|
+
modalId: 0
|
|
111
|
+
};
|
|
112
|
+
submodal = null;
|
|
113
|
+
__instanceID;
|
|
114
|
+
basePath;
|
|
115
|
+
subcomponents;
|
|
116
|
+
body;
|
|
117
|
+
templateURI;
|
|
118
|
+
constructor(o) {
|
|
119
|
+
o.basePath = qcobjects_1.CONFIG.get("modalBasePath", qcobjects_1.CONFIG.get("remoteSDKPath", ""));
|
|
120
|
+
super(o);
|
|
121
|
+
this.data.modalId = this.__instanceID;
|
|
122
|
+
const submodal = (0, qcobjects_1.New)((0, qcobjects_1.ClassFactory)(this.modalEnclosureComponentClass), {
|
|
123
|
+
name: this.name,
|
|
124
|
+
basePath: this.basePath,
|
|
125
|
+
data: this.data
|
|
126
|
+
});
|
|
127
|
+
this.subcomponents.push(submodal);
|
|
128
|
+
this.submodal = submodal;
|
|
129
|
+
if (submodal.tplsource === "none") {
|
|
130
|
+
this.body.innerHTML = submodal.parsedAssignmentText;
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
this.body.append(submodal.body);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
modal() {
|
|
137
|
+
const modalId = this.data.modalId;
|
|
138
|
+
(0, qcobjects_1.Tag)("#modalInstance_" + modalId + ".modal").map((modal) => {
|
|
139
|
+
modal.style.display = "block";
|
|
140
|
+
return (new org_qcobjects_effects_1.ModalFade()).apply(modal, 0, 1);
|
|
141
|
+
});
|
|
142
|
+
(0, qcobjects_1.Tag)("#modalInstance_" + modalId + ".modal .modal-content").map((modalcontent) => {
|
|
143
|
+
return org_qcobjects_effects_1.ModalMoveDown.apply(modalcontent, 0, -document.body.clientHeight, 0, 0);
|
|
144
|
+
});
|
|
145
|
+
(0, qcobjects_1.Tag)("#modalInstance_" + modalId + ".modal .modal-content .close").map((closebtn) => {
|
|
146
|
+
return closebtn.addEventListener("click", () => {
|
|
147
|
+
this.close();
|
|
148
|
+
}, false);
|
|
149
|
+
});
|
|
150
|
+
if (this.closeOnClickOutside) {
|
|
151
|
+
window.addEventListener("click", () => {
|
|
152
|
+
this.close();
|
|
153
|
+
}, false);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
close() {
|
|
157
|
+
const modalId = this.data.modalId;
|
|
158
|
+
(0, qcobjects_1.Tag)("#modalInstance_" + modalId + ".modal").map((modal) => {
|
|
159
|
+
modal.style.display = "block";
|
|
160
|
+
return (new org_qcobjects_effects_1.ModalFade({ duration: 3000 })).apply(modal, 1, 0);
|
|
161
|
+
});
|
|
162
|
+
(0, qcobjects_1.Tag)("#modalInstance_" + modalId + ".modal .modal-content").map(function (modalcontent) {
|
|
163
|
+
return org_qcobjects_effects_1.ModalMoveUp.apply(modalcontent, 0, 0, 0, -document.body.clientHeight);
|
|
164
|
+
});
|
|
165
|
+
setTimeout(function () {
|
|
166
|
+
(0, qcobjects_1.Tag)("#modalInstance_" + modalId + ".modal").map((modal) => {
|
|
167
|
+
modal.style.display = "none";
|
|
168
|
+
return true;
|
|
169
|
+
});
|
|
170
|
+
}, 900);
|
|
171
|
+
}
|
|
172
|
+
rebuild() {
|
|
173
|
+
const _ret_ = super.rebuild();
|
|
174
|
+
this.templateURI = (0, qcobjects_1.ComponentURI)({
|
|
175
|
+
"COMPONENTS_BASE_PATH": qcobjects_1.CONFIG.get("componentsBasePath", ""),
|
|
176
|
+
"COMPONENT_NAME": "modal",
|
|
177
|
+
"TPLEXTENSION": qcobjects_1.CONFIG.get("tplextension", ""),
|
|
178
|
+
"TPL_SOURCE": "default" // here is always default in order to get the right uri
|
|
179
|
+
});
|
|
180
|
+
return _ret_; // parent call
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
exports.ModalComponent = ModalComponent;
|
|
184
|
+
class SwaggerUIComponent extends qcobjects_1.Component {
|
|
185
|
+
cached = false;
|
|
186
|
+
basePath = qcobjects_1.CONFIG.get("remoteSDKPath", "");
|
|
187
|
+
tplextension = "tpl.html";
|
|
188
|
+
name = "swagger-ui";
|
|
189
|
+
}
|
|
190
|
+
exports.SwaggerUIComponent = SwaggerUIComponent;
|
|
191
|
+
(0, qcobjects_1.Package)("org.qcobjects.form.components", [
|
|
192
|
+
ShadowedComponent,
|
|
193
|
+
ButtonField,
|
|
194
|
+
InputField,
|
|
195
|
+
TextField,
|
|
196
|
+
EmailField,
|
|
197
|
+
ModalEnclosureComponent,
|
|
198
|
+
ModalComponent,
|
|
199
|
+
SwaggerUIComponent
|
|
200
|
+
]);
|
|
@@ -1,9 +1,5 @@
|
|
|
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
1
|
/**
|
|
6
|
-
* QCObjects SDK 2.
|
|
2
|
+
* QCObjects SDK 2.5
|
|
7
3
|
* ________________
|
|
8
4
|
*
|
|
9
5
|
* Author: Jean Machuca <correojean@gmail.com>
|
|
@@ -25,27 +21,42 @@ const org_qcobjects_effects_1 = require("./org.qcobjects.effects");
|
|
|
25
21
|
*
|
|
26
22
|
* Everyone is permitted to copy and distribute verbatim copies of this
|
|
27
23
|
* license document, but changing it is not allowed.
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
24
|
+
*/
|
|
25
|
+
"use strict";
|
|
26
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
+
exports.ListComponent = exports.ListItemComponent = void 0;
|
|
28
|
+
const qcobjects_1 = require("qcobjects");
|
|
29
|
+
class ListItemComponent extends qcobjects_1.Component {
|
|
30
|
+
shadowed = false;
|
|
31
|
+
tplsource = "inline";
|
|
32
|
+
template = "<a href=\"{{value}}\">{{label}}</a>";
|
|
33
|
+
cached = false;
|
|
34
|
+
constructor(o) {
|
|
35
|
+
o.name = "list-item";
|
|
36
|
+
super(o);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
exports.ListItemComponent = ListItemComponent;
|
|
40
|
+
class ListComponent extends qcobjects_1.Component {
|
|
41
|
+
data;
|
|
42
|
+
shadowed = true;
|
|
43
|
+
tplsource = "inline";
|
|
44
|
+
template = "<p>Loading...</p>";
|
|
45
|
+
body;
|
|
46
|
+
shadowRoot;
|
|
47
|
+
rows;
|
|
48
|
+
subcomponents;
|
|
49
|
+
done;
|
|
50
|
+
serviceData;
|
|
51
|
+
constructor(o) {
|
|
52
|
+
o.name = "list";
|
|
53
|
+
super(o);
|
|
54
|
+
this.body.setAttribute("controllerClass", "ListController");
|
|
55
|
+
this.body.setAttribute("subcomponentClass", "ListItemComponent");
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
exports.ListComponent = ListComponent;
|
|
59
|
+
(0, qcobjects_1.Package)("org.qcobjects.components.list", [
|
|
60
|
+
ListItemComponent,
|
|
61
|
+
ListComponent
|
|
62
|
+
]);
|
|
@@ -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.NotificationComponent = void 0;
|
|
28
|
+
const qcobjects_1 = require("qcobjects");
|
|
29
|
+
const org_qcobjects_effects_1 = require("./org.qcobjects.effects");
|
|
30
|
+
class NotificationComponent extends qcobjects_1.Component {
|
|
31
|
+
cached = false;
|
|
32
|
+
tplsource = "inline";
|
|
33
|
+
shadowed = false;
|
|
34
|
+
kinds;
|
|
35
|
+
template;
|
|
36
|
+
constructor(o) {
|
|
37
|
+
o.name = "notification";
|
|
38
|
+
o.body = (0, qcobjects_1._DOMCreateElement)("div");
|
|
39
|
+
super(o);
|
|
40
|
+
this.template = `
|
|
41
|
+
<style>
|
|
42
|
+
div.notification_background {
|
|
43
|
+
display: block; /* Hidden by default */
|
|
44
|
+
position: fixed; /* Stay in place */
|
|
45
|
+
z-index: 1; /* Sit on top */
|
|
46
|
+
padding-top: 100px; /* Location of the box */
|
|
47
|
+
left: 0;
|
|
48
|
+
top: 0;
|
|
49
|
+
bottom:0;
|
|
50
|
+
right:0;
|
|
51
|
+
width: 100%; /* Full width */
|
|
52
|
+
height: 100%; /* Full height */
|
|
53
|
+
overflow: auto; /* Enable scroll if needed */
|
|
54
|
+
background-color: rgb(0,0,0); /* Fallback color */
|
|
55
|
+
background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
|
|
56
|
+
border: none !important;
|
|
57
|
+
}
|
|
58
|
+
div.notification {
|
|
59
|
+
border-radius: 12px !important;
|
|
60
|
+
margin-bottom: 15px;
|
|
61
|
+
padding: 4px 12px;
|
|
62
|
+
}
|
|
63
|
+
.notification.danger {
|
|
64
|
+
background-color: #ffdddd;
|
|
65
|
+
border-left: 6px solid #f44336;
|
|
66
|
+
}
|
|
67
|
+
.notification.success {
|
|
68
|
+
background-color: #ddffdd;
|
|
69
|
+
border-left: 6px solid #4CAF50;
|
|
70
|
+
}
|
|
71
|
+
.notification.info {
|
|
72
|
+
background-color: #e7f3fe;
|
|
73
|
+
border-left: 6px solid #2196F3;
|
|
74
|
+
}
|
|
75
|
+
.notification.warning {
|
|
76
|
+
background-color: #ffffcc;
|
|
77
|
+
border-left: 6px solid #ffeb3b;
|
|
78
|
+
}
|
|
79
|
+
</style>
|
|
80
|
+
<div class="notification_background">
|
|
81
|
+
<div class="notification {{kind}}">
|
|
82
|
+
<p><strong>{{title}}</strong> {{message}}</p>
|
|
83
|
+
</div>
|
|
84
|
+
</div>
|
|
85
|
+
`;
|
|
86
|
+
this.kinds = ["danger", "success", "info", "warning"];
|
|
87
|
+
}
|
|
88
|
+
display(element) {
|
|
89
|
+
const _display_ = function (element) {
|
|
90
|
+
element.style.display = "block";
|
|
91
|
+
const appearEffect = (0, qcobjects_1.New)(org_qcobjects_effects_1.Move, {
|
|
92
|
+
duration: 900,
|
|
93
|
+
apply(element) {
|
|
94
|
+
(0, qcobjects_1._super_)("Fade", "apply").call(this, element, 0, 1);
|
|
95
|
+
(0, qcobjects_1._super_)("Move", "apply").call(this, element, 0, -document.body.clientHeight, 0, 0);
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
const disappearEffect = (0, qcobjects_1.New)(org_qcobjects_effects_1.Move, {
|
|
99
|
+
duration: 650,
|
|
100
|
+
apply(element) {
|
|
101
|
+
(0, qcobjects_1._super_)("Fade", "apply").call(this, element, 1, 0);
|
|
102
|
+
(0, qcobjects_1._super_)("Move", "apply").call(this, element, 0, 0, 0, -document.body.clientHeight);
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
appearEffect.apply(element);
|
|
106
|
+
setTimeout(function () {
|
|
107
|
+
disappearEffect.apply(element);
|
|
108
|
+
}, 2000);
|
|
109
|
+
};
|
|
110
|
+
element.subelements("div.notification_background").map((element) => { return (new org_qcobjects_effects_1.Fade({ duration: 500 })).apply(element, 0, 1); });
|
|
111
|
+
element.subelements("div.notification").map((element) => _display_(element));
|
|
112
|
+
setTimeout(function () {
|
|
113
|
+
element.remove();
|
|
114
|
+
}, 2200);
|
|
115
|
+
}
|
|
116
|
+
static success(message) {
|
|
117
|
+
const c = (0, qcobjects_1.New)(NotificationComponent, {
|
|
118
|
+
name: "notification",
|
|
119
|
+
shadowed: true,
|
|
120
|
+
body: (0, qcobjects_1._DOMCreateElement)("div"),
|
|
121
|
+
data: {
|
|
122
|
+
kind: "success",
|
|
123
|
+
title: "Success!",
|
|
124
|
+
message: `${message}...`
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
document.body.append(c);
|
|
128
|
+
const _componentRoot = (c.shadowed) ? (c.shadowRoot.host) : (c.body);
|
|
129
|
+
c.display(_componentRoot);
|
|
130
|
+
}
|
|
131
|
+
static danger(message) {
|
|
132
|
+
const c = (0, qcobjects_1.New)(NotificationComponent, {
|
|
133
|
+
name: "notification",
|
|
134
|
+
shadowed: true,
|
|
135
|
+
body: (0, qcobjects_1._DOMCreateElement)("div"),
|
|
136
|
+
data: {
|
|
137
|
+
kind: "danger",
|
|
138
|
+
title: "Danger!",
|
|
139
|
+
message: `${message}...`
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
document.body.append(c);
|
|
143
|
+
const _componentRoot = (c.shadowed) ? (c.shadowRoot.host) : (c.body);
|
|
144
|
+
c.display(_componentRoot);
|
|
145
|
+
}
|
|
146
|
+
static info(message) {
|
|
147
|
+
const c = (0, qcobjects_1.New)(NotificationComponent, {
|
|
148
|
+
name: "notification",
|
|
149
|
+
shadowed: true,
|
|
150
|
+
body: (0, qcobjects_1._DOMCreateElement)("div"),
|
|
151
|
+
data: {
|
|
152
|
+
kind: "info",
|
|
153
|
+
title: "Info!",
|
|
154
|
+
message: `${message}...`
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
document.body.append(c);
|
|
158
|
+
const _componentRoot = (c.shadowed) ? (c.shadowRoot.host) : (c.body);
|
|
159
|
+
c.display(_componentRoot);
|
|
160
|
+
}
|
|
161
|
+
static warning(message) {
|
|
162
|
+
const c = (0, qcobjects_1.New)(NotificationComponent, {
|
|
163
|
+
name: "notification",
|
|
164
|
+
shadowed: true,
|
|
165
|
+
body: (0, qcobjects_1._DOMCreateElement)("div"),
|
|
166
|
+
data: {
|
|
167
|
+
kind: "warning",
|
|
168
|
+
title: "Warning!",
|
|
169
|
+
message: `${message}...`
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
document.body.append(c);
|
|
173
|
+
const _componentRoot = (c.shadowed) ? (c.shadowRoot.host) : (c.body);
|
|
174
|
+
c.display(_componentRoot);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
exports.NotificationComponent = NotificationComponent;
|
|
178
|
+
(0, qcobjects_1.Package)("org.quickcorp.components.notifications", [
|
|
179
|
+
NotificationComponent
|
|
180
|
+
]);
|
|
@@ -0,0 +1,207 @@
|
|
|
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.SliderComponent = exports.SlideItemComponent = exports.SlideListComponent = void 0;
|
|
28
|
+
const qcobjects_1 = require("qcobjects");
|
|
29
|
+
class SlideListComponent extends qcobjects_1.Component {
|
|
30
|
+
tplsource = "inline";
|
|
31
|
+
template = "<p>Loading...</p>";
|
|
32
|
+
name = "slidelist";
|
|
33
|
+
body;
|
|
34
|
+
constructor(o) {
|
|
35
|
+
super(o);
|
|
36
|
+
this.body.setAttribute("controllerClass", "DataGridController");
|
|
37
|
+
const subcomponentClass = (this.body.getAttribute("subcomponentClass") !== null) ? (this.body.getAttribute("subcomponentClass")) : ("GridItemComponent");
|
|
38
|
+
this.body.setAttribute("subcomponentClass", subcomponentClass);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
exports.SlideListComponent = SlideListComponent;
|
|
42
|
+
class SlideItemComponent extends qcobjects_1.Component {
|
|
43
|
+
effectClass = "Fade";
|
|
44
|
+
name = "slider_item";
|
|
45
|
+
data;
|
|
46
|
+
template;
|
|
47
|
+
tplsource;
|
|
48
|
+
constructor(o) {
|
|
49
|
+
super(o);
|
|
50
|
+
this.data.slideNumber = this.data.__dataIndex + 1;
|
|
51
|
+
this.template = `
|
|
52
|
+
<div class="qcoSlides" style="display:none">
|
|
53
|
+
<div class="qco-slider__numbertext">{{slideNumber}} / {{__dataLength}}</div>
|
|
54
|
+
<img src="{{image}}" alt="{{title}}"/>
|
|
55
|
+
<div class="qco-slider__text">
|
|
56
|
+
<p>{{label}} <a href="{{link}}">{{category}}</a></p>
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
59
|
+
`;
|
|
60
|
+
this.tplsource = "inline";
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
exports.SlideItemComponent = SlideItemComponent;
|
|
64
|
+
class SliderComponent extends qcobjects_1.Component {
|
|
65
|
+
name = "slider";
|
|
66
|
+
template;
|
|
67
|
+
tplsource;
|
|
68
|
+
shadowed;
|
|
69
|
+
data;
|
|
70
|
+
body;
|
|
71
|
+
__instanceID;
|
|
72
|
+
constructor(o) {
|
|
73
|
+
super(o);
|
|
74
|
+
this.template = `
|
|
75
|
+
<style>
|
|
76
|
+
/* Slideshow container */
|
|
77
|
+
|
|
78
|
+
:host a:hover,
|
|
79
|
+
:host a:active,
|
|
80
|
+
:host a:visited {
|
|
81
|
+
color: #ffffff;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
{
|
|
85
|
+
color: #ffffff;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
:host .prev {left:0;}
|
|
89
|
+
.qco-slider__container {
|
|
90
|
+
max-width: 100%;
|
|
91
|
+
position: relative;
|
|
92
|
+
margin: auto;
|
|
93
|
+
height: 300px;
|
|
94
|
+
}
|
|
95
|
+
:host .qco-slider__container .qcoSlides img {
|
|
96
|
+
object-fit: cover;
|
|
97
|
+
width: 100%;
|
|
98
|
+
height: 300px;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/* Next & previous buttons */
|
|
102
|
+
:host .prev,
|
|
103
|
+
:host .next {
|
|
104
|
+
cursor: pointer;
|
|
105
|
+
position: absolute;
|
|
106
|
+
top: 50%;
|
|
107
|
+
width: auto;
|
|
108
|
+
margin-top: -22px;
|
|
109
|
+
padding: 16px;
|
|
110
|
+
color: white;
|
|
111
|
+
font-weight: bold;
|
|
112
|
+
font-size: 18px;
|
|
113
|
+
transition: 0.6s ease;
|
|
114
|
+
border-radius: 0 3px 3px 0;
|
|
115
|
+
background-color: rgba(1, 1, 1, 0.1);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/* Position the "next button" to the right */
|
|
119
|
+
:host .next {
|
|
120
|
+
right: 0;
|
|
121
|
+
border-radius: 3px 0 0 3px;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/* On hover, add a black background color with a little bit see-through */
|
|
125
|
+
:host .prev:hover,
|
|
126
|
+
:host .next:hover {
|
|
127
|
+
background-color: rgba(0, 0, 0, 0.8);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/* Caption text */
|
|
131
|
+
:host .qco-slider__text {
|
|
132
|
+
color: #f2f2f2;
|
|
133
|
+
font-size: 15px;
|
|
134
|
+
/* padding: 8px 12px;*/
|
|
135
|
+
position: absolute;
|
|
136
|
+
bottom: 8px;
|
|
137
|
+
width: 100%;
|
|
138
|
+
text-align: center;
|
|
139
|
+
text-shadow: -1px 1px 3px #111111;
|
|
140
|
+
background-color: rgba(1,1,1,0.7);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/* Number text (1/3 etc) */
|
|
144
|
+
:host .qco-slider__numbertext {
|
|
145
|
+
color: #f2f2f2;
|
|
146
|
+
text-shadow: 0px 2px 3px #111111;
|
|
147
|
+
font-size: 12px;
|
|
148
|
+
padding: 8px 12px;
|
|
149
|
+
position: absolute;
|
|
150
|
+
top: 0;
|
|
151
|
+
padding-top: 0;
|
|
152
|
+
margin-top: 10px;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/* The dots/bullets/indicators */
|
|
156
|
+
:host .qcoSlider__dots {
|
|
157
|
+
text-align: center;
|
|
158
|
+
margin: 0 auto;
|
|
159
|
+
padding: 0;
|
|
160
|
+
}
|
|
161
|
+
:host .qcoSlider__dots--dot {
|
|
162
|
+
cursor: pointer;
|
|
163
|
+
height: 10px;
|
|
164
|
+
width: 10px;
|
|
165
|
+
margin: 0 2px;
|
|
166
|
+
background-color: #bbb;
|
|
167
|
+
border-radius: 50%;
|
|
168
|
+
display: inline-block;
|
|
169
|
+
transition: background-color 0.6s ease;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
:host .active,
|
|
173
|
+
:host .qcoSlider__dots--dot:hover {
|
|
174
|
+
background-color: #717171;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
:host .qco-slider__container .qcoSlides img {
|
|
178
|
+
border-radius: 30px 30px 0px 0px;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
</style>
|
|
182
|
+
|
|
183
|
+
<div class="qco-slider__container">
|
|
184
|
+
<component name="slidelist" componentClass="SlideListComponent" subcomponentClass="SlideItemComponent" serviceClass="{{SERVICE_CLASS}}" ></component>
|
|
185
|
+
|
|
186
|
+
<a class="prev" onclick="global.get('{{sliderHandler}}').plusSlidesAndStop(-1)">❮</a>
|
|
187
|
+
<a class="next" onclick="global.get('{{sliderHandler}}').plusSlidesAndStop(1)">❯</a>
|
|
188
|
+
</div>
|
|
189
|
+
<br>
|
|
190
|
+
|
|
191
|
+
<div class="qcoSlider__dots" style="text-align:center">
|
|
192
|
+
</div>
|
|
193
|
+
|
|
194
|
+
`;
|
|
195
|
+
this.tplsource = "inline";
|
|
196
|
+
this.shadowed = true;
|
|
197
|
+
this.data.SERVICE_CLASS = this.body.getAttribute("serviceClass");
|
|
198
|
+
this.data.sliderHandler = "slider_" + this.__instanceID.toString();
|
|
199
|
+
this.body.setAttribute("controllerClass", "SliderController");
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
exports.SliderComponent = SliderComponent;
|
|
203
|
+
(0, qcobjects_1.Package)("org.qcobjects.components.slider", [
|
|
204
|
+
SlideListComponent,
|
|
205
|
+
SlideItemComponent,
|
|
206
|
+
SliderComponent
|
|
207
|
+
]);
|