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,228 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const qcobjects_1 = require("qcobjects");
|
|
4
|
+
/**
|
|
5
|
+
* QCObjects SDK 2.4
|
|
6
|
+
* ________________
|
|
7
|
+
*
|
|
8
|
+
* Author: Jean Machuca <correojean@gmail.com>
|
|
9
|
+
*
|
|
10
|
+
* Cross Browser Javascript Framework for MVC Patterns
|
|
11
|
+
* QuickCorp/QCObjects is licensed under the
|
|
12
|
+
* GNU Lesser General Public License v3.0
|
|
13
|
+
* [LICENSE] (https://github.com/QuickCorp/QCObjects/blob/master/LICENSE.txt)
|
|
14
|
+
*
|
|
15
|
+
* Permissions of this copyleft license are conditioned on making available
|
|
16
|
+
* complete source code of licensed works and modifications under the same
|
|
17
|
+
* license or the GNU GPLv3. Copyright and license notices must be preserved.
|
|
18
|
+
* Contributors provide an express grant of patent rights. However, a larger
|
|
19
|
+
* work using the licensed work through interfaces provided by the licensed
|
|
20
|
+
* work may be distributed under different terms and without source code for
|
|
21
|
+
* the larger work.
|
|
22
|
+
*
|
|
23
|
+
* Copyright (C) 2015 Jean Machuca,<correojean@gmail.com>
|
|
24
|
+
*
|
|
25
|
+
* Everyone is permitted to copy and distribute verbatim copies of this
|
|
26
|
+
* license document, but changing it is not allowed.
|
|
27
|
+
*/
|
|
28
|
+
(function () {
|
|
29
|
+
"use strict";
|
|
30
|
+
(0, qcobjects_1.Package)("org.qcobjects.controllers.list", [
|
|
31
|
+
class ListController extends qcobjects_1.Controller {
|
|
32
|
+
constructor({ component, dependencies = [], valueField = undefined, labelField = undefined }) {
|
|
33
|
+
super({ component, dependencies, valueField, labelField });
|
|
34
|
+
this.component = component;
|
|
35
|
+
this._componentRoot = (this.component.shadowed) ? (this.component.shadowRoot) : (this.component.body);
|
|
36
|
+
this.labelField = this.component.body.getAttribute("label-field");
|
|
37
|
+
this.valueField = this.component.body.getAttribute("value-field");
|
|
38
|
+
this.rows = this.component.body.getAttribute("rows");
|
|
39
|
+
this.rows = (this.rows !== null) ? (this.rows) : (this.component.rows);
|
|
40
|
+
this.cols = 1;
|
|
41
|
+
qcobjects_1.logger.debug("ListController INIT");
|
|
42
|
+
}
|
|
43
|
+
getPageIndex(page, totalPage, totalElements) {
|
|
44
|
+
page = (page > 0) ? (page - 1) : (0);
|
|
45
|
+
return [totalElements * page / totalPage, (totalElements * page / totalPage) + totalElements / totalPage];
|
|
46
|
+
}
|
|
47
|
+
addSubcomponents() {
|
|
48
|
+
this.component.subcomponents = [];
|
|
49
|
+
const layout = this.component.body.getAttribute("layout");
|
|
50
|
+
const basePath = qcobjects_1.CONFIG.get("listBasePath", qcobjects_1.CONFIG.get("remoteSDKPath", ""));
|
|
51
|
+
let cssLayout = "";
|
|
52
|
+
this.labelField = this.component.body.getAttribute("label-field");
|
|
53
|
+
this.valueField = this.component.body.getAttribute("value-field");
|
|
54
|
+
if (layout === "horizontal") {
|
|
55
|
+
cssLayout = `@import url("${basePath}css/components/horizontal-list.css");`;
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
cssLayout = `@import url("${basePath}css/components/list.css");`;
|
|
59
|
+
}
|
|
60
|
+
if (typeof this._componentRoot !== "undefined") {
|
|
61
|
+
this._componentRoot.innerHTML = `<style>${cssLayout}</style><ul></ul>`;
|
|
62
|
+
}
|
|
63
|
+
qcobjects_1.logger.debug((0, qcobjects_1._DataStringify)(this.component.data));
|
|
64
|
+
try {
|
|
65
|
+
const subcomponentClass = this.component.body.getAttribute("subcomponentClass");
|
|
66
|
+
if (subcomponentClass != null) {
|
|
67
|
+
let offset;
|
|
68
|
+
let limit;
|
|
69
|
+
let pagesNumber;
|
|
70
|
+
let list = [...this.component.data];
|
|
71
|
+
let paginateIn = this.component.body.getAttribute("paginate-in");
|
|
72
|
+
paginateIn = (paginateIn !== null) ? (paginateIn) : ("client");
|
|
73
|
+
let page;
|
|
74
|
+
if (paginateIn === "client") {
|
|
75
|
+
page = this.component.body.getAttribute("page-number");
|
|
76
|
+
page = (isNaN(page) || page === null) ? (-1) : (page);
|
|
77
|
+
if (page !== -1) {
|
|
78
|
+
pagesNumber = this.component.body.getAttribute("total-pages");
|
|
79
|
+
pagesNumber = (isNaN(pagesNumber)) ? (1) : (pagesNumber);
|
|
80
|
+
offset = this.getPageIndex(page, pagesNumber, list.length)[0];
|
|
81
|
+
limit = this.getPageIndex(page, pagesNumber, list.length)[1];
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
offset = 0;
|
|
85
|
+
limit = list.length;
|
|
86
|
+
pagesNumber = 1;
|
|
87
|
+
}
|
|
88
|
+
list = list.slice(offset, limit);
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
offset = 0;
|
|
92
|
+
limit = list.length;
|
|
93
|
+
pagesNumber = 1;
|
|
94
|
+
}
|
|
95
|
+
list.map((record, dataIndex) => {
|
|
96
|
+
const _ret_ = undefined;
|
|
97
|
+
try {
|
|
98
|
+
const _body = (0, qcobjects_1._DOMCreateElement)("li");
|
|
99
|
+
record.label = record[this.labelField];
|
|
100
|
+
record.value = record[this.valueField];
|
|
101
|
+
const subcomponent = (0, qcobjects_1.New)((0, qcobjects_1.ClassFactory)(subcomponentClass), {
|
|
102
|
+
name: "list-item",
|
|
103
|
+
data: {
|
|
104
|
+
label: record[this.labelField],
|
|
105
|
+
value: record[this.valueField],
|
|
106
|
+
__dataIndex: dataIndex,
|
|
107
|
+
__page: page,
|
|
108
|
+
__totalPages: pagesNumber,
|
|
109
|
+
__limit: limit,
|
|
110
|
+
__offset: offset
|
|
111
|
+
},
|
|
112
|
+
templateURI: (0, qcobjects_1.ComponentURI)({
|
|
113
|
+
"COMPONENTS_BASE_PATH": qcobjects_1.CONFIG.get("componentsBasePath", ""),
|
|
114
|
+
"COMPONENT_NAME": (0, qcobjects_1.ClassFactory)(subcomponentClass).name,
|
|
115
|
+
"TPLEXTENSION": qcobjects_1.CONFIG.get("tplextension", ""),
|
|
116
|
+
"TPL_SOURCE": (0, qcobjects_1.ClassFactory)(subcomponentClass).tplsource
|
|
117
|
+
}),
|
|
118
|
+
body: _body,
|
|
119
|
+
template: (0, qcobjects_1.ClassFactory)(subcomponentClass).template
|
|
120
|
+
});
|
|
121
|
+
subcomponent.done = this.component.done.bind(subcomponent);
|
|
122
|
+
try {
|
|
123
|
+
if (subcomponent) {
|
|
124
|
+
subcomponent.data.__dataIndex = dataIndex;
|
|
125
|
+
if (Object.hasOwnProperty.call(this.component.data, "length")) {
|
|
126
|
+
subcomponent.data.__dataLength = this.component.data.length;
|
|
127
|
+
}
|
|
128
|
+
qcobjects_1.logger.debug("adding subcomponent to body");
|
|
129
|
+
this._componentRoot.subelements("ul").map(ul => ul.append(subcomponent));
|
|
130
|
+
try {
|
|
131
|
+
this.component.subcomponents.push(subcomponent);
|
|
132
|
+
}
|
|
133
|
+
catch (e) {
|
|
134
|
+
qcobjects_1.logger.debug("ERROR LOADING SUBCOMPONENT IN DATAGRID");
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
else {
|
|
138
|
+
qcobjects_1.logger.debug("ERROR LOADING SUBCOMPONENT IN DATAGRID");
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
catch (e) {
|
|
142
|
+
qcobjects_1.logger.debug("ERROR LOADING SUBCOMPONENT IN DATAGRID");
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
catch (e) {
|
|
146
|
+
qcobjects_1.logger.debug("ERROR LOADING SUBCOMPONENT IN DATAGRID");
|
|
147
|
+
}
|
|
148
|
+
return _ret_;
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
else {
|
|
152
|
+
qcobjects_1.logger.debug("NO SUBCOMPONENT CLASS IN COMPONENT");
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
catch (e) {
|
|
156
|
+
qcobjects_1.logger.debug("No data for component");
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
cssGrid() {
|
|
160
|
+
const component = this.component;
|
|
161
|
+
const _componentRoot = (component.shadowed) ? (component.shadowRoot) : (component.body);
|
|
162
|
+
if (typeof this.rows !== "undefined" && typeof this.cols !== "undefined") {
|
|
163
|
+
const s = (0, qcobjects_1._DOMCreateElement)("style");
|
|
164
|
+
const templateRows = "auto ".repeat(this.rows);
|
|
165
|
+
const templateCols = "auto ".repeat(this.cols);
|
|
166
|
+
const className = "grid" + this.__instanceID.toString();
|
|
167
|
+
s.innerHTML = `.${className}{
|
|
168
|
+
display: grid; \
|
|
169
|
+
grid-template-rows: ${templateRows}; \
|
|
170
|
+
grid-template-columns: ${templateCols}; \
|
|
171
|
+
margin:0 auto; \
|
|
172
|
+
}`;
|
|
173
|
+
_componentRoot.append(s);
|
|
174
|
+
_componentRoot.classList.add(className);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
done() {
|
|
178
|
+
this.cssGrid();
|
|
179
|
+
const componentInstance = this.component;
|
|
180
|
+
qcobjects_1.logger.debug("ListController DONE");
|
|
181
|
+
const serviceClass = this.component.body.getAttribute("serviceClass");
|
|
182
|
+
if (serviceClass != null) {
|
|
183
|
+
let offset;
|
|
184
|
+
let limit;
|
|
185
|
+
let paginateIn = componentInstance.body.getAttribute("paginate-in");
|
|
186
|
+
paginateIn = (paginateIn !== null) ? (paginateIn) : ("client");
|
|
187
|
+
if (paginateIn === "server") {
|
|
188
|
+
let page = componentInstance.body.getAttribute("page-number");
|
|
189
|
+
page = (isNaN(page) || page === null) ? (-1) : (page);
|
|
190
|
+
let pagesNumber;
|
|
191
|
+
if (page !== -1) {
|
|
192
|
+
const serverDataCount = (this.component.body.getAttribute("server-data-count") !== null) ? (this.component.body.getAttribute("server-data-count")) : (1);
|
|
193
|
+
pagesNumber = this.component.body.getAttribute("total-pages");
|
|
194
|
+
pagesNumber = (isNaN(pagesNumber)) ? (1) : (pagesNumber);
|
|
195
|
+
offset = this.getPageIndex(page, pagesNumber, serverDataCount)[0];
|
|
196
|
+
limit = this.getPageIndex(page, pagesNumber, serverDataCount)[1];
|
|
197
|
+
// send params in jsonrpc 2.0 style
|
|
198
|
+
componentInstance.serviceData = (typeof componentInstance.serviceData !== "undefined") ? (componentInstance.serviceData) : ({});
|
|
199
|
+
componentInstance.serviceData.params = (typeof componentInstance.serviceData.params !== "undefined") ? (componentInstance.serviceData.params) : ({});
|
|
200
|
+
componentInstance.serviceData.params.offset = offset;
|
|
201
|
+
componentInstance.serviceData.params.limit = limit;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
(0, qcobjects_1.serviceLoader)((0, qcobjects_1.New)((0, qcobjects_1.ClassFactory)(serviceClass), {
|
|
205
|
+
data: componentInstance.serviceData
|
|
206
|
+
}), false).then((successfulResponse) => {
|
|
207
|
+
// This will show the service response as a plain text
|
|
208
|
+
qcobjects_1.logger.debug("DONE SERVICE COMPONENT");
|
|
209
|
+
successfulResponse.service.JSONresponse = JSON.parse(successfulResponse.service.template);
|
|
210
|
+
if (typeof successfulResponse.service.JSONresponse.result !== "undefined") {
|
|
211
|
+
qcobjects_1.logger.debug((0, qcobjects_1._DataStringify)(successfulResponse.service.JSONresponse.result));
|
|
212
|
+
componentInstance.data = successfulResponse.service.JSONresponse.result;
|
|
213
|
+
}
|
|
214
|
+
else {
|
|
215
|
+
componentInstance.data = successfulResponse.service.JSONresponse;
|
|
216
|
+
}
|
|
217
|
+
this.addSubcomponents();
|
|
218
|
+
}, (failedResponse) => {
|
|
219
|
+
qcobjects_1.logger.debug(failedResponse);
|
|
220
|
+
}).catch((e) => {
|
|
221
|
+
qcobjects_1.logger.debug("Something went wrong when calling the service from: " + serviceClass);
|
|
222
|
+
qcobjects_1.logger.debug(e.message);
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
]);
|
|
228
|
+
})();
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const qcobjects_1 = require("qcobjects");
|
|
4
|
+
/**
|
|
5
|
+
* QCObjects SDK 2.4
|
|
6
|
+
* ________________
|
|
7
|
+
*
|
|
8
|
+
* Author: Jean Machuca <correojean@gmail.com>
|
|
9
|
+
*
|
|
10
|
+
* Cross Browser Javascript Framework for MVC Patterns
|
|
11
|
+
* QuickCorp/QCObjects is licensed under the
|
|
12
|
+
* GNU Lesser General Public License v3.0
|
|
13
|
+
* [LICENSE] (https://github.com/QuickCorp/QCObjects/blob/master/LICENSE.txt)
|
|
14
|
+
*
|
|
15
|
+
* Permissions of this copyleft license are conditioned on making available
|
|
16
|
+
* complete source code of licensed works and modifications under the same
|
|
17
|
+
* license or the GNU GPLv3. Copyright and license notices must be preserved.
|
|
18
|
+
* Contributors provide an express grant of patent rights. However, a larger
|
|
19
|
+
* work using the licensed work through interfaces provided by the licensed
|
|
20
|
+
* work may be distributed under different terms and without source code for
|
|
21
|
+
* the larger work.
|
|
22
|
+
*
|
|
23
|
+
* Copyright (C) 2015 Jean Machuca,<correojean@gmail.com>
|
|
24
|
+
*
|
|
25
|
+
* Everyone is permitted to copy and distribute verbatim copies of this
|
|
26
|
+
* license document, but changing it is not allowed.
|
|
27
|
+
*/
|
|
28
|
+
(function (global) {
|
|
29
|
+
"use strict";
|
|
30
|
+
(0, qcobjects_1.Package)("org.qcobjects.controllers.slider", [
|
|
31
|
+
class SliderController extends qcobjects_1.Controller {
|
|
32
|
+
constructor({ component, dependencies = [], duration = 7100, slideIndex = 0, interval = null, sliderHandlerName = null }) {
|
|
33
|
+
super({ component, dependencies, duration, slideIndex, interval, sliderHandlerName });
|
|
34
|
+
this.slideIndex = 0;
|
|
35
|
+
this.duration = 7100;
|
|
36
|
+
this.interval = null;
|
|
37
|
+
this.sliderHandlerName = "";
|
|
38
|
+
this.component = component;
|
|
39
|
+
this._componentRoot = (component.shadowed) ? (component.shadowRoot) : (component.body);
|
|
40
|
+
this.sliderHandlerName = "slider_" + this.component.__instanceID.toString();
|
|
41
|
+
global.set(this.sliderHandlerName, this);
|
|
42
|
+
}
|
|
43
|
+
stop() {
|
|
44
|
+
if (this.interval != null) {
|
|
45
|
+
clearInterval(this.interval);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
plusSlidesAndStop(n) {
|
|
49
|
+
this.stop();
|
|
50
|
+
this.plusSlides(n);
|
|
51
|
+
}
|
|
52
|
+
plusSlides(n) {
|
|
53
|
+
this.showSlides(this.slideIndex += n);
|
|
54
|
+
}
|
|
55
|
+
currentSlide(n) {
|
|
56
|
+
this.stop();
|
|
57
|
+
this.showSlides(this.slideIndex = n);
|
|
58
|
+
}
|
|
59
|
+
automate() {
|
|
60
|
+
this.interval = setInterval(() => {
|
|
61
|
+
this.plusSlides(1);
|
|
62
|
+
}, this.duration);
|
|
63
|
+
}
|
|
64
|
+
showSlides(n) {
|
|
65
|
+
const slides = this._componentRoot?.subelements(".qcoSlides");
|
|
66
|
+
const dots = this._componentRoot?.subelements(".qcoSlider__dots--dot");
|
|
67
|
+
if (n > (slides.length - 1)) {
|
|
68
|
+
this.slideIndex = 0;
|
|
69
|
+
}
|
|
70
|
+
if (n < 0) {
|
|
71
|
+
this.slideIndex = 0;
|
|
72
|
+
}
|
|
73
|
+
slides.filter((slide, index) => { return index !== this.slideIndex; }).map((slide) => {
|
|
74
|
+
return ((0, qcobjects_1.New)((0, qcobjects_1.ClassFactory)("Fade"), {})).apply(slide, 1, 0);
|
|
75
|
+
});
|
|
76
|
+
dots.filter((dot, index) => { return index !== this.slideIndex; }).map((dot) => {
|
|
77
|
+
return dot.classList.remove("active");
|
|
78
|
+
});
|
|
79
|
+
try {
|
|
80
|
+
dots[this.slideIndex].classList.add("active");
|
|
81
|
+
}
|
|
82
|
+
catch (e) {
|
|
83
|
+
qcobjects_1.logger.debug(`Something went wrong when trying to activate a slide: ${this.slideIndex} - ${e.message}`);
|
|
84
|
+
}
|
|
85
|
+
setTimeout(() => {
|
|
86
|
+
slides.filter((slide, index) => { return index !== this.slideIndex; }).map((slide) => {
|
|
87
|
+
slide.style.display = "none";
|
|
88
|
+
return slide.style.display;
|
|
89
|
+
});
|
|
90
|
+
try {
|
|
91
|
+
slides[this.slideIndex].style.display = "block";
|
|
92
|
+
((0, qcobjects_1.New)((0, qcobjects_1.ClassFactory)("Fade"), {})).apply(slides[this.slideIndex], 0, 1);
|
|
93
|
+
}
|
|
94
|
+
catch (e) {
|
|
95
|
+
qcobjects_1.logger.debug(`Something went wrong when trying to show a slide: ${this.slideIndex} - ${e.message}`);
|
|
96
|
+
}
|
|
97
|
+
}, 700);
|
|
98
|
+
}
|
|
99
|
+
fillDots() {
|
|
100
|
+
const slides = this._componentRoot?.subelements(".qcoSlides");
|
|
101
|
+
slides.map((slide, index) => {
|
|
102
|
+
const dotHTML = document.createElement("span");
|
|
103
|
+
const dotContent = `<span class="qcoSlider__dots--dot" onclick="global.get('${this.sliderHandlerName}').currentSlide(${index})"></span>`;
|
|
104
|
+
dotHTML.innerHTML = dotContent;
|
|
105
|
+
return this._componentRoot?.subelements(".qcoSlider__dots")[0].append(dotHTML);
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
done() {
|
|
109
|
+
const slides = this._componentRoot?.subelements(".qcoSlides");
|
|
110
|
+
slides.filter((slide, index) => { return index !== this.slideIndex; }).map((slide) => {
|
|
111
|
+
slide.style.display = "none";
|
|
112
|
+
return slide.style.display;
|
|
113
|
+
});
|
|
114
|
+
setTimeout(() => {
|
|
115
|
+
this.fillDots();
|
|
116
|
+
this.slideIndex = 0;
|
|
117
|
+
this.showSlides(this.slideIndex);
|
|
118
|
+
this.automate();
|
|
119
|
+
}, 3000);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
]);
|
|
123
|
+
})((typeof module === "object" && typeof module.exports === "object") ? (module.exports = (typeof globalThis !== "undefined"
|
|
124
|
+
? globalThis
|
|
125
|
+
: typeof self !== "undefined"
|
|
126
|
+
? self
|
|
127
|
+
: typeof window !== "undefined"
|
|
128
|
+
? window
|
|
129
|
+
: typeof global !== "undefined"
|
|
130
|
+
? global
|
|
131
|
+
: {})) : ((typeof global === "object") ? (global) : ((typeof window === "object") ? (window) : ({}))));
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const qcobjects_1 = require("qcobjects");
|
|
4
|
+
(function () {
|
|
5
|
+
"use strict";
|
|
6
|
+
(0, qcobjects_1.Package)("org.qcobjects.controllers.swagger", [
|
|
7
|
+
class SwaggerUIController extends qcobjects_1.Controller {
|
|
8
|
+
startSwaggerUI() {
|
|
9
|
+
// Begin Swagger UI call region
|
|
10
|
+
if (typeof SwaggerUIBundle !== "undefined") {
|
|
11
|
+
/* eslint-disable no-undef */
|
|
12
|
+
const ui = SwaggerUIBundle({
|
|
13
|
+
url: qcobjects_1.CONFIG.get("swagger-ui-url", "https://petstore.swagger.io/v2/swagger.json"),
|
|
14
|
+
dom_id: "#" + qcobjects_1.CONFIG.get("swagger-ui-dom_id", "swagger-ui"),
|
|
15
|
+
deepLinking: true,
|
|
16
|
+
presets: [
|
|
17
|
+
SwaggerUIBundle.presets.apis,
|
|
18
|
+
SwaggerUIStandalonePreset
|
|
19
|
+
],
|
|
20
|
+
plugins: [
|
|
21
|
+
SwaggerUIBundle.plugins.DownloadUrl
|
|
22
|
+
],
|
|
23
|
+
layout: "StandaloneLayout"
|
|
24
|
+
});
|
|
25
|
+
// End Swagger UI call region
|
|
26
|
+
window.ui = ui;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
done() {
|
|
30
|
+
this.component.body.innerHTML = "<div id=\"" + qcobjects_1.CONFIG.get("swagger-ui-dom_id", "swagger-ui") + "\"></div>";
|
|
31
|
+
const swaggerUIPackagePath = qcobjects_1.CONFIG.get("swagger-ui-package-path", "node_modules/swagger-ui-dist/");
|
|
32
|
+
this.dependencies?.push((0, qcobjects_1.New)(qcobjects_1.SourceJS, {
|
|
33
|
+
url: swaggerUIPackagePath + "swagger-ui-standalone-preset.js",
|
|
34
|
+
external: qcobjects_1.CONFIG.get("swagger-ui-external", false)
|
|
35
|
+
}));
|
|
36
|
+
this.dependencies?.push((0, qcobjects_1.New)(qcobjects_1.SourceCSS, {
|
|
37
|
+
url: swaggerUIPackagePath + "swagger-ui.css",
|
|
38
|
+
external: qcobjects_1.CONFIG.get("swagger-ui-external", false)
|
|
39
|
+
}));
|
|
40
|
+
this.dependencies?.push((0, qcobjects_1.New)(qcobjects_1.SourceJS, {
|
|
41
|
+
url: swaggerUIPackagePath + "swagger-ui-bundle.js",
|
|
42
|
+
external: qcobjects_1.CONFIG.get("swagger-ui-external", false),
|
|
43
|
+
done: () => {
|
|
44
|
+
this.startSwaggerUI();
|
|
45
|
+
}
|
|
46
|
+
}));
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
]);
|
|
50
|
+
})();
|