qcobjects-sdk 2.4.62 → 2.4.64
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/VERSION +1 -1
- package/build/QCObjects-SDK.js +97 -0
- package/build/css/base-modal.css +43 -0
- package/build/css/basic-layout-embedded-nav.css +14 -0
- package/build/css/basic-layout.css +76 -0
- package/build/css/components/horizontal-list.css +64 -0
- package/build/css/components/list.css +57 -0
- package/build/css/components/splashscreen.css +111 -0
- package/build/css/modal.css +46 -0
- package/build/index.cjs +4 -0
- package/build/index.js +27 -0
- package/build/index.mjs +2 -0
- package/build/js/org.qcobjects.cloud.auth.session.data.js +125 -0
- package/build/js/org.qcobjects.cloud.auth.session.usertoken.js +109 -0
- package/build/js/org.qcobjects.components.grid.js +81 -0
- package/build/js/org.qcobjects.components.js +292 -0
- package/build/js/org.qcobjects.components.list.js +71 -0
- package/build/js/org.qcobjects.components.notifications.js +179 -0
- package/build/js/org.qcobjects.components.slider.js +193 -0
- package/build/js/org.qcobjects.components.splashscreen.js +642 -0
- package/build/js/org.qcobjects.controllers.form.js +178 -0
- package/build/js/org.qcobjects.controllers.grid.js +258 -0
- package/build/js/org.qcobjects.controllers.js +34 -0
- package/build/js/org.qcobjects.controllers.list.js +228 -0
- package/build/js/org.qcobjects.controllers.slider.js +131 -0
- package/build/js/org.qcobjects.controllers.swagger.js +50 -0
- package/build/js/org.qcobjects.effects.js +417 -0
- package/build/js/org.qcobjects.i18n_messages.js +72 -0
- package/build/js/org.qcobjects.modal.controllers.js +38 -0
- package/build/js/org.qcobjects.modal.effects.js +51 -0
- package/build/js/org.qcobjects.models.js +34 -0
- package/build/js/org.qcobjects.tools.canvas.js +53 -0
- package/build/js/org.qcobjects.tools.js +64 -0
- package/build/js/org.qcobjects.tools.layouts.js +73 -0
- package/build/js/org.qcobjects.views.js +34 -0
- package/build/templates/components/modalyoulose.tpl.html +3 -0
- package/build/templates/components/modalyouwin.tpl.html +4 -0
- package/build/templates/components/splashscreen.tpl.html +128 -0
- package/build/templates/components/swagger-ui.tpl.html +22 -0
- package/package.json +1 -1
- package/public/QCObjects-SDK.js +696 -0
- package/public/QCObjects-SDK.js.map +7 -0
- package/public/css/base-modal.css +2 -0
- package/public/css/base-modal.css.map +7 -0
- package/public/css/basic-layout-embedded-nav.css +2 -0
- package/public/css/basic-layout-embedded-nav.css.map +7 -0
- package/public/css/basic-layout.css +2 -0
- package/public/css/basic-layout.css.map +7 -0
- package/public/css/components/horizontal-list.css +2 -0
- package/public/css/components/horizontal-list.css.map +7 -0
- package/public/css/components/list.css +2 -0
- package/public/css/components/list.css.map +7 -0
- package/public/css/components/splashscreen.css +2 -0
- package/public/css/components/splashscreen.css.map +7 -0
- package/public/css/modal.css +2 -0
- package/public/css/modal.css.map +7 -0
- package/public/index.cjs +4 -0
- package/public/index.js +27 -0
- package/public/index.mjs +2 -0
- package/public/templates/components/modalyoulose.tpl.html +3 -0
- package/public/templates/components/modalyouwin.tpl.html +4 -0
- package/public/templates/components/splashscreen.tpl.html +128 -0
- package/public/templates/components/swagger-ui.tpl.html +22 -0
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SessionUserToken = void 0;
|
|
4
|
+
const qcobjects_1 = require("qcobjects");
|
|
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
|
+
const _top = (typeof module === "object" && typeof module.exports === "object") ? (module.exports = (typeof globalThis !== "undefined"
|
|
30
|
+
? globalThis
|
|
31
|
+
: typeof self !== "undefined"
|
|
32
|
+
? self
|
|
33
|
+
: typeof window !== "undefined"
|
|
34
|
+
? window
|
|
35
|
+
: typeof global !== "undefined"
|
|
36
|
+
? global
|
|
37
|
+
: {})) : ((typeof global === "object") ? (global) : ((typeof window === "object") ? (window) : ({})));
|
|
38
|
+
(function (global) {
|
|
39
|
+
"use strict";
|
|
40
|
+
class SessionUserToken extends qcobjects_1.InheritClass {
|
|
41
|
+
constructor(o) {
|
|
42
|
+
super(o);
|
|
43
|
+
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
44
|
+
const __instance__ = this;
|
|
45
|
+
this.__cache__ = new qcobjects_1.ComplexStorageCache({
|
|
46
|
+
index: __instance__.__instanceID.toString(),
|
|
47
|
+
load() {
|
|
48
|
+
let __token__;
|
|
49
|
+
if (typeof navigator !== "undefined" && typeof origin !== "undefined") {
|
|
50
|
+
__token__ = qcobjects_1._Crypt.encrypt(`${navigator.userAgent}|${o.username}|${(+(new Date())).toString()}`, origin);
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
__token__ = qcobjects_1._Crypt.encrypt(`${o.username}|${(+(new Date())).toString()}`, qcobjects_1.CONFIG.get("domain", "localhost"));
|
|
54
|
+
}
|
|
55
|
+
SessionUserToken.user = {
|
|
56
|
+
priority: __instance__.__instanceID.toString(),
|
|
57
|
+
token: __token__
|
|
58
|
+
};
|
|
59
|
+
return SessionUserToken.user;
|
|
60
|
+
},
|
|
61
|
+
alternate(cacheController) {
|
|
62
|
+
SessionUserToken.user = cacheController?.cache.getCached(__instance__.__instanceID.toString()); // setting dataObject with the cached value
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
static generateIndex(s) {
|
|
67
|
+
return (typeof Buffer !== "undefined") ? (Buffer.from(s, "ascii").toString("base64")) : (btoa(s));
|
|
68
|
+
}
|
|
69
|
+
getGlobalUser(...args) {
|
|
70
|
+
const username = [args].join("|");
|
|
71
|
+
const __index__ = "userToken_" + SessionUserToken.generateIndex(username);
|
|
72
|
+
if (typeof global.get(__index__) === "undefined" || global.get(__index__) === null) {
|
|
73
|
+
global.set(__index__, (0, qcobjects_1.New)(SessionUserToken, {
|
|
74
|
+
username
|
|
75
|
+
}));
|
|
76
|
+
}
|
|
77
|
+
SessionUserToken.user = global.get(__index__).user;
|
|
78
|
+
return global.get(__index__).user;
|
|
79
|
+
}
|
|
80
|
+
getGlobalUserToken(...args) {
|
|
81
|
+
return this.getGlobalUser(args).token;
|
|
82
|
+
}
|
|
83
|
+
getGlobalUserId(...args) {
|
|
84
|
+
return this.getGlobalUser(args).id;
|
|
85
|
+
}
|
|
86
|
+
getGlobalUserPriority(...args) {
|
|
87
|
+
return this.getGlobalUser(args).priority;
|
|
88
|
+
}
|
|
89
|
+
getLoginCredentialsToken(username, password) {
|
|
90
|
+
return qcobjects_1._Crypt.encrypt(`${username}${password}`, this.getGlobalUserToken(username));
|
|
91
|
+
}
|
|
92
|
+
closeGlobalSession(...args) {
|
|
93
|
+
this.getGlobalUser(args);
|
|
94
|
+
const username = [args].join("|");
|
|
95
|
+
const __index__ = "userToken_" + SessionUserToken.generateIndex(username);
|
|
96
|
+
if (typeof global.get(__index__) !== "undefined") {
|
|
97
|
+
global.get(__index__).__cache__.clear();
|
|
98
|
+
global.set(__index__, null);
|
|
99
|
+
SessionUserToken.user = {};
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
SessionUserToken.user = {};
|
|
104
|
+
(0, qcobjects_1.Package)("org.qcobjects.cloud.auth.session.usertoken", [
|
|
105
|
+
SessionUserToken
|
|
106
|
+
]);
|
|
107
|
+
})(_top);
|
|
108
|
+
const SessionUserToken = _top.SessionUserToken;
|
|
109
|
+
exports.SessionUserToken = SessionUserToken;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GridItemComponent = exports.GridComponent = void 0;
|
|
4
|
+
const qcobjects_1 = require("qcobjects");
|
|
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
|
+
const _top = (typeof module === "object" && typeof module.exports === "object") ? (module.exports = (typeof globalThis !== "undefined"
|
|
30
|
+
? globalThis
|
|
31
|
+
: typeof self !== "undefined"
|
|
32
|
+
? self
|
|
33
|
+
: typeof window !== "undefined"
|
|
34
|
+
? window
|
|
35
|
+
: typeof global !== "undefined"
|
|
36
|
+
? global
|
|
37
|
+
: {})) : ((typeof global === "object") ? (global) : ((typeof window === "object") ? (window) : ({})));
|
|
38
|
+
(function (global) {
|
|
39
|
+
"use strict";
|
|
40
|
+
class GridItemComponent extends qcobjects_1.Component {
|
|
41
|
+
constructor() {
|
|
42
|
+
super(...arguments);
|
|
43
|
+
this.name = "grid-item";
|
|
44
|
+
this.shadowed = true;
|
|
45
|
+
this.tplsource = "inline";
|
|
46
|
+
this.template = `
|
|
47
|
+
<img src="{{image}}" />
|
|
48
|
+
<p>{{description}}</p>
|
|
49
|
+
`;
|
|
50
|
+
this.cached = false;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
class GridComponent extends qcobjects_1.Component {
|
|
54
|
+
constructor(o) {
|
|
55
|
+
super(o);
|
|
56
|
+
this.name = "grid";
|
|
57
|
+
this.cached = false;
|
|
58
|
+
this.view = null;
|
|
59
|
+
this.shadowed = true;
|
|
60
|
+
this.rows = 3;
|
|
61
|
+
this.cols = 3;
|
|
62
|
+
this.templateURI = "";
|
|
63
|
+
this.data = {};
|
|
64
|
+
this.tplsource = "inline";
|
|
65
|
+
this.template = "<p>Loading...</p>";
|
|
66
|
+
this.body.setAttribute("controllerClass", "DataGridController");
|
|
67
|
+
const subcomponentClass = (this.body.getAttribute("subcomponentClass") !== null) ? (this.body.getAttribute("subcomponentClass")) : ("GridItemComponent");
|
|
68
|
+
this.body.setAttribute("subcomponentClass", subcomponentClass);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
(0, qcobjects_1.Package)("org.qcobjects.components.grid", [
|
|
72
|
+
GridComponent,
|
|
73
|
+
GridItemComponent
|
|
74
|
+
]);
|
|
75
|
+
global.GridComponent = GridComponent;
|
|
76
|
+
global.GridItemComponent = GridItemComponent;
|
|
77
|
+
})(_top);
|
|
78
|
+
const GridComponent = _top.GridComponent;
|
|
79
|
+
exports.GridComponent = GridComponent;
|
|
80
|
+
const GridItemComponent = _top.GridItemComponent;
|
|
81
|
+
exports.GridItemComponent = GridItemComponent;
|
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* QCObjects SDK 2.4
|
|
3
|
+
* ________________
|
|
4
|
+
*
|
|
5
|
+
* Author: Jean Machuca <correojean@gmail.com>
|
|
6
|
+
*
|
|
7
|
+
* Cross Browser Javascript Framework for MVC Patterns
|
|
8
|
+
* QuickCorp/QCObjects is licensed under the
|
|
9
|
+
* GNU Lesser General Public License v3.0
|
|
10
|
+
* [LICENSE] (https://github.com/QuickCorp/QCObjects/blob/master/LICENSE.txt)
|
|
11
|
+
*
|
|
12
|
+
* Permissions of this copyleft license are conditioned on making available
|
|
13
|
+
* complete source code of licensed works and modifications under the same
|
|
14
|
+
* license or the GNU GPLv3. Copyright and license notices must be preserved.
|
|
15
|
+
* Contributors provide an express grant of patent rights. However, a larger
|
|
16
|
+
* work using the licensed work through interfaces provided by the licensed
|
|
17
|
+
* work may be distributed under different terms and without source code for
|
|
18
|
+
* the larger work.
|
|
19
|
+
*
|
|
20
|
+
* Copyright (C) 2015 Jean Machuca,<correojean@gmail.com>
|
|
21
|
+
*
|
|
22
|
+
* Everyone is permitted to copy and distribute verbatim copies of this
|
|
23
|
+
* license document, but changing it is not allowed.
|
|
24
|
+
*/
|
|
25
|
+
"use strict";
|
|
26
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
+
exports.SwaggerUIComponent = exports.ModalEnclosureComponent = exports.ModalComponent = 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 _top = (typeof module === "object" && typeof module.exports === "object") ? (module.exports = (typeof globalThis !== "undefined"
|
|
31
|
+
? globalThis
|
|
32
|
+
: typeof self !== "undefined"
|
|
33
|
+
? self
|
|
34
|
+
: typeof window !== "undefined"
|
|
35
|
+
? window
|
|
36
|
+
: typeof global !== "undefined"
|
|
37
|
+
? global
|
|
38
|
+
: {})) : ((typeof global === "object") ? (global) : ((typeof window === "object") ? (window) : ({})));
|
|
39
|
+
(function (global) {
|
|
40
|
+
class FormField extends qcobjects_1.Component {
|
|
41
|
+
constructor(o) {
|
|
42
|
+
o.name = (typeof o.name !== "undefined") ? (o.name) : ("form-field");
|
|
43
|
+
super(o);
|
|
44
|
+
this.cached = false;
|
|
45
|
+
this.reload = true;
|
|
46
|
+
}
|
|
47
|
+
createBindingEvents() {
|
|
48
|
+
let _objList;
|
|
49
|
+
if (typeof this.fieldType === "undefined" || this.fieldType == null) {
|
|
50
|
+
_objList = this.body.subelements("*[data-field]"); // every child with data-field set
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
_objList = this.body.subelements(this.fieldType + "[data-field]"); // every child with data-field set and tagname is equal to fieldType property
|
|
54
|
+
}
|
|
55
|
+
for (let _datak = 0; _datak < _objList.length; _datak++) {
|
|
56
|
+
const _obj = _objList[_datak];
|
|
57
|
+
_obj.addEventListener("change", () => {
|
|
58
|
+
qcobjects_1.logger.debug("Executing change event binding");
|
|
59
|
+
this.executeBindings();
|
|
60
|
+
});
|
|
61
|
+
_obj.addEventListener("blur", () => {
|
|
62
|
+
qcobjects_1.logger.debug("Executing change event binding");
|
|
63
|
+
this.executeBindings();
|
|
64
|
+
});
|
|
65
|
+
_obj.addEventListener("focus", () => {
|
|
66
|
+
qcobjects_1.logger.debug("Executing change event binding");
|
|
67
|
+
this.executeBindings();
|
|
68
|
+
});
|
|
69
|
+
_obj.addEventListener("keydown", () => {
|
|
70
|
+
qcobjects_1.logger.debug("Executing keydown event binding");
|
|
71
|
+
this.executeBindings();
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
executeBinding(_obj) {
|
|
76
|
+
const _datamodel = _obj.getAttribute("data-field");
|
|
77
|
+
qcobjects_1.logger.debug("Binding " + _datamodel + " for " + this.name);
|
|
78
|
+
this.data[_datamodel] = _obj.value;
|
|
79
|
+
}
|
|
80
|
+
executeBindings() {
|
|
81
|
+
let _objList;
|
|
82
|
+
if (typeof this.fieldType === "undefined" || this.fieldType == null) {
|
|
83
|
+
_objList = this.body.subelements("*[data-field]"); // every child with data-field set
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
_objList = this.body.subelements(this.fieldType + "[data-field]"); // every child with data-field set and tagname is equal to fieldType property
|
|
87
|
+
}
|
|
88
|
+
for (let _datak = 0; _datak < _objList.length; _datak++) {
|
|
89
|
+
const _obj = _objList[_datak];
|
|
90
|
+
const _datamodel = _obj.getAttribute("data-field");
|
|
91
|
+
qcobjects_1.logger.debug("Binding " + _datamodel + " for " + this.name);
|
|
92
|
+
this.data[_datamodel] = _obj.value;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
done(standardResponse) {
|
|
96
|
+
const _ret_ = super.done(standardResponse);
|
|
97
|
+
this.executeBindings();
|
|
98
|
+
this.createBindingEvents();
|
|
99
|
+
qcobjects_1.logger.debug("Field loaded: " + this.fieldType + "[name=" + this.name + "]");
|
|
100
|
+
return _ret_;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
(0, qcobjects_1.Package)("org.qcobjects.base.components", [
|
|
104
|
+
FormField
|
|
105
|
+
]);
|
|
106
|
+
class ShadowedComponent extends qcobjects_1.Component {
|
|
107
|
+
constructor(o) {
|
|
108
|
+
o.body = (0, qcobjects_1._DOMCreateElement)("div");
|
|
109
|
+
super(o);
|
|
110
|
+
this.container = null;
|
|
111
|
+
this.shadowed = true;
|
|
112
|
+
this.cached = false;
|
|
113
|
+
this.controller = null;
|
|
114
|
+
this.view = null;
|
|
115
|
+
this.data = {};
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
class ButtonField extends FormField {
|
|
119
|
+
constructor(o) {
|
|
120
|
+
o.fieldType = "button";
|
|
121
|
+
super(o);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
class InputField extends FormField {
|
|
125
|
+
constructor(o) {
|
|
126
|
+
o.fieldType = "input";
|
|
127
|
+
super(o);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
class TextField extends FormField {
|
|
131
|
+
constructor(o) {
|
|
132
|
+
o.fieldType = "textarea";
|
|
133
|
+
super(o);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
class EmailField extends FormField {
|
|
137
|
+
constructor(o) {
|
|
138
|
+
o.fieldType = "input";
|
|
139
|
+
super(o);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
class ModalEnclosureComponent extends qcobjects_1.Component {
|
|
143
|
+
constructor(o) {
|
|
144
|
+
o.body = (0, qcobjects_1._DOMCreateElement)("div");
|
|
145
|
+
super(o);
|
|
146
|
+
this.name = "modalenclosure";
|
|
147
|
+
this.tplsource = "inline";
|
|
148
|
+
this.cached = false;
|
|
149
|
+
this.basePath = qcobjects_1.CONFIG.get("modalBasePath", qcobjects_1.CONFIG.get("remoteSDKPath", ""));
|
|
150
|
+
this.template = `
|
|
151
|
+
<!-- The Modal -->
|
|
152
|
+
<style>
|
|
153
|
+
@import url('https://sdk.qcobjects.dev/css/modal.css');
|
|
154
|
+
</style>
|
|
155
|
+
<div id="modalInstance_{{modalId}}" class="modal">
|
|
156
|
+
|
|
157
|
+
<!-- Modal content -->
|
|
158
|
+
<div class="modal-content">
|
|
159
|
+
<span class="close">×</span>
|
|
160
|
+
{{content}}
|
|
161
|
+
</div>
|
|
162
|
+
|
|
163
|
+
</div>
|
|
164
|
+
`;
|
|
165
|
+
this.data = {};
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
class ModalComponent extends qcobjects_1.Component {
|
|
169
|
+
constructor(o) {
|
|
170
|
+
o.basePath = qcobjects_1.CONFIG.get("modalBasePath", qcobjects_1.CONFIG.get("remoteSDKPath", ""));
|
|
171
|
+
super(o);
|
|
172
|
+
this.name = "modal";
|
|
173
|
+
this.cached = false;
|
|
174
|
+
this.modalEnclosureComponentClass = "ModalEnclosureComponent";
|
|
175
|
+
this.controller = null;
|
|
176
|
+
this.view = null;
|
|
177
|
+
this.tplsource = "none";
|
|
178
|
+
this.closeOnClickOutside = false;
|
|
179
|
+
this.data = {
|
|
180
|
+
content: "",
|
|
181
|
+
modalId: 0
|
|
182
|
+
};
|
|
183
|
+
this.submodal = null;
|
|
184
|
+
this.data.modalId = this.__instanceID;
|
|
185
|
+
const submodal = (0, qcobjects_1.New)((0, qcobjects_1.ClassFactory)(this.modalEnclosureComponentClass), {
|
|
186
|
+
name: this.name,
|
|
187
|
+
basePath: this.basePath,
|
|
188
|
+
data: this.data
|
|
189
|
+
});
|
|
190
|
+
this.subcomponents.push(submodal);
|
|
191
|
+
this.submodal = submodal;
|
|
192
|
+
if (submodal.tplsource === "none") {
|
|
193
|
+
this.body.innerHTML = submodal.parsedAssignmentText;
|
|
194
|
+
}
|
|
195
|
+
else {
|
|
196
|
+
this.body.append(submodal.body);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
modal() {
|
|
200
|
+
const modalId = this.data.modalId;
|
|
201
|
+
(0, qcobjects_1.Tag)("#modalInstance_" + modalId + ".modal").map((modal) => {
|
|
202
|
+
modal.style.display = "block";
|
|
203
|
+
return (new org_qcobjects_effects_1.ModalFade({})).apply(modal, 0, 1);
|
|
204
|
+
});
|
|
205
|
+
(0, qcobjects_1.Tag)("#modalInstance_" + modalId + ".modal .modal-content").map((modalcontent) => {
|
|
206
|
+
return (new org_qcobjects_effects_1.ModalMoveDown({})).apply(modalcontent, 0, -document.body.clientHeight, 0, 0);
|
|
207
|
+
});
|
|
208
|
+
(0, qcobjects_1.Tag)("#modalInstance_" + modalId + ".modal .modal-content .close").map((closebtn) => {
|
|
209
|
+
return closebtn.addEventListener("click", () => {
|
|
210
|
+
this.close();
|
|
211
|
+
}, false);
|
|
212
|
+
});
|
|
213
|
+
if (this.closeOnClickOutside) {
|
|
214
|
+
window.addEventListener("click", () => {
|
|
215
|
+
this.close();
|
|
216
|
+
}, false);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
close() {
|
|
220
|
+
const modalId = this.data.modalId;
|
|
221
|
+
(0, qcobjects_1.Tag)("#modalInstance_" + modalId + ".modal").map((modal) => {
|
|
222
|
+
modal.style.display = "block";
|
|
223
|
+
return (new org_qcobjects_effects_1.ModalFade({})).apply(modal, 1, 0);
|
|
224
|
+
});
|
|
225
|
+
(0, qcobjects_1.Tag)("#modalInstance_" + modalId + ".modal .modal-content").map(function (modalcontent) {
|
|
226
|
+
return (new org_qcobjects_effects_1.ModalMoveUp({})).apply(modalcontent, 0, 0, 0, -document.body.clientHeight);
|
|
227
|
+
});
|
|
228
|
+
setTimeout(function () {
|
|
229
|
+
(0, qcobjects_1.Tag)("#modalInstance_" + modalId + ".modal").map((modal) => {
|
|
230
|
+
modal.style.display = "none";
|
|
231
|
+
return true;
|
|
232
|
+
});
|
|
233
|
+
}, 900);
|
|
234
|
+
}
|
|
235
|
+
rebuild() {
|
|
236
|
+
const _ret_ = super.rebuild();
|
|
237
|
+
this.templateURI = (0, qcobjects_1.ComponentURI)({
|
|
238
|
+
"COMPONENTS_BASE_PATH": qcobjects_1.CONFIG.get("componentsBasePath", ""),
|
|
239
|
+
"COMPONENT_NAME": "modal",
|
|
240
|
+
"TPLEXTENSION": qcobjects_1.CONFIG.get("tplextension", ""),
|
|
241
|
+
"TPL_SOURCE": "default" // here is always default in order to get the right uri
|
|
242
|
+
});
|
|
243
|
+
return _ret_; // parent call
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
class SwaggerUIComponent extends qcobjects_1.Component {
|
|
247
|
+
constructor() {
|
|
248
|
+
super(...arguments);
|
|
249
|
+
this.cached = false;
|
|
250
|
+
this.basePath = qcobjects_1.CONFIG.get("remoteSDKPath", "");
|
|
251
|
+
this.tplextension = "tpl.html";
|
|
252
|
+
this.name = "swagger-ui";
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
(0, qcobjects_1.Package)("org.qcobjects.form.components", [
|
|
256
|
+
ShadowedComponent,
|
|
257
|
+
ButtonField,
|
|
258
|
+
InputField,
|
|
259
|
+
TextField,
|
|
260
|
+
EmailField,
|
|
261
|
+
ModalEnclosureComponent,
|
|
262
|
+
ModalComponent,
|
|
263
|
+
SwaggerUIComponent
|
|
264
|
+
]);
|
|
265
|
+
global.FormField = FormField;
|
|
266
|
+
global.ShadowedComponent = ShadowedComponent;
|
|
267
|
+
global.ButtonField = ButtonField;
|
|
268
|
+
global.InputField = InputField;
|
|
269
|
+
global.TextField = TextField;
|
|
270
|
+
global.EmailField = EmailField;
|
|
271
|
+
global.ModalEnclosureComponent = ModalEnclosureComponent;
|
|
272
|
+
global.ModalComponent = ModalComponent;
|
|
273
|
+
global.SwaggerUIComponent = SwaggerUIComponent;
|
|
274
|
+
})(_top);
|
|
275
|
+
const FormField = _top.FormField;
|
|
276
|
+
exports.FormField = FormField;
|
|
277
|
+
const ShadowedComponent = _top.ShadowedComponent;
|
|
278
|
+
exports.ShadowedComponent = ShadowedComponent;
|
|
279
|
+
const ButtonField = _top.ButtonField;
|
|
280
|
+
exports.ButtonField = ButtonField;
|
|
281
|
+
const InputField = _top.InputField;
|
|
282
|
+
exports.InputField = InputField;
|
|
283
|
+
const TextField = _top.TextField;
|
|
284
|
+
exports.TextField = TextField;
|
|
285
|
+
const EmailField = _top.EmailField;
|
|
286
|
+
exports.EmailField = EmailField;
|
|
287
|
+
const ModalEnclosureComponent = _top.ModalEnclosureComponent;
|
|
288
|
+
exports.ModalEnclosureComponent = ModalEnclosureComponent;
|
|
289
|
+
const ModalComponent = _top.ModalComponent;
|
|
290
|
+
exports.ModalComponent = ModalComponent;
|
|
291
|
+
const SwaggerUIComponent = _top.SwaggerUIComponent;
|
|
292
|
+
exports.SwaggerUIComponent = SwaggerUIComponent;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ListItemComponent = exports.ListComponent = void 0;
|
|
4
|
+
const qcobjects_1 = require("qcobjects");
|
|
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
|
+
const _top = (typeof module === "object" && typeof module.exports === "object") ? (module.exports = (typeof globalThis !== "undefined"
|
|
30
|
+
? globalThis
|
|
31
|
+
: typeof self !== "undefined"
|
|
32
|
+
? self
|
|
33
|
+
: typeof window !== "undefined"
|
|
34
|
+
? window
|
|
35
|
+
: typeof global !== "undefined"
|
|
36
|
+
? global
|
|
37
|
+
: {})) : ((typeof global === "object") ? (global) : ((typeof window === "object") ? (window) : ({})));
|
|
38
|
+
(function (global) {
|
|
39
|
+
"use strict";
|
|
40
|
+
class ListItemComponent extends qcobjects_1.Component {
|
|
41
|
+
constructor(o) {
|
|
42
|
+
o.name = "list-item";
|
|
43
|
+
super(o);
|
|
44
|
+
this.shadowed = false;
|
|
45
|
+
this.tplsource = "inline";
|
|
46
|
+
this.template = "<a href=\"{{value}}\">{{label}}</a>";
|
|
47
|
+
this.cached = false;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
class ListComponent extends qcobjects_1.Component {
|
|
51
|
+
constructor(o) {
|
|
52
|
+
o.name = "list";
|
|
53
|
+
super(o);
|
|
54
|
+
this.shadowed = true;
|
|
55
|
+
this.tplsource = "inline";
|
|
56
|
+
this.template = "<p>Loading...</p>";
|
|
57
|
+
this.body.setAttribute("controllerClass", "ListController");
|
|
58
|
+
this.body.setAttribute("subcomponentClass", "ListItemComponent");
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
(0, qcobjects_1.Package)("org.qcobjects.components.list", [
|
|
62
|
+
ListItemComponent,
|
|
63
|
+
ListComponent
|
|
64
|
+
]);
|
|
65
|
+
global.ListComponent = ListComponent;
|
|
66
|
+
global.ListItemComponent = ListItemComponent;
|
|
67
|
+
})(_top);
|
|
68
|
+
const ListComponent = _top.ListComponent;
|
|
69
|
+
exports.ListComponent = ListComponent;
|
|
70
|
+
const ListItemComponent = _top.ListItemComponent;
|
|
71
|
+
exports.ListItemComponent = ListItemComponent;
|