qcobjects-sdk 2.4.60 → 2.4.61
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/.dockerignore +98 -1
- package/.eslintignore +1 -2
- package/.github/workflows/static.yml +91 -0
- package/VERSION +1 -1
- package/config.json +4 -0
- package/package.json +31 -9
- package/src/QCObjects-SDK.d.ts +26 -0
- package/src/QCObjects-SDK.ts +110 -0
- package/src/index.d.ts +1 -1
- package/src/index.mts +2 -0
- package/src/js/org.qcobjects.cloud.auth.session.data.d.ts +1 -0
- package/src/js/{org.qcobjects.cloud.auth.session.data.js → org.qcobjects.cloud.auth.session.data.ts} +28 -22
- package/src/js/org.qcobjects.cloud.auth.session.usertoken.d.ts +2 -0
- package/src/js/org.qcobjects.cloud.auth.session.usertoken.ts +128 -0
- package/src/js/org.qcobjects.components.d.ts +10 -0
- package/src/js/org.qcobjects.components.grid.d.ts +3 -0
- package/src/js/org.qcobjects.components.grid.ts +95 -0
- package/src/js/org.qcobjects.components.list.d.ts +3 -0
- package/src/js/org.qcobjects.components.list.ts +83 -0
- package/src/js/org.qcobjects.components.notifications.d.ts +1 -0
- package/src/js/org.qcobjects.components.notifications.ts +191 -0
- package/src/js/org.qcobjects.components.slider.d.ts +1 -0
- package/src/js/{org.qcobjects.components.slider.js → org.qcobjects.components.slider.ts} +8 -6
- package/src/js/org.qcobjects.components.splashscreen.d.ts +28 -0
- package/src/js/org.qcobjects.components.splashscreen.ts +680 -0
- package/src/js/org.qcobjects.components.ts +336 -0
- package/src/js/org.qcobjects.controllers.d.ts +1 -0
- package/src/js/org.qcobjects.controllers.form.d.ts +1 -0
- package/src/js/{org.qcobjects.controllers.form.js → org.qcobjects.controllers.form.ts} +57 -59
- package/src/js/org.qcobjects.controllers.grid.d.ts +1 -0
- package/src/js/{org.qcobjects.controllers.grid.js → org.qcobjects.controllers.grid.ts} +102 -97
- package/src/js/org.qcobjects.controllers.list.d.ts +1 -0
- package/src/js/{org.qcobjects.controllers.list.js → org.qcobjects.controllers.list.ts} +86 -76
- package/src/js/org.qcobjects.controllers.slider.d.ts +1 -0
- package/src/js/org.qcobjects.controllers.slider.ts +158 -0
- package/src/js/org.qcobjects.controllers.swagger.d.ts +1 -0
- package/src/js/{org.qcobjects.controllers.swagger.js → org.qcobjects.controllers.swagger.ts} +13 -14
- package/src/js/{org.qcobjects.controllers.js → org.qcobjects.controllers.ts} +3 -6
- package/src/js/org.qcobjects.effects.d.ts +20 -0
- package/src/js/org.qcobjects.effects.ts +430 -0
- package/src/js/org.qcobjects.i18n_messages.d.ts +1 -0
- package/src/js/{org.qcobjects.i18n_messages.js → org.qcobjects.i18n_messages.ts} +36 -27
- package/src/js/org.qcobjects.modal.controllers.d.ts +1 -0
- package/src/js/{org.qcobjects.modal.controllers.js → org.qcobjects.modal.controllers.ts} +5 -6
- package/src/js/org.qcobjects.modal.effects.d.ts +1 -0
- package/src/js/{org.qcobjects.modal.effects.js → org.qcobjects.modal.effects.ts} +4 -1
- package/src/js/org.qcobjects.models.d.ts +1 -0
- package/src/js/{org.qcobjects.models.js → org.qcobjects.models.ts} +3 -24
- package/src/js/org.qcobjects.tools.canvas.d.ts +1 -0
- package/src/js/{org.qcobjects.tools.canvas.js → org.qcobjects.tools.canvas.ts} +14 -11
- package/src/js/org.qcobjects.tools.d.ts +1 -0
- package/src/js/org.qcobjects.tools.layouts.d.ts +1 -0
- package/src/js/org.qcobjects.tools.layouts.ts +85 -0
- package/src/js/{org.qcobjects.tools.js → org.qcobjects.tools.ts} +19 -11
- package/src/js/org.qcobjects.views.d.ts +1 -0
- package/src/js/{org.qcobjects.views.js → org.qcobjects.views.ts} +3 -5
- package/tsconfig.json +1 -1
- package/-m +0 -1
- package/src/QCObjects-SDK.js +0 -148
- package/src/index.mjs +0 -2
- package/src/js/org.qcobjects.cloud.auth.session.usertoken.js +0 -116
- package/src/js/org.qcobjects.components.grid.js +0 -65
- package/src/js/org.qcobjects.components.js +0 -276
- package/src/js/org.qcobjects.components.list.js +0 -59
- package/src/js/org.qcobjects.components.notifications.js +0 -190
- package/src/js/org.qcobjects.components.splashscreen.js +0 -645
- package/src/js/org.qcobjects.controllers.slider.js +0 -154
- package/src/js/org.qcobjects.effects.js +0 -345
- package/src/js/org.qcobjects.tools.layouts.js +0 -79
- /package/{css → src/css}/base-modal.css +0 -0
- /package/{css → src/css}/basic-layout-embedded-nav.css +0 -0
- /package/{css → src/css}/basic-layout.css +0 -0
- /package/{css → src/css}/components/horizontal-list.css +0 -0
- /package/{css → src/css}/components/list.css +0 -0
- /package/{css → src/css}/components/splashscreen.css +0 -0
- /package/{css → src/css}/modal.css +0 -0
- /package/src/{index.cjs → index.cts} +0 -0
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { ClassFactory, Controller, ControllerParams, New, Package, QCObjectsElement, QCObjectsShadowedElement, logger } from "qcobjects";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* QCObjects SDK 2.4
|
|
5
|
+
* ________________
|
|
6
|
+
*
|
|
7
|
+
* Author: Jean Machuca <correojean@gmail.com>
|
|
8
|
+
*
|
|
9
|
+
* Cross Browser Javascript Framework for MVC Patterns
|
|
10
|
+
* QuickCorp/QCObjects is licensed under the
|
|
11
|
+
* GNU Lesser General Public License v3.0
|
|
12
|
+
* [LICENSE] (https://github.com/QuickCorp/QCObjects/blob/master/LICENSE.txt)
|
|
13
|
+
*
|
|
14
|
+
* Permissions of this copyleft license are conditioned on making available
|
|
15
|
+
* complete source code of licensed works and modifications under the same
|
|
16
|
+
* license or the GNU GPLv3. Copyright and license notices must be preserved.
|
|
17
|
+
* Contributors provide an express grant of patent rights. However, a larger
|
|
18
|
+
* work using the licensed work through interfaces provided by the licensed
|
|
19
|
+
* work may be distributed under different terms and without source code for
|
|
20
|
+
* the larger work.
|
|
21
|
+
*
|
|
22
|
+
* Copyright (C) 2015 Jean Machuca,<correojean@gmail.com>
|
|
23
|
+
*
|
|
24
|
+
* Everyone is permitted to copy and distribute verbatim copies of this
|
|
25
|
+
* license document, but changing it is not allowed.
|
|
26
|
+
*/
|
|
27
|
+
(function (global) {
|
|
28
|
+
"use strict";
|
|
29
|
+
type SliderParams = ControllerParams & {
|
|
30
|
+
duration:number;
|
|
31
|
+
slideIndex:number;
|
|
32
|
+
interval:number | null;
|
|
33
|
+
sliderHandlerName:string | null;
|
|
34
|
+
};
|
|
35
|
+
Package("org.qcobjects.controllers.slider", [
|
|
36
|
+
|
|
37
|
+
class SliderController extends Controller {
|
|
38
|
+
slideIndex = 0;
|
|
39
|
+
duration = 7100;
|
|
40
|
+
interval:any = null;
|
|
41
|
+
sliderHandlerName = "";
|
|
42
|
+
_componentRoot: QCObjectsElement | QCObjectsShadowedElement | HTMLElement | ShadowRoot | undefined;
|
|
43
|
+
|
|
44
|
+
constructor({component, dependencies= [], duration = 7100, slideIndex=0, interval = null, sliderHandlerName = null}:SliderParams) {
|
|
45
|
+
super({component, dependencies, duration, slideIndex, interval, sliderHandlerName} as SliderParams);
|
|
46
|
+
this.component = component;
|
|
47
|
+
this._componentRoot = (component.shadowed) ? (component.shadowRoot) : (component.body);
|
|
48
|
+
this.sliderHandlerName = "slider_" + this.component.__instanceID.toString();
|
|
49
|
+
(global as any).set(this.sliderHandlerName, this);
|
|
50
|
+
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
stop() {
|
|
55
|
+
if (this.interval != null) {
|
|
56
|
+
clearInterval(this.interval);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
plusSlidesAndStop(n:number) {
|
|
61
|
+
this.stop();
|
|
62
|
+
this.plusSlides(n);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
plusSlides(n:number) {
|
|
66
|
+
this.showSlides(this.slideIndex += n);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
currentSlide(n:number) {
|
|
70
|
+
this.stop();
|
|
71
|
+
this.showSlides(this.slideIndex = n);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
automate() {
|
|
75
|
+
this.interval = setInterval(() => {
|
|
76
|
+
this.plusSlides(1);
|
|
77
|
+
}, this.duration);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
showSlides(n:number) {
|
|
81
|
+
const slides = (this._componentRoot as QCObjectsElement)?.subelements(".qcoSlides");
|
|
82
|
+
const dots = (this._componentRoot as QCObjectsElement)?.subelements(".qcoSlider__dots--dot");
|
|
83
|
+
|
|
84
|
+
if (n > (slides.length - 1)) {
|
|
85
|
+
this.slideIndex = 0;
|
|
86
|
+
}
|
|
87
|
+
if (n < 0) {
|
|
88
|
+
this.slideIndex = 0;
|
|
89
|
+
}
|
|
90
|
+
slides.filter((slide, index)=> {return index!== this.slideIndex;}).map((slide) => {
|
|
91
|
+
return (New(ClassFactory("Fade"),{})).apply(slide, 1, 0);
|
|
92
|
+
});
|
|
93
|
+
dots.filter((dot, index)=> {return index!== this.slideIndex;}).map((dot) => {
|
|
94
|
+
return dot.classList.remove("active");
|
|
95
|
+
});
|
|
96
|
+
try {
|
|
97
|
+
dots[this.slideIndex].classList.add("active");
|
|
98
|
+
} catch (e:any) {
|
|
99
|
+
logger.debug(`Something went wrong when trying to activate a slide: ${this.slideIndex} - ${e.message}`);
|
|
100
|
+
}
|
|
101
|
+
setTimeout( () => {
|
|
102
|
+
slides.filter((slide, index)=> {return index!== this.slideIndex;}).map((slide) => {
|
|
103
|
+
slide.style.display = "none";
|
|
104
|
+
return slide.style.display;
|
|
105
|
+
});
|
|
106
|
+
try {
|
|
107
|
+
slides[this.slideIndex].style.display = "block";
|
|
108
|
+
(New(ClassFactory("Fade"), {})).apply(slides[this.slideIndex], 0, 1);
|
|
109
|
+
|
|
110
|
+
} catch (e:any) {
|
|
111
|
+
logger.debug(`Something went wrong when trying to show a slide: ${this.slideIndex} - ${e.message}`);
|
|
112
|
+
}
|
|
113
|
+
}, 700);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
fillDots() {
|
|
117
|
+
const slides = (this._componentRoot as QCObjectsElement)?.subelements(".qcoSlides");
|
|
118
|
+
slides.map((slide:QCObjectsElement | HTMLElement, index:number) => {
|
|
119
|
+
const dotHTML = document.createElement("span");
|
|
120
|
+
const dotContent = `<span class="qcoSlider__dots--dot" onclick="global.get('${this.sliderHandlerName}').currentSlide(${index})"></span>`;
|
|
121
|
+
dotHTML.innerHTML = dotContent;
|
|
122
|
+
return (this._componentRoot as QCObjectsElement)?.subelements(".qcoSlider__dots")[0].append(dotHTML);
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
done() {
|
|
128
|
+
const slides = (this._componentRoot as QCObjectsElement)?.subelements(".qcoSlides");
|
|
129
|
+
slides.filter((slide:QCObjectsElement | HTMLElement, index)=> {return index!== this.slideIndex;}).map((slide) => {
|
|
130
|
+
slide.style.display = "none";
|
|
131
|
+
return slide.style.display;
|
|
132
|
+
});
|
|
133
|
+
setTimeout( () => {
|
|
134
|
+
this.fillDots();
|
|
135
|
+
this.slideIndex = 0;
|
|
136
|
+
this.showSlides(this.slideIndex);
|
|
137
|
+
this.automate();
|
|
138
|
+
}, 3000);
|
|
139
|
+
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
]);
|
|
145
|
+
|
|
146
|
+
})((typeof module === "object" && typeof module.exports === "object") ? (
|
|
147
|
+
module.exports = (typeof globalThis !== "undefined"
|
|
148
|
+
? globalThis
|
|
149
|
+
: typeof self !== "undefined"
|
|
150
|
+
? self
|
|
151
|
+
: typeof window !== "undefined"
|
|
152
|
+
? window
|
|
153
|
+
: typeof global !== "undefined"
|
|
154
|
+
? global
|
|
155
|
+
: {})
|
|
156
|
+
) : ((typeof global === "object") ? (global) : (
|
|
157
|
+
(typeof window === "object") ? (window) : ({})
|
|
158
|
+
)));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/src/js/{org.qcobjects.controllers.swagger.js → org.qcobjects.controllers.swagger.ts}
RENAMED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { CONFIG, Controller, New, Package, SourceCSS, SourceJS } from "qcobjects";
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* QCObjects SDK 2.4
|
|
3
5
|
* ________________
|
|
@@ -22,15 +24,13 @@
|
|
|
22
24
|
* Everyone is permitted to copy and distribute verbatim copies of this
|
|
23
25
|
* license document, but changing it is not allowed.
|
|
24
26
|
*/
|
|
27
|
+
declare let SwaggerUIBundle:any;
|
|
28
|
+
declare let SwaggerUIStandalonePreset:any;
|
|
25
29
|
(function () {
|
|
26
30
|
"use strict";
|
|
27
31
|
Package("org.qcobjects.controllers.swagger", [
|
|
28
32
|
|
|
29
33
|
class SwaggerUIController extends Controller {
|
|
30
|
-
constructor({component, dependencies = []}) {
|
|
31
|
-
super({component, dependencies});
|
|
32
|
-
|
|
33
|
-
}
|
|
34
34
|
|
|
35
35
|
startSwaggerUI() {
|
|
36
36
|
// Begin Swagger UI call region
|
|
@@ -50,29 +50,28 @@
|
|
|
50
50
|
layout: "StandaloneLayout"
|
|
51
51
|
});
|
|
52
52
|
// End Swagger UI call region
|
|
53
|
-
window.ui = ui;
|
|
53
|
+
(window as any).ui = ui;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
done() {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
var swaggerUIPackagePath = CONFIG.get("swagger-ui-package-path", "node_modules/swagger-ui-dist/");
|
|
59
|
+
this.component.body.innerHTML = "<div id=\"" + CONFIG.get("swagger-ui-dom_id", "swagger-ui") + "\"></div>";
|
|
60
|
+
const swaggerUIPackagePath = CONFIG.get("swagger-ui-package-path", "node_modules/swagger-ui-dist/");
|
|
62
61
|
|
|
63
|
-
this.dependencies
|
|
62
|
+
this.dependencies?.push(New(SourceJS, {
|
|
64
63
|
url: swaggerUIPackagePath + "swagger-ui-standalone-preset.js",
|
|
65
64
|
external: CONFIG.get("swagger-ui-external", false)
|
|
66
65
|
}));
|
|
67
|
-
this.dependencies
|
|
66
|
+
this.dependencies?.push(New(SourceCSS, {
|
|
68
67
|
url: swaggerUIPackagePath + "swagger-ui.css",
|
|
69
68
|
external: CONFIG.get("swagger-ui-external", false)
|
|
70
69
|
}));
|
|
71
|
-
this.dependencies
|
|
70
|
+
this.dependencies?.push(New(SourceJS, {
|
|
72
71
|
url: swaggerUIPackagePath + "swagger-ui-bundle.js",
|
|
73
72
|
external: CONFIG.get("swagger-ui-external", false),
|
|
74
|
-
done:
|
|
75
|
-
|
|
73
|
+
done: () => {
|
|
74
|
+
this.startSwaggerUI();
|
|
76
75
|
}
|
|
77
76
|
}));
|
|
78
77
|
}
|
|
@@ -81,4 +80,4 @@
|
|
|
81
80
|
|
|
82
81
|
]);
|
|
83
82
|
|
|
84
|
-
})
|
|
83
|
+
})();
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { Controller, Package } from "qcobjects";
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* QCObjects SDK 2.4
|
|
3
5
|
* ________________
|
|
@@ -27,14 +29,9 @@
|
|
|
27
29
|
Package("org.qcobjects.controllers",[
|
|
28
30
|
|
|
29
31
|
class GenericController extends Controller {
|
|
30
|
-
constructor ({component, dependencies = []}) {
|
|
31
|
-
super({component, dependencies});
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
|
|
35
32
|
|
|
36
33
|
}
|
|
37
34
|
|
|
38
35
|
]);
|
|
39
36
|
|
|
40
|
-
})
|
|
37
|
+
})();
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
declare const Fade: any;
|
|
2
|
+
declare const Move: any;
|
|
3
|
+
declare const MoveXInFromRight: any;
|
|
4
|
+
declare const MoveXInFromLeft: any;
|
|
5
|
+
declare const MoveYInFromBottom: any;
|
|
6
|
+
declare const MoveYInFromTop: any;
|
|
7
|
+
declare const RotateX: any;
|
|
8
|
+
declare const RotateY: any;
|
|
9
|
+
declare const RotateZ: any;
|
|
10
|
+
declare const Rotate: any;
|
|
11
|
+
declare const Radius: any;
|
|
12
|
+
declare const Resize: any;
|
|
13
|
+
declare const WipeLeft: any;
|
|
14
|
+
declare const WipeRight: any;
|
|
15
|
+
declare const WipeUp: any;
|
|
16
|
+
declare const WipeDown: any;
|
|
17
|
+
declare const ModalFade: any;
|
|
18
|
+
declare const ModalMoveDown: any;
|
|
19
|
+
declare const ModalMoveUp: any;
|
|
20
|
+
export { Fade, Move, MoveXInFromRight, MoveXInFromLeft, MoveYInFromBottom, MoveYInFromTop, RotateX, RotateY, RotateZ, Rotate, Radius, Resize, WipeLeft, WipeRight, WipeUp, WipeDown, ModalFade, ModalMoveDown, ModalMoveUp };
|
|
@@ -0,0 +1,430 @@
|
|
|
1
|
+
import { Effect, Package, QCObjectsElement, logger } from "qcobjects";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* QCObjects SDK 2.4
|
|
5
|
+
* ________________
|
|
6
|
+
*
|
|
7
|
+
* Author: Jean Machuca <correojean@gmail.com>
|
|
8
|
+
*
|
|
9
|
+
* Cross Browser Javascript Framework for MVC Patterns
|
|
10
|
+
* QuickCorp/QCObjects is licensed under the
|
|
11
|
+
* GNU Lesser General Public License v3.0
|
|
12
|
+
* [LICENSE] (https://github.com/QuickCorp/QCObjects/blob/master/LICENSE.txt)
|
|
13
|
+
*
|
|
14
|
+
* Permissions of this copyleft license are conditioned on making available
|
|
15
|
+
* complete source code of licensed works and modifications under the same
|
|
16
|
+
* license or the GNU GPLv3. Copyright and license notices must be preserved.
|
|
17
|
+
* Contributors provide an express grant of patent rights. However, a larger
|
|
18
|
+
* work using the licensed work through interfaces provided by the licensed
|
|
19
|
+
* work may be distributed under different terms and without source code for
|
|
20
|
+
* the larger work.
|
|
21
|
+
*
|
|
22
|
+
* Copyright (C) 2015 Jean Machuca,<correojean@gmail.com>
|
|
23
|
+
*
|
|
24
|
+
* Everyone is permitted to copy and distribute verbatim copies of this
|
|
25
|
+
* license document, but changing it is not allowed.
|
|
26
|
+
*/
|
|
27
|
+
const _top:any = (typeof module === "object" && typeof module.exports === "object") ? (
|
|
28
|
+
module.exports = (typeof globalThis !== "undefined"
|
|
29
|
+
? globalThis
|
|
30
|
+
: typeof self !== "undefined"
|
|
31
|
+
? self
|
|
32
|
+
: typeof window !== "undefined"
|
|
33
|
+
? window
|
|
34
|
+
: typeof global !== "undefined"
|
|
35
|
+
? global
|
|
36
|
+
: {})
|
|
37
|
+
) : ((typeof global === "object") ? (global) : (
|
|
38
|
+
(typeof window === "object") ? (window) : ({})
|
|
39
|
+
));
|
|
40
|
+
|
|
41
|
+
(function () {
|
|
42
|
+
"use strict";
|
|
43
|
+
|
|
44
|
+
type MoveElement = HTMLElement & {
|
|
45
|
+
width:number;
|
|
46
|
+
height:number;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
class Fade extends Effect {
|
|
50
|
+
duration = 1000;
|
|
51
|
+
|
|
52
|
+
apply(element:HTMLElement, alphaFrom:number, alphaTo:number) {
|
|
53
|
+
const da = alphaTo - alphaFrom;
|
|
54
|
+
this.animate({
|
|
55
|
+
duration: this.duration,
|
|
56
|
+
timing(timeFraction) {
|
|
57
|
+
return timeFraction;
|
|
58
|
+
},
|
|
59
|
+
draw(progress) {
|
|
60
|
+
logger.debug("animation progress: " + progress.toString());
|
|
61
|
+
const alpha = alphaFrom + (progress * da / 100);
|
|
62
|
+
logger.debug("alpha: " + alpha.toString());
|
|
63
|
+
element.style.opacity = alpha.toString();
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
class Move extends Effect {
|
|
70
|
+
duration = 1000;
|
|
71
|
+
|
|
72
|
+
apply(element:MoveElement, xfrom:number, yfrom:number, xto:number, yto:number) {
|
|
73
|
+
const dx = xto - xfrom;
|
|
74
|
+
const dy = yto - yfrom;
|
|
75
|
+
element.style.transform = "translate(" + xfrom + "px," + yfrom + "px)";
|
|
76
|
+
this.animate({
|
|
77
|
+
duration: this.duration,
|
|
78
|
+
timing(timeFraction) {
|
|
79
|
+
return timeFraction;
|
|
80
|
+
},
|
|
81
|
+
draw(progress) {
|
|
82
|
+
logger.debug("animation progress: " + progress.toString());
|
|
83
|
+
const y = yfrom + (progress * dy / 100);
|
|
84
|
+
const x = xfrom + (progress * dx / 100);
|
|
85
|
+
logger.debug("x: " + x.toString() + " y:" + y.toString());
|
|
86
|
+
element.style.transform = "translate(" + x + "px," + y + "px)";
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
Package("org.qcobjects.effects.base", [
|
|
94
|
+
Fade,
|
|
95
|
+
Move
|
|
96
|
+
]);
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
class MoveXInFromRight extends Move {
|
|
101
|
+
duration = 1000;
|
|
102
|
+
|
|
103
|
+
apply(element:MoveElement) {
|
|
104
|
+
super.apply.call(this, element, element.width, 0, 0, 0);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
class MoveXInFromLeft extends Move {
|
|
109
|
+
duration = 1000;
|
|
110
|
+
|
|
111
|
+
apply(element:MoveElement) {
|
|
112
|
+
super.apply.call(this, element, -element.width, 0, 0, 0);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
class MoveYInFromBottom extends Move {
|
|
117
|
+
duration = 1000;
|
|
118
|
+
|
|
119
|
+
apply(element:MoveElement) {
|
|
120
|
+
super.apply.call(this, element, 0, element.height, 0, 0);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
class MoveYInFromTop extends Move {
|
|
126
|
+
duration = 1000;
|
|
127
|
+
|
|
128
|
+
apply(element:MoveElement ) {
|
|
129
|
+
super.apply.call(this, element, 0, -element.height, 0, 0);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
class RotateX extends Effect {
|
|
134
|
+
duration = 1000;
|
|
135
|
+
|
|
136
|
+
apply(element:HTMLElement, angleFrom:number, angleTo:number) {
|
|
137
|
+
const da = angleTo - angleFrom;
|
|
138
|
+
this.animate({
|
|
139
|
+
duration: this.duration,
|
|
140
|
+
timing(timeFraction) {
|
|
141
|
+
return timeFraction;
|
|
142
|
+
},
|
|
143
|
+
draw(progress) {
|
|
144
|
+
logger.debug("animation progress: " + progress.toString());
|
|
145
|
+
const angle = Math.round(angleFrom + (progress * da / 100));
|
|
146
|
+
logger.debug("angle: " + angle.toString());
|
|
147
|
+
element.style.transform = "rotate3d(1,0,0," + angle.toString() + "deg)";
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
class RotateY extends Effect {
|
|
155
|
+
duration = 1000;
|
|
156
|
+
|
|
157
|
+
apply(element:HTMLElement, angleFrom:number, angleTo:number) {
|
|
158
|
+
const da = angleTo - angleFrom;
|
|
159
|
+
this.animate({
|
|
160
|
+
duration: this.duration,
|
|
161
|
+
timing(timeFraction) {
|
|
162
|
+
return timeFraction;
|
|
163
|
+
},
|
|
164
|
+
draw(progress) {
|
|
165
|
+
logger.debug("animation progress: " + progress.toString());
|
|
166
|
+
const angle = Math.round(angleFrom + (progress * da / 100));
|
|
167
|
+
logger.debug("angle: " + angle.toString());
|
|
168
|
+
element.style.transform = "rotate3d(0,1,0," + angle.toString() + "deg)";
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
class RotateZ extends Effect {
|
|
175
|
+
duration = 1000;
|
|
176
|
+
|
|
177
|
+
apply(element:HTMLElement, angleFrom:number, angleTo:number) {
|
|
178
|
+
const da = angleTo - angleFrom;
|
|
179
|
+
this.animate({
|
|
180
|
+
duration: this.duration,
|
|
181
|
+
timing(timeFraction) {
|
|
182
|
+
return timeFraction;
|
|
183
|
+
},
|
|
184
|
+
draw(progress) {
|
|
185
|
+
logger.debug("animation progress: " + progress.toString());
|
|
186
|
+
const angle = Math.round(angleFrom + (progress * da / 100));
|
|
187
|
+
logger.debug("angle: " + angle.toString());
|
|
188
|
+
element.style.transform = "rotate3d(0,0,1," + angle.toString() + "deg)";
|
|
189
|
+
}
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
class Rotate extends Effect {
|
|
196
|
+
duration = 1000;
|
|
197
|
+
|
|
198
|
+
apply(element:HTMLElement, angleFrom:number, angleTo:number) {
|
|
199
|
+
const da = angleTo - angleFrom;
|
|
200
|
+
this.animate({
|
|
201
|
+
duration: this.duration,
|
|
202
|
+
timing(timeFraction) {
|
|
203
|
+
return timeFraction;
|
|
204
|
+
},
|
|
205
|
+
draw(progress) {
|
|
206
|
+
logger.debug("animation progress: " + progress.toString());
|
|
207
|
+
const angle = Math.round(angleFrom + (progress * da / 100));
|
|
208
|
+
logger.debug("angle: " + angle.toString());
|
|
209
|
+
element.style.transform = "rotate3d(1,1,1," + angle.toString() + "deg)";
|
|
210
|
+
}
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
class Radius extends Effect {
|
|
216
|
+
duration = 1000;
|
|
217
|
+
|
|
218
|
+
apply(element:HTMLElement, radiusFrom:number, radiusTo:number) {
|
|
219
|
+
const dr = radiusTo - radiusFrom;
|
|
220
|
+
this.animate({
|
|
221
|
+
duration: this.duration,
|
|
222
|
+
timing(timeFraction) {
|
|
223
|
+
return timeFraction;
|
|
224
|
+
},
|
|
225
|
+
draw(progress) {
|
|
226
|
+
logger.debug("animation progress: " + progress.toString());
|
|
227
|
+
const radius = radiusFrom + (progress * dr / 100);
|
|
228
|
+
logger.debug("radius: " + radius.toString());
|
|
229
|
+
element.style.borderRadius = radius.toString() + "px";
|
|
230
|
+
}
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
class Resize extends Effect {
|
|
237
|
+
duration = 1000;
|
|
238
|
+
|
|
239
|
+
apply(element:HTMLElement, scaleFrom:number, scaleTo:number) {
|
|
240
|
+
const ds = scaleTo - scaleFrom;
|
|
241
|
+
this.animate({
|
|
242
|
+
duration: this.duration,
|
|
243
|
+
timing(timeFraction) {
|
|
244
|
+
return timeFraction;
|
|
245
|
+
},
|
|
246
|
+
draw(progress) {
|
|
247
|
+
logger.debug("animation progress: " + progress.toString());
|
|
248
|
+
const scale = scaleFrom + (progress * ds / 100);
|
|
249
|
+
logger.debug("resize: " + scale.toString());
|
|
250
|
+
element.style.transformOrigin = "center";
|
|
251
|
+
element.style.transform = "scale(" + scale + "," + scale + ")";
|
|
252
|
+
}
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
class WipeLeft extends Effect {
|
|
259
|
+
duration = 1000;
|
|
260
|
+
|
|
261
|
+
apply(element:HTMLElement, scaleFrom:number, scaleTo:number) {
|
|
262
|
+
const ds = scaleTo - scaleFrom;
|
|
263
|
+
this.animate({
|
|
264
|
+
duration: this.duration,
|
|
265
|
+
timing(timeFraction) {
|
|
266
|
+
return timeFraction;
|
|
267
|
+
},
|
|
268
|
+
draw(progress) {
|
|
269
|
+
logger.debug("animation progress: " + progress.toString());
|
|
270
|
+
const scale = scaleFrom + (progress * ds / 100);
|
|
271
|
+
logger.debug("wipe: " + scale.toString());
|
|
272
|
+
element.style.transformOrigin = "right";
|
|
273
|
+
element.style.transform = "scaleX(" + scale + ")";
|
|
274
|
+
}
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
class WipeRight extends Effect {
|
|
281
|
+
duration = 1000;
|
|
282
|
+
|
|
283
|
+
apply(element:HTMLElement, scaleFrom:number, scaleTo:number) {
|
|
284
|
+
const ds = scaleTo - scaleFrom;
|
|
285
|
+
this.animate({
|
|
286
|
+
duration: this.duration,
|
|
287
|
+
timing(timeFraction) {
|
|
288
|
+
return timeFraction;
|
|
289
|
+
},
|
|
290
|
+
draw(progress) {
|
|
291
|
+
logger.debug("animation progress: " + progress.toString());
|
|
292
|
+
const scale = scaleFrom + (progress * ds / 100);
|
|
293
|
+
logger.debug("wipe: " + scale.toString());
|
|
294
|
+
element.style.transformOrigin = "left";
|
|
295
|
+
element.style.transform = "scaleX(" + scale + ")";
|
|
296
|
+
}
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
class WipeUp extends Effect {
|
|
303
|
+
|
|
304
|
+
duration = 1000;
|
|
305
|
+
|
|
306
|
+
apply(element:HTMLElement, scaleFrom:number, scaleTo:number) {
|
|
307
|
+
const ds = scaleTo - scaleFrom;
|
|
308
|
+
this.animate({
|
|
309
|
+
duration: this.duration,
|
|
310
|
+
timing(timeFraction) {
|
|
311
|
+
return timeFraction;
|
|
312
|
+
},
|
|
313
|
+
draw(progress) {
|
|
314
|
+
logger.debug("animation progress: " + progress.toString());
|
|
315
|
+
const scale = scaleFrom + (progress * ds / 100);
|
|
316
|
+
logger.debug("wipe: " + scale.toString());
|
|
317
|
+
element.style.transformOrigin = "bottom";
|
|
318
|
+
element.style.transform = "scaleY(" + scale + ")";
|
|
319
|
+
}
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
class WipeDown extends Effect {
|
|
326
|
+
duration = 1000;
|
|
327
|
+
|
|
328
|
+
apply(element:HTMLElement, scaleFrom:number, scaleTo:number) {
|
|
329
|
+
const ds = scaleTo - scaleFrom;
|
|
330
|
+
this.animate({
|
|
331
|
+
duration: this.duration,
|
|
332
|
+
timing(timeFraction) {
|
|
333
|
+
return timeFraction;
|
|
334
|
+
},
|
|
335
|
+
draw(progress) {
|
|
336
|
+
logger.debug("animation progress: " + progress.toString());
|
|
337
|
+
const scale = scaleFrom + (progress * ds / 100);
|
|
338
|
+
logger.debug("wipe: " + scale.toString());
|
|
339
|
+
element.style.transformOrigin = "top";
|
|
340
|
+
element.style.transform = "scaleY(" + scale + ")";
|
|
341
|
+
}
|
|
342
|
+
});
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
Package("org.qcobjects.effects.extended", [
|
|
347
|
+
MoveXInFromRight,
|
|
348
|
+
MoveXInFromLeft,
|
|
349
|
+
MoveYInFromBottom,
|
|
350
|
+
MoveYInFromTop,
|
|
351
|
+
RotateX,
|
|
352
|
+
RotateY,
|
|
353
|
+
RotateZ,
|
|
354
|
+
Rotate,
|
|
355
|
+
Radius,
|
|
356
|
+
Resize,
|
|
357
|
+
WipeLeft,
|
|
358
|
+
WipeRight,
|
|
359
|
+
WipeUp,
|
|
360
|
+
WipeDown
|
|
361
|
+
|
|
362
|
+
]);
|
|
363
|
+
|
|
364
|
+
class ModalFade extends Fade {
|
|
365
|
+
duration = 500;
|
|
366
|
+
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
class ModalMoveDown extends Move {
|
|
370
|
+
duration = 300;
|
|
371
|
+
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
class ModalMoveUp extends Move {
|
|
375
|
+
|
|
376
|
+
duration = 800;
|
|
377
|
+
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
|
|
381
|
+
Package("org.qcobjects.modal.effects", [
|
|
382
|
+
ModalFade,
|
|
383
|
+
ModalMoveDown,
|
|
384
|
+
ModalMoveUp
|
|
385
|
+
|
|
386
|
+
]);
|
|
387
|
+
|
|
388
|
+
})();
|
|
389
|
+
|
|
390
|
+
const Fade = _top.Fade;
|
|
391
|
+
const Move = _top.Fade;
|
|
392
|
+
const MoveXInFromRight = _top.MoveXInFromRight;
|
|
393
|
+
const MoveXInFromLeft = _top.MoveXInFromLeft;
|
|
394
|
+
const MoveYInFromBottom = _top.MoveYInFromBottom;
|
|
395
|
+
const MoveYInFromTop = _top.MoveYInFromTop;
|
|
396
|
+
const RotateX = _top.RotateX;
|
|
397
|
+
const RotateY = _top.RotateY;
|
|
398
|
+
const RotateZ = _top.RotateZ;
|
|
399
|
+
const Rotate = _top.Rotate;
|
|
400
|
+
const Radius = _top.Radius;
|
|
401
|
+
const Resize = _top.Resize;
|
|
402
|
+
const WipeLeft = _top.WipeLeft;
|
|
403
|
+
const WipeRight = _top.WipeRight;
|
|
404
|
+
const WipeUp = _top.WipeUp;
|
|
405
|
+
const WipeDown = _top.WipeDown;
|
|
406
|
+
const ModalFade = _top.ModalFade;
|
|
407
|
+
const ModalMoveDown = _top.ModalMoveDown;
|
|
408
|
+
const ModalMoveUp = _top.ModalMoveUp;
|
|
409
|
+
|
|
410
|
+
export {
|
|
411
|
+
Fade,
|
|
412
|
+
Move,
|
|
413
|
+
MoveXInFromRight,
|
|
414
|
+
MoveXInFromLeft,
|
|
415
|
+
MoveYInFromBottom,
|
|
416
|
+
MoveYInFromTop,
|
|
417
|
+
RotateX,
|
|
418
|
+
RotateY,
|
|
419
|
+
RotateZ,
|
|
420
|
+
Rotate,
|
|
421
|
+
Radius,
|
|
422
|
+
Resize,
|
|
423
|
+
WipeLeft,
|
|
424
|
+
WipeRight,
|
|
425
|
+
WipeUp,
|
|
426
|
+
WipeDown,
|
|
427
|
+
ModalFade,
|
|
428
|
+
ModalMoveDown,
|
|
429
|
+
ModalMoveUp
|
|
430
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|