@hpcc-js/common 3.7.2 → 3.7.5
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 +1 -1
- 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 +5 -5
- package/src/CanvasWidget.ts +31 -31
- package/src/Class.ts +72 -72
- package/src/Database.ts +860 -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 +125 -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/src/EntityPin.ts
CHANGED
|
@@ -1,103 +1,103 @@
|
|
|
1
|
-
import { Entity } from "./Entity.ts";
|
|
2
|
-
|
|
3
|
-
export class EntityPin extends Entity {
|
|
4
|
-
protected _element_textbox;
|
|
5
|
-
constructor() {
|
|
6
|
-
super();
|
|
7
|
-
}
|
|
8
|
-
enter(domNode, element) {
|
|
9
|
-
super.enter(domNode, element);
|
|
10
|
-
}
|
|
11
|
-
update(domNode, element) {
|
|
12
|
-
super.update.apply(this, arguments);
|
|
13
|
-
|
|
14
|
-
const is_hovering = element.classed("hovering");
|
|
15
|
-
|
|
16
|
-
this._icon_widget.render();
|
|
17
|
-
this._desc_widget.render();
|
|
18
|
-
this._title_widget.render();
|
|
19
|
-
const title_bbox = !this.titleOnlyShowOnHover() || is_hovering ? this._title_widget.getBBox(true) : { height: 0, width: 0 };
|
|
20
|
-
const icon_bbox = !this.iconOnlyShowOnHover() || is_hovering ? this._icon_widget.getBBox(true) : { height: 0, width: 0 };
|
|
21
|
-
const desc_bbox = !this.descriptionOnlyShowOnHover() || is_hovering ? this._desc_widget.getBBox(true) : { height: 0, width: 0 };
|
|
22
|
-
const _anno_h = !this.annotationOnlyShowOnHover() || is_hovering ? this.annotationIcons().length > 0 ? this.annotationDiameter() + this.padding() : 0 : 0;
|
|
23
|
-
const background_bbox = this.calcBackgroundBBox(is_hovering, title_bbox, icon_bbox, desc_bbox, _anno_h);
|
|
24
|
-
|
|
25
|
-
this._title_widget.display(!this.titleOnlyShowOnHover() || is_hovering);
|
|
26
|
-
this._icon_widget.display(!this.iconOnlyShowOnHover() || is_hovering);
|
|
27
|
-
this._desc_widget.display(!this.descriptionOnlyShowOnHover() || is_hovering);
|
|
28
|
-
|
|
29
|
-
this._background_widget
|
|
30
|
-
.height(background_bbox.height)
|
|
31
|
-
.width(background_bbox.width);
|
|
32
|
-
const icon_y = -background_bbox.height + icon_bbox.height + (this.padding() / 2);
|
|
33
|
-
const title_y = icon_y + (icon_bbox.height / 2) + (title_bbox.height / 2) + this.padding();
|
|
34
|
-
const desc_y = title_y + (title_bbox.height / 2) + (desc_bbox.height / 2) + this.padding();
|
|
35
|
-
const anno_y = desc_y + (desc_bbox.height / 2) + this.padding();
|
|
36
|
-
this._title_widget.move({
|
|
37
|
-
x: 0,
|
|
38
|
-
y: title_y
|
|
39
|
-
});
|
|
40
|
-
this._desc_widget.move({
|
|
41
|
-
x: 0,
|
|
42
|
-
y: desc_y
|
|
43
|
-
});
|
|
44
|
-
this._icon_widget.move({
|
|
45
|
-
x: 0,
|
|
46
|
-
y: icon_y
|
|
47
|
-
});
|
|
48
|
-
this.moveAnnotations(background_bbox.width / 2, anno_y);
|
|
49
|
-
|
|
50
|
-
}
|
|
51
|
-
calcHeight() {
|
|
52
|
-
const is_hovering = true;
|
|
53
|
-
this._icon_widget.render();
|
|
54
|
-
this._desc_widget.render();
|
|
55
|
-
this._title_widget.render();
|
|
56
|
-
const title_bbox = !this.titleOnlyShowOnHover() || is_hovering ? this._title_widget.getBBox(true) : { height: 0, width: 0 };
|
|
57
|
-
const icon_bbox = !this.iconOnlyShowOnHover() || is_hovering ? this._icon_widget.getBBox(true) : { height: 0, width: 0 };
|
|
58
|
-
const desc_bbox = !this.descriptionOnlyShowOnHover() || is_hovering ? this._desc_widget.getBBox(true) : { height: 0, width: 0 };
|
|
59
|
-
const _anno_h = !this.annotationOnlyShowOnHover() || is_hovering ? this.annotationIcons().length > 0 ? this.annotationDiameter() + this.padding() : 0 : 0;
|
|
60
|
-
const background_bbox = this.calcBackgroundBBox(is_hovering, title_bbox, icon_bbox, desc_bbox, _anno_h);
|
|
61
|
-
|
|
62
|
-
return background_bbox.height;
|
|
63
|
-
}
|
|
64
|
-
calcBackgroundBBox(is_hovering, title_bbox, icon_bbox, desc_bbox, _anno_h) {
|
|
65
|
-
const content_width = Math.max(title_bbox.width, icon_bbox.width, desc_bbox.width);
|
|
66
|
-
const background_bbox = {
|
|
67
|
-
width: content_width + (this.padding() * 2),
|
|
68
|
-
height: icon_bbox.height + title_bbox.height + _anno_h + this.arrowHeight() + desc_bbox.height + (this.padding() * 5)
|
|
69
|
-
};
|
|
70
|
-
let remove_padding = 0;
|
|
71
|
-
if (this.titleOnlyShowOnHover() && !is_hovering) {
|
|
72
|
-
remove_padding += this.padding();
|
|
73
|
-
}
|
|
74
|
-
if (this.iconOnlyShowOnHover() && !is_hovering) {
|
|
75
|
-
remove_padding += this.padding();
|
|
76
|
-
}
|
|
77
|
-
if (this.descriptionOnlyShowOnHover() && !is_hovering) {
|
|
78
|
-
remove_padding += this.padding();
|
|
79
|
-
}
|
|
80
|
-
if (this.annotationIcons().length === 0 || this.annotationOnlyShowOnHover() && !is_hovering) {
|
|
81
|
-
remove_padding += this.padding();
|
|
82
|
-
}
|
|
83
|
-
background_bbox.height -= remove_padding;
|
|
84
|
-
return background_bbox;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
EntityPin.prototype._class += " common_EntityPin";
|
|
88
|
-
|
|
89
|
-
export interface EntityPin {
|
|
90
|
-
titleOnlyShowOnHover(): boolean;
|
|
91
|
-
titleOnlyShowOnHover(_: boolean): this;
|
|
92
|
-
iconOnlyShowOnHover(): boolean;
|
|
93
|
-
iconOnlyShowOnHover(_: boolean): this;
|
|
94
|
-
descriptionOnlyShowOnHover(): boolean;
|
|
95
|
-
descriptionOnlyShowOnHover(_: boolean): this;
|
|
96
|
-
annotationOnlyShowOnHover(): boolean;
|
|
97
|
-
annotationOnlyShowOnHover(_: boolean): this;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
EntityPin.prototype.publish("titleOnlyShowOnHover", false, "boolean", "titleOnlyShowOnHover");
|
|
101
|
-
EntityPin.prototype.publish("iconOnlyShowOnHover", false, "boolean", "iconOnlyShowOnHover");
|
|
102
|
-
EntityPin.prototype.publish("descriptionOnlyShowOnHover", false, "boolean", "descriptionOnlyShowOnHover");
|
|
103
|
-
EntityPin.prototype.publish("annotationOnlyShowOnHover", false, "boolean", "annotationOnlyShowOnHover");
|
|
1
|
+
import { Entity } from "./Entity.ts";
|
|
2
|
+
|
|
3
|
+
export class EntityPin extends Entity {
|
|
4
|
+
protected _element_textbox;
|
|
5
|
+
constructor() {
|
|
6
|
+
super();
|
|
7
|
+
}
|
|
8
|
+
enter(domNode, element) {
|
|
9
|
+
super.enter(domNode, element);
|
|
10
|
+
}
|
|
11
|
+
update(domNode, element) {
|
|
12
|
+
super.update.apply(this, arguments);
|
|
13
|
+
|
|
14
|
+
const is_hovering = element.classed("hovering");
|
|
15
|
+
|
|
16
|
+
this._icon_widget.render();
|
|
17
|
+
this._desc_widget.render();
|
|
18
|
+
this._title_widget.render();
|
|
19
|
+
const title_bbox = !this.titleOnlyShowOnHover() || is_hovering ? this._title_widget.getBBox(true) : { height: 0, width: 0 };
|
|
20
|
+
const icon_bbox = !this.iconOnlyShowOnHover() || is_hovering ? this._icon_widget.getBBox(true) : { height: 0, width: 0 };
|
|
21
|
+
const desc_bbox = !this.descriptionOnlyShowOnHover() || is_hovering ? this._desc_widget.getBBox(true) : { height: 0, width: 0 };
|
|
22
|
+
const _anno_h = !this.annotationOnlyShowOnHover() || is_hovering ? this.annotationIcons().length > 0 ? this.annotationDiameter() + this.padding() : 0 : 0;
|
|
23
|
+
const background_bbox = this.calcBackgroundBBox(is_hovering, title_bbox, icon_bbox, desc_bbox, _anno_h);
|
|
24
|
+
|
|
25
|
+
this._title_widget.display(!this.titleOnlyShowOnHover() || is_hovering);
|
|
26
|
+
this._icon_widget.display(!this.iconOnlyShowOnHover() || is_hovering);
|
|
27
|
+
this._desc_widget.display(!this.descriptionOnlyShowOnHover() || is_hovering);
|
|
28
|
+
|
|
29
|
+
this._background_widget
|
|
30
|
+
.height(background_bbox.height)
|
|
31
|
+
.width(background_bbox.width);
|
|
32
|
+
const icon_y = -background_bbox.height + icon_bbox.height + (this.padding() / 2);
|
|
33
|
+
const title_y = icon_y + (icon_bbox.height / 2) + (title_bbox.height / 2) + this.padding();
|
|
34
|
+
const desc_y = title_y + (title_bbox.height / 2) + (desc_bbox.height / 2) + this.padding();
|
|
35
|
+
const anno_y = desc_y + (desc_bbox.height / 2) + this.padding();
|
|
36
|
+
this._title_widget.move({
|
|
37
|
+
x: 0,
|
|
38
|
+
y: title_y
|
|
39
|
+
});
|
|
40
|
+
this._desc_widget.move({
|
|
41
|
+
x: 0,
|
|
42
|
+
y: desc_y
|
|
43
|
+
});
|
|
44
|
+
this._icon_widget.move({
|
|
45
|
+
x: 0,
|
|
46
|
+
y: icon_y
|
|
47
|
+
});
|
|
48
|
+
this.moveAnnotations(background_bbox.width / 2, anno_y);
|
|
49
|
+
|
|
50
|
+
}
|
|
51
|
+
calcHeight() {
|
|
52
|
+
const is_hovering = true;
|
|
53
|
+
this._icon_widget.render();
|
|
54
|
+
this._desc_widget.render();
|
|
55
|
+
this._title_widget.render();
|
|
56
|
+
const title_bbox = !this.titleOnlyShowOnHover() || is_hovering ? this._title_widget.getBBox(true) : { height: 0, width: 0 };
|
|
57
|
+
const icon_bbox = !this.iconOnlyShowOnHover() || is_hovering ? this._icon_widget.getBBox(true) : { height: 0, width: 0 };
|
|
58
|
+
const desc_bbox = !this.descriptionOnlyShowOnHover() || is_hovering ? this._desc_widget.getBBox(true) : { height: 0, width: 0 };
|
|
59
|
+
const _anno_h = !this.annotationOnlyShowOnHover() || is_hovering ? this.annotationIcons().length > 0 ? this.annotationDiameter() + this.padding() : 0 : 0;
|
|
60
|
+
const background_bbox = this.calcBackgroundBBox(is_hovering, title_bbox, icon_bbox, desc_bbox, _anno_h);
|
|
61
|
+
|
|
62
|
+
return background_bbox.height;
|
|
63
|
+
}
|
|
64
|
+
calcBackgroundBBox(is_hovering, title_bbox, icon_bbox, desc_bbox, _anno_h) {
|
|
65
|
+
const content_width = Math.max(title_bbox.width, icon_bbox.width, desc_bbox.width);
|
|
66
|
+
const background_bbox = {
|
|
67
|
+
width: content_width + (this.padding() * 2),
|
|
68
|
+
height: icon_bbox.height + title_bbox.height + _anno_h + this.arrowHeight() + desc_bbox.height + (this.padding() * 5)
|
|
69
|
+
};
|
|
70
|
+
let remove_padding = 0;
|
|
71
|
+
if (this.titleOnlyShowOnHover() && !is_hovering) {
|
|
72
|
+
remove_padding += this.padding();
|
|
73
|
+
}
|
|
74
|
+
if (this.iconOnlyShowOnHover() && !is_hovering) {
|
|
75
|
+
remove_padding += this.padding();
|
|
76
|
+
}
|
|
77
|
+
if (this.descriptionOnlyShowOnHover() && !is_hovering) {
|
|
78
|
+
remove_padding += this.padding();
|
|
79
|
+
}
|
|
80
|
+
if (this.annotationIcons().length === 0 || this.annotationOnlyShowOnHover() && !is_hovering) {
|
|
81
|
+
remove_padding += this.padding();
|
|
82
|
+
}
|
|
83
|
+
background_bbox.height -= remove_padding;
|
|
84
|
+
return background_bbox;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
EntityPin.prototype._class += " common_EntityPin";
|
|
88
|
+
|
|
89
|
+
export interface EntityPin {
|
|
90
|
+
titleOnlyShowOnHover(): boolean;
|
|
91
|
+
titleOnlyShowOnHover(_: boolean): this;
|
|
92
|
+
iconOnlyShowOnHover(): boolean;
|
|
93
|
+
iconOnlyShowOnHover(_: boolean): this;
|
|
94
|
+
descriptionOnlyShowOnHover(): boolean;
|
|
95
|
+
descriptionOnlyShowOnHover(_: boolean): this;
|
|
96
|
+
annotationOnlyShowOnHover(): boolean;
|
|
97
|
+
annotationOnlyShowOnHover(_: boolean): this;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
EntityPin.prototype.publish("titleOnlyShowOnHover", false, "boolean", "titleOnlyShowOnHover");
|
|
101
|
+
EntityPin.prototype.publish("iconOnlyShowOnHover", false, "boolean", "iconOnlyShowOnHover");
|
|
102
|
+
EntityPin.prototype.publish("descriptionOnlyShowOnHover", false, "boolean", "descriptionOnlyShowOnHover");
|
|
103
|
+
EntityPin.prototype.publish("annotationOnlyShowOnHover", false, "boolean", "annotationOnlyShowOnHover");
|
package/src/EntityRect.css
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
.common_EntityRectList .entityRectItem {
|
|
2
|
-
margin: 6px;
|
|
3
|
-
border-width: 2px;
|
|
4
|
-
border-radius: 8px;
|
|
5
|
-
border-color: "black";
|
|
6
|
-
border-style: solid;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.common_EntityRectList .entityRectItem rect {
|
|
10
|
-
stroke-width: 4px;
|
|
11
|
-
shape-rendering: geometricPrecision;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.common_EntityRect .entity_shape>g>rect {
|
|
15
|
-
shape-rendering: geometricPrecision;
|
|
1
|
+
.common_EntityRectList .entityRectItem {
|
|
2
|
+
margin: 6px;
|
|
3
|
+
border-width: 2px;
|
|
4
|
+
border-radius: 8px;
|
|
5
|
+
border-color: "black";
|
|
6
|
+
border-style: solid;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.common_EntityRectList .entityRectItem rect {
|
|
10
|
+
stroke-width: 4px;
|
|
11
|
+
shape-rendering: geometricPrecision;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.common_EntityRect .entity_shape>g>rect {
|
|
15
|
+
shape-rendering: geometricPrecision;
|
|
16
16
|
}
|