@hpcc-js/common 2.73.2 → 2.73.3

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.
Files changed (55) hide show
  1. package/LICENSE +43 -43
  2. package/README.md +59 -59
  3. package/dist/index.es6.js +28 -28
  4. package/dist/index.es6.js.map +1 -1
  5. package/dist/index.js +30 -30
  6. package/dist/index.js.map +1 -1
  7. package/dist/index.min.js.map +1 -1
  8. package/package.json +3 -3
  9. package/src/CanvasWidget.ts +31 -31
  10. package/src/Class.ts +67 -67
  11. package/src/Database.ts +856 -856
  12. package/src/Entity.ts +235 -235
  13. package/src/EntityCard.ts +66 -66
  14. package/src/EntityPin.ts +103 -103
  15. package/src/EntityRect.css +15 -15
  16. package/src/EntityRect.ts +236 -236
  17. package/src/EntityVertex.ts +86 -86
  18. package/src/FAChar.css +2 -2
  19. package/src/FAChar.ts +82 -82
  20. package/src/HTMLWidget.ts +191 -191
  21. package/src/IList.ts +4 -4
  22. package/src/IMenu.ts +5 -5
  23. package/src/Icon.css +9 -9
  24. package/src/Icon.ts +164 -164
  25. package/src/Image.ts +95 -95
  26. package/src/List.css +13 -13
  27. package/src/List.ts +99 -99
  28. package/src/Menu.css +23 -23
  29. package/src/Menu.ts +134 -134
  30. package/src/Palette.ts +341 -341
  31. package/src/Platform.ts +125 -125
  32. package/src/ProgressBar.ts +105 -105
  33. package/src/PropertyExt.ts +793 -793
  34. package/src/ResizeSurface.css +39 -39
  35. package/src/ResizeSurface.ts +221 -221
  36. package/src/SVGWidget.ts +567 -567
  37. package/src/SVGZoomWidget.css +12 -12
  38. package/src/SVGZoomWidget.ts +426 -426
  39. package/src/Shape.css +3 -3
  40. package/src/Shape.ts +186 -186
  41. package/src/Surface.css +35 -35
  42. package/src/Surface.ts +349 -349
  43. package/src/Text.css +4 -4
  44. package/src/Text.ts +131 -131
  45. package/src/TextBox.css +4 -4
  46. package/src/TextBox.ts +168 -168
  47. package/src/TitleBar.css +99 -99
  48. package/src/TitleBar.ts +401 -401
  49. package/src/Transition.ts +45 -45
  50. package/src/Utility.ts +839 -839
  51. package/src/Widget.css +8 -8
  52. package/src/Widget.ts +730 -730
  53. package/src/WidgetArray.ts +13 -13
  54. package/src/__package__.ts +3 -3
  55. package/src/index.ts +55 -55
