@hpcc-js/common 3.7.5 → 3.7.7
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/LICENSE +43 -43
- package/README.md +59 -59
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +1 -1
- package/dist/index.umd.cjs.map +1 -1
- package/package.json +7 -5
- package/src/CanvasWidget.ts +31 -31
- package/src/Class.ts +72 -72
- package/src/Database.ts +859 -860
- package/src/Entity.ts +235 -235
- package/src/EntityCard.ts +66 -66
- package/src/EntityPin.ts +103 -103
- package/src/EntityRect.css +15 -15
- package/src/EntityRect.ts +254 -254
- package/src/EntityVertex.ts +86 -86
- package/src/FAChar.css +2 -2
- package/src/FAChar.ts +89 -89
- package/src/HTMLWidget.ts +191 -191
- package/src/IList.ts +4 -4
- package/src/IMenu.ts +5 -5
- package/src/Icon.css +9 -9
- package/src/Icon.ts +176 -176
- package/src/Image.ts +104 -104
- package/src/List.css +12 -12
- package/src/List.ts +102 -102
- package/src/Menu.css +22 -22
- package/src/Menu.ts +139 -139
- package/src/Palette.ts +341 -341
- package/src/Platform.ts +124 -125
- package/src/ProgressBar.ts +115 -115
- package/src/PropertyExt.ts +770 -770
- package/src/ResizeSurface.css +38 -38
- package/src/ResizeSurface.ts +225 -225
- package/src/SVGWidget.ts +583 -583
- package/src/SVGZoomWidget.css +11 -11
- package/src/SVGZoomWidget.ts +427 -427
- package/src/Shape.css +3 -3
- package/src/Shape.ts +186 -186
- package/src/Surface.css +39 -39
- package/src/Surface.ts +364 -364
- package/src/Text.css +3 -3
- package/src/Text.ts +131 -131
- package/src/TextBox.css +3 -3
- package/src/TextBox.ts +183 -183
- package/src/TitleBar.css +114 -114
- package/src/TitleBar.ts +407 -407
- package/src/Transition.ts +45 -45
- package/src/Utility.ts +843 -843
- package/src/Widget.css +7 -7
- package/src/Widget.ts +731 -731
- package/src/WidgetArray.ts +15 -15
- package/src/__package__.ts +3 -3
- package/src/index.ts +55 -55
- package/types/Database.d.ts +1 -1
package/src/Platform.ts
CHANGED
|
@@ -1,125 +1,124 @@
|
|
|
1
|
-
const _version = "1.14.2-dev";
|
|
2
|
-
export function version() {
|
|
3
|
-
return _version;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
export const ieVersion = (function () {
|
|
7
|
-
const ua = navigator.userAgent;
|
|
8
|
-
let tem;
|
|
9
|
-
const M = ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || [];
|
|
10
|
-
if (/trident/i.test(M[1])) {
|
|
11
|
-
tem = /\brv[ :]+(\d+)/g.exec(ua) || [];
|
|
12
|
-
return parseFloat(tem[1]);
|
|
13
|
-
}
|
|
14
|
-
if (/msie/i.test(M[1])) {
|
|
15
|
-
return parseFloat(M[2]);
|
|
16
|
-
}
|
|
17
|
-
return null;
|
|
18
|
-
})();
|
|
19
|
-
|
|
20
|
-
export const isIE = ieVersion !== null;
|
|
21
|
-
export const svgMarkerGlitch = isIE && ieVersion <= 12;
|
|
22
|
-
|
|
23
|
-
let _scrollBarWidth = null;
|
|
24
|
-
export function getScrollbarWidth() {
|
|
25
|
-
if (_scrollBarWidth === null) {
|
|
26
|
-
const outer = document.createElement("div");
|
|
27
|
-
outer.style.visibility = "hidden";
|
|
28
|
-
outer.style.width = "100px";
|
|
29
|
-
// @ts-ignore
|
|
30
|
-
outer.style.msOverflowStyle = "scrollbar";
|
|
31
|
-
|
|
32
|
-
document.body.appendChild(outer);
|
|
33
|
-
|
|
34
|
-
const widthNoScroll = outer.offsetWidth;
|
|
35
|
-
outer.style.overflow = "scroll";
|
|
36
|
-
|
|
37
|
-
const inner = document.createElement("div");
|
|
38
|
-
inner.style.width = "100%";
|
|
39
|
-
outer.appendChild(inner);
|
|
40
|
-
|
|
41
|
-
const widthWithScroll = inner.offsetWidth;
|
|
42
|
-
|
|
43
|
-
outer.parentNode.removeChild(outer);
|
|
44
|
-
|
|
45
|
-
_scrollBarWidth = widthNoScroll - widthWithScroll;
|
|
46
|
-
}
|
|
47
|
-
return _scrollBarWidth;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
// Polyfills ---
|
|
51
|
-
(window as any).MutationObserver = (window as any).MutationObserver || (window as any).WebKitMutationObserver || (window as any).MozMutationObserver || function (callback) {
|
|
52
|
-
// Just enough for HTMLOverlay and C3 ---
|
|
53
|
-
this.callback = callback;
|
|
54
|
-
this.listeners = [];
|
|
55
|
-
|
|
56
|
-
const MutationListener = function (callback2, domNode, type) {
|
|
57
|
-
this.callback = callback2;
|
|
58
|
-
this.domNode = domNode;
|
|
59
|
-
this.type = type;
|
|
60
|
-
};
|
|
61
|
-
MutationListener.prototype = {
|
|
62
|
-
handleEvent(evt) {
|
|
63
|
-
const mutation = {
|
|
64
|
-
type: this.type,
|
|
65
|
-
target: this.domNode,
|
|
66
|
-
addedNodes: [],
|
|
67
|
-
removedNodes: [],
|
|
68
|
-
previousSibling: evt.target.previousSibling,
|
|
69
|
-
nextSibling: evt.target.nextSibling,
|
|
70
|
-
attributeName: null,
|
|
71
|
-
attributeNamespace: null,
|
|
72
|
-
oldValue: null
|
|
73
|
-
};
|
|
74
|
-
this.callback([mutation]);
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
this.observe = function (domNode, config) {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
domNode.addEventListener("
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
item.domNode.removeEventListener("
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
};
|
|
1
|
+
const _version = "1.14.2-dev";
|
|
2
|
+
export function version() {
|
|
3
|
+
return _version;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export const ieVersion = (function () {
|
|
7
|
+
const ua = navigator.userAgent;
|
|
8
|
+
let tem;
|
|
9
|
+
const M = ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || [];
|
|
10
|
+
if (/trident/i.test(M[1])) {
|
|
11
|
+
tem = /\brv[ :]+(\d+)/g.exec(ua) || [];
|
|
12
|
+
return parseFloat(tem[1]);
|
|
13
|
+
}
|
|
14
|
+
if (/msie/i.test(M[1])) {
|
|
15
|
+
return parseFloat(M[2]);
|
|
16
|
+
}
|
|
17
|
+
return null;
|
|
18
|
+
})();
|
|
19
|
+
|
|
20
|
+
export const isIE = ieVersion !== null;
|
|
21
|
+
export const svgMarkerGlitch = isIE && ieVersion <= 12;
|
|
22
|
+
|
|
23
|
+
let _scrollBarWidth = null;
|
|
24
|
+
export function getScrollbarWidth() {
|
|
25
|
+
if (_scrollBarWidth === null) {
|
|
26
|
+
const outer = document.createElement("div");
|
|
27
|
+
outer.style.visibility = "hidden";
|
|
28
|
+
outer.style.width = "100px";
|
|
29
|
+
// @ts-ignore
|
|
30
|
+
outer.style.msOverflowStyle = "scrollbar";
|
|
31
|
+
|
|
32
|
+
document.body.appendChild(outer);
|
|
33
|
+
|
|
34
|
+
const widthNoScroll = outer.offsetWidth;
|
|
35
|
+
outer.style.overflow = "scroll";
|
|
36
|
+
|
|
37
|
+
const inner = document.createElement("div");
|
|
38
|
+
inner.style.width = "100%";
|
|
39
|
+
outer.appendChild(inner);
|
|
40
|
+
|
|
41
|
+
const widthWithScroll = inner.offsetWidth;
|
|
42
|
+
|
|
43
|
+
outer.parentNode.removeChild(outer);
|
|
44
|
+
|
|
45
|
+
_scrollBarWidth = widthNoScroll - widthWithScroll;
|
|
46
|
+
}
|
|
47
|
+
return _scrollBarWidth;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Polyfills ---
|
|
51
|
+
(window as any).MutationObserver = (window as any).MutationObserver || (window as any).WebKitMutationObserver || (window as any).MozMutationObserver || function (callback) {
|
|
52
|
+
// Just enough for HTMLOverlay and C3 ---
|
|
53
|
+
this.callback = callback;
|
|
54
|
+
this.listeners = [];
|
|
55
|
+
|
|
56
|
+
const MutationListener = function (callback2, domNode, type) {
|
|
57
|
+
this.callback = callback2;
|
|
58
|
+
this.domNode = domNode;
|
|
59
|
+
this.type = type;
|
|
60
|
+
};
|
|
61
|
+
MutationListener.prototype = {
|
|
62
|
+
handleEvent(evt) {
|
|
63
|
+
const mutation = {
|
|
64
|
+
type: this.type,
|
|
65
|
+
target: this.domNode,
|
|
66
|
+
addedNodes: [],
|
|
67
|
+
removedNodes: [],
|
|
68
|
+
previousSibling: evt.target.previousSibling,
|
|
69
|
+
nextSibling: evt.target.nextSibling,
|
|
70
|
+
attributeName: null,
|
|
71
|
+
attributeNamespace: null,
|
|
72
|
+
oldValue: null
|
|
73
|
+
};
|
|
74
|
+
this.callback([mutation]);
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
this.observe = function (domNode, config) {
|
|
79
|
+
if (config.attributes) {
|
|
80
|
+
const listener = new MutationListener(this.callback, domNode, "attributes");
|
|
81
|
+
this.listeners.push(listener);
|
|
82
|
+
domNode.addEventListener("DOMAttrModified", listener, true);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
if (config.characterData) {
|
|
86
|
+
const listener = new MutationListener(this.callback, domNode, "characterData");
|
|
87
|
+
this.listeners.push(listener);
|
|
88
|
+
domNode.addEventListener("DOMCharacterDataModified", listener, true);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
if (config.childList) {
|
|
92
|
+
const listener = new MutationListener(this.callback, domNode, "childList");
|
|
93
|
+
this.listeners.push(listener);
|
|
94
|
+
domNode.addEventListener("DOMNodeInserted", listener, true);
|
|
95
|
+
domNode.addEventListener("DOMNodeRemoved", listener, true);
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
this.disconnect = function () {
|
|
100
|
+
this.listeners.forEach(function (item) {
|
|
101
|
+
switch (item.type) {
|
|
102
|
+
case "attributes":
|
|
103
|
+
item.domNode.removeEventListener("DOMAttrModified", item, true);
|
|
104
|
+
break;
|
|
105
|
+
case "characterData":
|
|
106
|
+
item.domNode.removeEventListener("DOMCharacterDataModified", item, true);
|
|
107
|
+
break;
|
|
108
|
+
case "childList":
|
|
109
|
+
item.domNode.removeEventListener("DOMNodeRemoved", item, true);
|
|
110
|
+
item.domNode.removeEventListener("DOMNodeInserted", item, true);
|
|
111
|
+
break;
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
this.listeners = [];
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
(Math as any).sign = (Math as any).sign || function (x) {
|
|
119
|
+
x = +x; // convert to a number
|
|
120
|
+
if (x === 0 || isNaN(x)) {
|
|
121
|
+
return x;
|
|
122
|
+
}
|
|
123
|
+
return x > 0 ? 1 : -1;
|
|
124
|
+
};
|
package/src/ProgressBar.ts
CHANGED
|
@@ -1,115 +1,115 @@
|
|
|
1
|
-
import { PropertyExt } from "./PropertyExt.ts";
|
|
2
|
-
|
|
3
|
-
export class ProgressBar extends PropertyExt {
|
|
4
|
-
|
|
5
|
-
protected _elementID: string;
|
|
6
|
-
protected _running: boolean = false;
|
|
7
|
-
protected _style;
|
|
8
|
-
|
|
9
|
-
constructor() {
|
|
10
|
-
super();
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
calcCSS(halflife: number, perc: number) {
|
|
14
|
-
const bar_size = this.size();
|
|
15
|
-
const bar_color = this.color();
|
|
16
|
-
const blur_opacity = this.blurOpacity();
|
|
17
|
-
const blur_opacity_hex = blur_opacity * 255 >= 16 ? Math.floor(blur_opacity * 255).toString(16).slice(-2) : "00";
|
|
18
|
-
const blur_color = this.blurColor() || bar_color;
|
|
19
|
-
const blur_size = this.blurSize();
|
|
20
|
-
const blur_fx = this.blurBar() ? `background: radial-gradient(ellipse at 50% 50%, ${blur_color}${blur_opacity_hex}, ${blur_color}00, #00000000 ${blur_size}px);` : "";
|
|
21
|
-
return `
|
|
22
|
-
#${this._elementID}::before{
|
|
23
|
-
content:" ";display:block;position:absolute;
|
|
24
|
-
height:${bar_size}px;width:${perc}%;
|
|
25
|
-
left:0;top:0;
|
|
26
|
-
background-color: ${bar_color};
|
|
27
|
-
transition: width ${(halflife / 1000)}s;
|
|
28
|
-
}
|
|
29
|
-
#${this._elementID}::after{
|
|
30
|
-
content:" ";display:block;position:absolute;
|
|
31
|
-
height:${blur_size}px;width:${blur_size * 2}px;
|
|
32
|
-
left:calc(${perc}% - ${blur_size}px);
|
|
33
|
-
top:${-((blur_size / 2) - (bar_size / 2))}px;
|
|
34
|
-
background-color: ${bar_color};
|
|
35
|
-
transition: left ${(halflife / 1000)}s;
|
|
36
|
-
transform: rotate(1deg) translate(-${blur_size / 2.5}px,0px) scale(1.5,0.5);
|
|
37
|
-
${blur_fx}
|
|
38
|
-
}
|
|
39
|
-
`;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
start() {
|
|
43
|
-
this._running = true;
|
|
44
|
-
this.updateProgress(this.halfLife(), 10);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
finish() {
|
|
48
|
-
this.updateProgress(100, 100);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
enter(domNode, element) {
|
|
52
|
-
this._elementID = element.attr("id");
|
|
53
|
-
if (!this._elementID) throw new Error("Target element requires an id attribute.");
|
|
54
|
-
this._style = element.insert("style");
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
exit(_domNode, _element) {
|
|
58
|
-
this._running = false;
|
|
59
|
-
if (this._style)
|
|
60
|
-
this._style.remove();
|
|
61
|
-
delete this._style;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
protected updateProgress(halflife: number, perc: number) {
|
|
65
|
-
if (!this._running) return;
|
|
66
|
-
if (this._style) {
|
|
67
|
-
this._style.html(this.calcCSS(halflife, perc));
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
const percLimit = 95;
|
|
71
|
-
halflife *= this.decay();
|
|
72
|
-
perc = perc ? perc : 10;
|
|
73
|
-
if (perc < percLimit) {
|
|
74
|
-
setTimeout(() => {
|
|
75
|
-
const _remaining = 100 - perc;
|
|
76
|
-
this.updateProgress(halflife, perc + (_remaining / 2));
|
|
77
|
-
}, perc === 10 ? 100 : halflife);
|
|
78
|
-
} else if (perc === 100) {
|
|
79
|
-
setTimeout(() => {
|
|
80
|
-
this._running = false;
|
|
81
|
-
if (this._style) {
|
|
82
|
-
this._style.html("");
|
|
83
|
-
}
|
|
84
|
-
}, halflife);
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
ProgressBar.prototype._class += " common_ProgressBar";
|
|
89
|
-
|
|
90
|
-
export interface ProgressBar {
|
|
91
|
-
halfLife(): number;
|
|
92
|
-
halfLife(_: number): this;
|
|
93
|
-
decay(): number;
|
|
94
|
-
decay(_: number): this;
|
|
95
|
-
size(): number;
|
|
96
|
-
size(_: number): this;
|
|
97
|
-
color(): string;
|
|
98
|
-
color(_: string): this;
|
|
99
|
-
blurBar(): boolean;
|
|
100
|
-
blurBar(_: boolean): this;
|
|
101
|
-
blurSize(): number;
|
|
102
|
-
blurSize(_: number): this;
|
|
103
|
-
blurColor(): string;
|
|
104
|
-
blurColor(_: string): this;
|
|
105
|
-
blurOpacity(): number;
|
|
106
|
-
blurOpacity(_: number): this;
|
|
107
|
-
}
|
|
108
|
-
ProgressBar.prototype.publish("halfLife", 5000, "number", "Half Life");
|
|
109
|
-
ProgressBar.prototype.publish("decay", 1.2, "number", "Decay");
|
|
110
|
-
ProgressBar.prototype.publish("size", 2, "number", "Size");
|
|
111
|
-
ProgressBar.prototype.publish("color", "#2ed573", "string", "Color");
|
|
112
|
-
ProgressBar.prototype.publish("blurBar", true, "boolean", "Bar Blur");
|
|
113
|
-
ProgressBar.prototype.publish("blurSize", 50, "number", "Blur Size");
|
|
114
|
-
ProgressBar.prototype.publish("blurColor", "#7bed9f", "string", "Blur Color (hex)", null, { optional: true });
|
|
115
|
-
ProgressBar.prototype.publish("blurOpacity", 0.35, "number", "Blur Opacity");
|
|
1
|
+
import { PropertyExt } from "./PropertyExt.ts";
|
|
2
|
+
|
|
3
|
+
export class ProgressBar extends PropertyExt {
|
|
4
|
+
|
|
5
|
+
protected _elementID: string;
|
|
6
|
+
protected _running: boolean = false;
|
|
7
|
+
protected _style;
|
|
8
|
+
|
|
9
|
+
constructor() {
|
|
10
|
+
super();
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
calcCSS(halflife: number, perc: number) {
|
|
14
|
+
const bar_size = this.size();
|
|
15
|
+
const bar_color = this.color();
|
|
16
|
+
const blur_opacity = this.blurOpacity();
|
|
17
|
+
const blur_opacity_hex = blur_opacity * 255 >= 16 ? Math.floor(blur_opacity * 255).toString(16).slice(-2) : "00";
|
|
18
|
+
const blur_color = this.blurColor() || bar_color;
|
|
19
|
+
const blur_size = this.blurSize();
|
|
20
|
+
const blur_fx = this.blurBar() ? `background: radial-gradient(ellipse at 50% 50%, ${blur_color}${blur_opacity_hex}, ${blur_color}00, #00000000 ${blur_size}px);` : "";
|
|
21
|
+
return `
|
|
22
|
+
#${this._elementID}::before{
|
|
23
|
+
content:" ";display:block;position:absolute;
|
|
24
|
+
height:${bar_size}px;width:${perc}%;
|
|
25
|
+
left:0;top:0;
|
|
26
|
+
background-color: ${bar_color};
|
|
27
|
+
transition: width ${(halflife / 1000)}s;
|
|
28
|
+
}
|
|
29
|
+
#${this._elementID}::after{
|
|
30
|
+
content:" ";display:block;position:absolute;
|
|
31
|
+
height:${blur_size}px;width:${blur_size * 2}px;
|
|
32
|
+
left:calc(${perc}% - ${blur_size}px);
|
|
33
|
+
top:${-((blur_size / 2) - (bar_size / 2))}px;
|
|
34
|
+
background-color: ${bar_color};
|
|
35
|
+
transition: left ${(halflife / 1000)}s;
|
|
36
|
+
transform: rotate(1deg) translate(-${blur_size / 2.5}px,0px) scale(1.5,0.5);
|
|
37
|
+
${blur_fx}
|
|
38
|
+
}
|
|
39
|
+
`;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
start() {
|
|
43
|
+
this._running = true;
|
|
44
|
+
this.updateProgress(this.halfLife(), 10);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
finish() {
|
|
48
|
+
this.updateProgress(100, 100);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
enter(domNode, element) {
|
|
52
|
+
this._elementID = element.attr("id");
|
|
53
|
+
if (!this._elementID) throw new Error("Target element requires an id attribute.");
|
|
54
|
+
this._style = element.insert("style");
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
exit(_domNode, _element) {
|
|
58
|
+
this._running = false;
|
|
59
|
+
if (this._style)
|
|
60
|
+
this._style.remove();
|
|
61
|
+
delete this._style;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
protected updateProgress(halflife: number, perc: number) {
|
|
65
|
+
if (!this._running) return;
|
|
66
|
+
if (this._style) {
|
|
67
|
+
this._style.html(this.calcCSS(halflife, perc));
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const percLimit = 95;
|
|
71
|
+
halflife *= this.decay();
|
|
72
|
+
perc = perc ? perc : 10;
|
|
73
|
+
if (perc < percLimit) {
|
|
74
|
+
setTimeout(() => {
|
|
75
|
+
const _remaining = 100 - perc;
|
|
76
|
+
this.updateProgress(halflife, perc + (_remaining / 2));
|
|
77
|
+
}, perc === 10 ? 100 : halflife);
|
|
78
|
+
} else if (perc === 100) {
|
|
79
|
+
setTimeout(() => {
|
|
80
|
+
this._running = false;
|
|
81
|
+
if (this._style) {
|
|
82
|
+
this._style.html("");
|
|
83
|
+
}
|
|
84
|
+
}, halflife);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
ProgressBar.prototype._class += " common_ProgressBar";
|
|
89
|
+
|
|
90
|
+
export interface ProgressBar {
|
|
91
|
+
halfLife(): number;
|
|
92
|
+
halfLife(_: number): this;
|
|
93
|
+
decay(): number;
|
|
94
|
+
decay(_: number): this;
|
|
95
|
+
size(): number;
|
|
96
|
+
size(_: number): this;
|
|
97
|
+
color(): string;
|
|
98
|
+
color(_: string): this;
|
|
99
|
+
blurBar(): boolean;
|
|
100
|
+
blurBar(_: boolean): this;
|
|
101
|
+
blurSize(): number;
|
|
102
|
+
blurSize(_: number): this;
|
|
103
|
+
blurColor(): string;
|
|
104
|
+
blurColor(_: string): this;
|
|
105
|
+
blurOpacity(): number;
|
|
106
|
+
blurOpacity(_: number): this;
|
|
107
|
+
}
|
|
108
|
+
ProgressBar.prototype.publish("halfLife", 5000, "number", "Half Life");
|
|
109
|
+
ProgressBar.prototype.publish("decay", 1.2, "number", "Decay");
|
|
110
|
+
ProgressBar.prototype.publish("size", 2, "number", "Size");
|
|
111
|
+
ProgressBar.prototype.publish("color", "#2ed573", "string", "Color");
|
|
112
|
+
ProgressBar.prototype.publish("blurBar", true, "boolean", "Bar Blur");
|
|
113
|
+
ProgressBar.prototype.publish("blurSize", 50, "number", "Blur Size");
|
|
114
|
+
ProgressBar.prototype.publish("blurColor", "#7bed9f", "string", "Blur Color (hex)", null, { optional: true });
|
|
115
|
+
ProgressBar.prototype.publish("blurOpacity", 0.35, "number", "Blur Opacity");
|