package/src/List.ts CHANGED
@@ -1,99 +1,99 @@
1
- import { IList } from "./IList";
2
- import { SVGWidget } from "./SVGWidget";
3
- import { TextBox } from "./TextBox";
4
-
5
- import "../src/List.css";
6
-
7
- export class List extends SVGWidget implements IList {
8
-
9
- protected _listWidgets;
10
-
11
- constructor() {
12
- super();
13
-
14
- this._listWidgets = {};
15
- }
16
-
17
- update(domNode, element) {
18
- super.update(domNode, element);
19
- const context = this;
20
-
21
- const line = element.selectAll(".line").data(this.data(), function (d) { return d; });
22
- const lineEnter = line.enter().append("g")
23
- .attr("class", "line")
24
- .each(function (d) {
25
- const newTextBox = new TextBox()
26
- .target(this)
27
- .paddingTop(0)
28
- .paddingBottom(0)
29
- .paddingLeft(8)
30
- .paddingRight(8)
31
- .text(d)
32
- .render()
33
- ;
34
- newTextBox.element()
35
- .on("click", function (d2) {
36
- context.click(d2.text());
37
- })
38
- .on("dblclick", function (d2) {
39
- context.dblclick(d2.text());
40
- })
41
- ;
42
- context._listWidgets[d] = newTextBox;
43
- })
44
- ;
45
-
46
- let listHeight = 0;
47
- let listWidth = 0;
48
- for (const key in this._listWidgets) {
49
- if (!this._listWidgets.hasOwnProperty(key)) continue;
50
- const bbox = this._listWidgets[key].getBBox();
51
- listHeight += bbox.height;
52
- if (listWidth < bbox.width)
53
- listWidth = bbox.width;
54
- }
55
-
56
- let yPos = -listHeight / 2; // + lineHeight / 2;
57
- lineEnter.merge(line).each(function (d) {
58
- const widget = context._listWidgets[d];
59
- const bbox = widget.getBBox();
60
- widget
61
- .pos({ x: 0, y: yPos + bbox.height / 2 })
62
- .anchor(context.anchor())
63
- .fixedSize({ width: listWidth, height: bbox.height })
64
- .render()
65
- ;
66
- yPos += bbox.height;
67
- });
68
- line.exit()
69
- .remove()
70
- .each(function (d) {
71
- context._listWidgets[d].target(null);
72
- delete context._listWidgets[d];
73
- })
74
- ;
75
- }
76
-
77
- exit(domNode, element) {
78
- for (const key in this._listWidgets) {
79
- if (this._listWidgets.hasOwnProperty(key)) {
80
- this._listWidgets[key].target(null);
81
- }
82
- }
83
- super.exit(domNode, element);
84
- }
85
-
86
- // Events ---
87
- click(d) {
88
- // console.log("Click: " + d);
89
- }
90
-
91
- dblclick(d) {
92
- // console.log("Double click: " + d);
93
- }
94
-
95
- anchor: { (): string; (_: string): List; };
96
- }
97
- List.prototype._class += " common_List";
98
-
99
- List.prototype.publish("anchor", "start", "set", "Anchor Position", ["", "start", "middle", "end"], { tags: ["Private"] });
1
+ import { IList } from "./IList";
2
+ import { SVGWidget } from "./SVGWidget";
3
+ import { TextBox } from "./TextBox";
4
+
5
+ import "../src/List.css";
6
+
7
+ export class List extends SVGWidget implements IList {
8
+
9
+ protected _listWidgets;
10
+
11
+ constructor() {
12
+ super();
13
+
14
+ this._listWidgets = {};
15
+ }
16
+
17
+ update(domNode, element) {
18
+ super.update(domNode, element);
19
+ const context = this;
20
+
21
+ const line = element.selectAll(".line").data(this.data(), function (d) { return d; });
22
+ const lineEnter = line.enter().append("g")
23
+ .attr("class", "line")
24
+ .each(function (d) {
25
+ const newTextBox = new TextBox()
26
+ .target(this)
27
+ .paddingTop(0)
28
+ .paddingBottom(0)
29
+ .paddingLeft(8)
30
+ .paddingRight(8)
31
+ .text(d)
32
+ .render()
33
+ ;
34
+ newTextBox.element()
35
+ .on("click", function (d2) {
36
+ context.click(d2.text());
37
+ })
38
+ .on("dblclick", function (d2) {
39
+ context.dblclick(d2.text());
40
+ })
41
+ ;
42
+ context._listWidgets[d] = newTextBox;
43
+ })
44
+ ;
45
+
46
+ let listHeight = 0;
47
+ let listWidth = 0;
48
+ for (const key in this._listWidgets) {
49
+ if (!this._listWidgets.hasOwnProperty(key)) continue;
50
+ const bbox = this._listWidgets[key].getBBox();
51
+ listHeight += bbox.height;
52
+ if (listWidth < bbox.width)
53
+ listWidth = bbox.width;
54
+ }
55
+
56
+ let yPos = -listHeight / 2; // + lineHeight / 2;
57
+ lineEnter.merge(line).each(function (d) {
58
+ const widget = context._listWidgets[d];
59
+ const bbox = widget.getBBox();
60
+ widget
61
+ .pos({ x: 0, y: yPos + bbox.height / 2 })
62
+ .anchor(context.anchor())
63
+ .fixedSize({ width: listWidth, height: bbox.height })
64
+ .render()
65
+ ;
66
+ yPos += bbox.height;
67
+ });
68
+ line.exit()
69
+ .remove()
70
+ .each(function (d) {
71
+ context._listWidgets[d].target(null);
72
+ delete context._listWidgets[d];
73
+ })
74
+ ;
75
+ }
76
+
77
+ exit(domNode, element) {
78
+ for (const key in this._listWidgets) {
79
+ if (this._listWidgets.hasOwnProperty(key)) {
80
+ this._listWidgets[key].target(null);
81
+ }
82
+ }
83
+ super.exit(domNode, element);
84
+ }
85
+
86
+ // Events ---
87
+ click(d) {
88
+ // console.log("Click: " + d);
89
+ }
90
+
91
+ dblclick(d) {
92
+ // console.log("Double click: " + d);
93
+ }
94
+
95
+ anchor: { (): string; (_: string): List; };
96
+ }
97
+ List.prototype._class += " common_List";
98
+
99
+ List.prototype.publish("anchor", "start", "set", "Anchor Position", ["", "start", "middle", "end"], { tags: ["Private"] });
package/src/Menu.css CHANGED
@@ -1,23 +1,23 @@
1
- .common_Menu .common_FAChar {
2
- fill: white;
3
- cursor: pointer;
4
- }
5
-
6
- .common_Menu.disabled .common_FAChar {
7
- visibility: hidden;
8
- cursor: inherit;
9
- }
10
-
11
- .common_Menu .common_List .common_TextBox .common_Shape {
12
- fill: #1f77b4;
13
- stroke: #1f77b4;
14
- }
15
-
16
- .common_Menu .common_List .common_TextBox .common_Text {
17
- fill: white;
18
- }
19
-
20
- .common_Menu .common_List .common_TextBox .common_Shape:hover {
21
- fill: #ff7f0e;
22
- stroke: #ff7f0e;
23
- }
1
+ .common_Menu .common_FAChar {
2
+ fill: white;
3
+ cursor: pointer;
4
+ }
5
+
6
+ .common_Menu.disabled .common_FAChar {
7
+ visibility: hidden;
8
+ cursor: inherit;
9
+ }
10
+
11
+ .common_Menu .common_List .common_TextBox .common_Shape {
12
+ fill: #1f77b4;
13
+ stroke: #1f77b4;
14
+ }
15
+
16
+ .common_Menu .common_List .common_TextBox .common_Text {
17
+ fill: white;
18
+ }
19
+
20
+ .common_Menu .common_List .common_TextBox .common_Shape:hover {
21
+ fill: #ff7f0e;
22
+ stroke: #ff7f0e;
23
+ }
package/src/Menu.ts CHANGED
@@ -1,134 +1,134 @@
1
- import { event as d3Event, select as d3Select } from "d3-selection";
2
- import { Icon } from "./Icon";
3
- import { IMenu } from "./IMenu";
4
- import { List } from "./List";
5
- import { SVGWidget } from "./SVGWidget";
6
-
7
- import "../src/Menu.css";
8
-
9
- export class Menu extends SVGWidget implements IMenu {
10
- protected _icon = new Icon().shape("square").diameter(14).paddingPercent(0);
11
- protected _list = new List();
12
- protected _open;
13
-
14
- constructor() {
15
- super();
16
-
17
- const context = this;
18
- this._list.click = function (d) {
19
- d3Event.stopPropagation();
20
- context.hideMenu();
21
- context.click(d);
22
- };
23
- this._open = false;
24
- }
25
-
26
- toggleMenu() {
27
- if (!this._open) {
28
- this.showMenu();
29
- } else {
30
- this.hideMenu();
31
- }
32
- }
33
-
34
- showMenu() {
35
- this.preShowMenu();
36
- this._open = true;
37
- this._list
38
- .data(this.data())
39
- .render()
40
- ;
41
-
42
- const bbox = this._icon.getBBox(true);
43
- const menuBBox = this._list.getBBox(true);
44
- const pos = {
45
- x: bbox.width / 2 - menuBBox.width / 2,
46
- y: bbox.height / 2 + menuBBox.height / 2
47
- };
48
- this._list
49
- .move(pos)
50
- ;
51
- const context = this;
52
- d3Select("body")
53
- .on("click." + this._id, function () {
54
- if (context._open) {
55
- context.hideMenu();
56
- }
57
- })
58
- ;
59
- }
60
-
61
- hideMenu() {
62
- d3Select("body")
63
- .on("click." + this._id, null)
64
- ;
65
- this._open = false;
66
- this._list
67
- .data([])
68
- .render()
69
- ;
70
- this.postHideMenu();
71
- }
72
-
73
- enter(domNode, element) {
74
- super.enter(domNode, element);
75
-
76
- this._icon
77
- .target(domNode)
78
- .render()
79
- ;
80
-
81
- this._list
82
- .target(domNode)
83
- .render()
84
- ;
85
-
86
- const context = this;
87
- this._icon.element()
88
- .on("click", function () {
89
- d3Event.stopPropagation();
90
- context.toggleMenu();
91
- })
92
- ;
93
- }
94
-
95
- update(domNode, element) {
96
- super.update(domNode, element);
97
- element
98
- .classed("disabled", this.data().length === 0)
99
- ;
100
-
101
- this._icon
102
- .faChar(this.faChar())
103
- .paddingPercent(this.paddingPercent())
104
- .render()
105
- ;
106
- }
107
-
108
- exit(domNode, element) {
109
- this._icon
110
- .target(null)
111
- ;
112
-
113
- this._list
114
- .target(null)
115
- ;
116
-
117
- super.exit(domNode, element);
118
- }
119
-
120
- // Events ---
121
- click(d) {
122
- }
123
- preShowMenu() {
124
- }
125
- postHideMenu() {
126
- }
127
-
128
- faChar: { (): string; (_: string): Menu; };
129
- paddingPercent: { (): number; (_: number): Menu; };
130
- }
131
- Menu.prototype._class += " common_Menu";
132
-
133
- Menu.prototype.publishProxy("faChar", "_icon", null, "\uf0c9");
134
- Menu.prototype.publishProxy("paddingPercent", "_icon", null, 10);
1
+ import { event as d3Event, select as d3Select } from "d3-selection";
2
+ import { Icon } from "./Icon";
3
+ import { IMenu } from "./IMenu";
4
+ import { List } from "./List";
5
+ import { SVGWidget } from "./SVGWidget";
6
+
7
+ import "../src/Menu.css";
8
+
9
+ export class Menu extends SVGWidget implements IMenu {
10
+ protected _icon = new Icon().shape("square").diameter(14).paddingPercent(0);
11
+ protected _list = new List();
12
+ protected _open;
13
+
14
+ constructor() {
15
+ super();
16
+
17
+ const context = this;
18
+ this._list.click = function (d) {
19
+ d3Event.stopPropagation();
20
+ context.hideMenu();
21
+ context.click(d);
22
+ };
23
+ this._open = false;
24
+ }
25
+
26
+ toggleMenu() {
27
+ if (!this._open) {
28
+ this.showMenu();
29
+ } else {
30
+ this.hideMenu();
31
+ }
32
+ }
33
+
34
+ showMenu() {
35
+ this.preShowMenu();
36
+ this._open = true;
37
+ this._list
38
+ .data(this.data())
39
+ .render()
40
+ ;
41
+
42
+ const bbox = this._icon.getBBox(true);
43
+ const menuBBox = this._list.getBBox(true);
44
+ const pos = {
45
+ x: bbox.width / 2 - menuBBox.width / 2,
46
+ y: bbox.height / 2 + menuBBox.height / 2
47
+ };
48
+ this._list
49
+ .move(pos)
50
+ ;
51
+ const context = this;
52
+ d3Select("body")
53
+ .on("click." + this._id, function () {
54
+ if (context._open) {
55
+ context.hideMenu();
56
+ }
57
+ })
58
+ ;
59
+ }
60
+
61
+ hideMenu() {
62
+ d3Select("body")
63
+ .on("click." + this._id, null)
64
+ ;
65
+ this._open = false;
66
+ this._list
67
+ .data([])
68
+ .render()
69
+ ;
70
+ this.postHideMenu();
71
+ }
72
+
73
+ enter(domNode, element) {
74
+ super.enter(domNode, element);
75
+
76
+ this._icon
77
+ .target(domNode)
78
+ .render()
79
+ ;
80
+
81
+ this._list
82
+ .target(domNode)
83
+ .render()
84
+ ;
85
+
86
+ const context = this;
87
+ this._icon.element()
88
+ .on("click", function () {
89
+ d3Event.stopPropagation();
90
+ context.toggleMenu();
91
+ })
92
+ ;
93
+ }
94
+
95
+ update(domNode, element) {
96
+ super.update(domNode, element);
97
+ element
98
+ .classed("disabled", this.data().length === 0)
99
+ ;
100
+
101
+ this._icon
102
+ .faChar(this.faChar())
103
+ .paddingPercent(this.paddingPercent())
104
+ .render()
105
+ ;
106
+ }
107
+
108
+ exit(domNode, element) {
109
+ this._icon
110
+ .target(null)
111
+ ;
112
+
113
+ this._list
114
+ .target(null)
115
+ ;
116
+
117
+ super.exit(domNode, element);
118
+ }
119
+
120
+ // Events ---
121
+ click(d) {
122
+ }
123
+ preShowMenu() {
124
+ }
125
+ postHideMenu() {
126
+ }
127
+
128
+ faChar: { (): string; (_: string): Menu; };
129
+ paddingPercent: { (): number; (_: number): Menu; };
130
+ }
131
+ Menu.prototype._class += " common_Menu";
132
+
133
+ Menu.prototype.publishProxy("faChar", "_icon", null, "\uf0c9");
134
+ Menu.prototype.publishProxy("paddingPercent", "_icon", null, 10);