@hpcc-js/common 2.73.3 → 2.73.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.
Files changed (59) hide show
  1. package/LICENSE +43 -43
  2. package/README.md +59 -59
  3. package/dist/index.es6.js +2 -2
  4. package/dist/index.es6.js.map +1 -1
  5. package/dist/index.js +2 -2
  6. package/dist/index.js.map +1 -1
  7. package/dist/index.min.js +1 -1
  8. package/dist/index.min.js.map +1 -1
  9. package/package.json +3 -3
  10. package/src/CanvasWidget.ts +31 -31
  11. package/src/Class.ts +67 -67
  12. package/src/Database.ts +856 -856
  13. package/src/Entity.ts +235 -235
  14. package/src/EntityCard.ts +66 -66
  15. package/src/EntityPin.ts +103 -103
  16. package/src/EntityRect.css +15 -15
  17. package/src/EntityRect.ts +236 -236
  18. package/src/EntityVertex.ts +86 -86
  19. package/src/FAChar.css +2 -2
  20. package/src/FAChar.ts +82 -82
  21. package/src/HTMLWidget.ts +191 -191
  22. package/src/IList.ts +4 -4
  23. package/src/IMenu.ts +5 -5
  24. package/src/Icon.css +9 -9
  25. package/src/Icon.ts +164 -164
  26. package/src/Image.ts +95 -95
  27. package/src/List.css +13 -13
  28. package/src/List.ts +99 -99
  29. package/src/Menu.css +23 -23
  30. package/src/Menu.ts +134 -134
  31. package/src/Palette.ts +341 -341
  32. package/src/Platform.ts +125 -125
  33. package/src/ProgressBar.ts +105 -105
  34. package/src/PropertyExt.ts +793 -793
  35. package/src/ResizeSurface.css +39 -39
  36. package/src/ResizeSurface.ts +221 -221
  37. package/src/SVGWidget.ts +567 -567
  38. package/src/SVGZoomWidget.css +12 -12
  39. package/src/SVGZoomWidget.ts +426 -426
  40. package/src/Shape.css +3 -3
  41. package/src/Shape.ts +186 -186
  42. package/src/Surface.css +35 -35
  43. package/src/Surface.ts +349 -349
  44. package/src/Text.css +4 -4
  45. package/src/Text.ts +131 -131
  46. package/src/TextBox.css +4 -4
  47. package/src/TextBox.ts +168 -168
  48. package/src/TitleBar.css +99 -99
  49. package/src/TitleBar.ts +401 -401
  50. package/src/Transition.ts +45 -45
  51. package/src/Utility.ts +839 -839
  52. package/src/Widget.css +8 -8
  53. package/src/Widget.ts +730 -730
  54. package/src/WidgetArray.ts +13 -13
  55. package/src/__package__.ts +3 -3
  56. package/src/index.ts +55 -55
  57. package/types/__package__.d.ts +2 -2
  58. package/types/__package__.d.ts.map +1 -1
  59. package/types-3.4/__package__.d.ts +2 -2
package/src/HTMLWidget.ts CHANGED
@@ -1,191 +1,191 @@
1
- import { select as d3Select } from "d3-selection";
2
- import { Widget } from "./Widget";
3
-
4
- export class HTMLWidget extends Widget {
5
-
6
- private observer;
7
- protected _drawStartPos: "origin" | "center";
8
- protected _boundingBox;
9
-
10
- constructor() {
11
- super();
12
-
13
- this._drawStartPos = "origin";
14
- this._tag = "div";
15
- this._boundingBox = null;
16
- }
17
-
18
- calcFrameWidth(element) {
19
- const retVal = parseFloat(element.style("padding-left")) +
20
- parseFloat(element.style("padding-right")) +
21
- parseFloat(element.style("margin-left")) +
22
- parseFloat(element.style("margin-right")) +
23
- parseFloat(element.style("border-left-width")) +
24
- parseFloat(element.style("border-right-width"))
25
- ;
26
- return retVal;
27
- }
28
-
29
- calcWidth(element) {
30
- return parseFloat(element.style("width")) - this.calcFrameWidth(element);
31
- }
32
-
33
- calcFrameHeight(element) {
34
- const retVal = parseFloat(element.style("padding-top")) +
35
- parseFloat(element.style("padding-bottom")) +
36
- parseFloat(element.style("margin-top")) +
37
- parseFloat(element.style("margin-bottom")) +
38
- parseFloat(element.style("border-top-width")) +
39
- parseFloat(element.style("border-bottom-width"))
40
- ;
41
- return retVal;
42
- }
43
-
44
- calcHeight(element) {
45
- return parseFloat(element.style("height")) + this.calcFrameHeight(element);
46
- }
47
-
48
- hasHScroll(element?) {
49
- element = element || this._element;
50
- return element.property("scrollWidth") > element.property("clientWidth");
51
- }
52
-
53
- hasVScroll(element?) {
54
- element = element || this._element;
55
- return element.property("scrollHeight") > element.property("clientHeight");
56
- }
57
-
58
- clientWidth() {
59
- return this._size.width - this.calcFrameWidth(this._element);
60
- }
61
-
62
- clientHeight() {
63
- return this._size.height - this.calcFrameHeight(this._element);
64
- }
65
-
66
- getBBox(refresh = false, round = false) {
67
- if (refresh || this._boundingBox === null) {
68
- const domNode = this._element.node() ? this._element.node().firstElementChild : null; // Needs to be first child, as element has its width/height forced onto it.
69
- if (domNode instanceof Element) {
70
- const rect = domNode.getBoundingClientRect();
71
- this._boundingBox = {
72
- x: rect.left,
73
- y: rect.top,
74
- width: rect.width,
75
- height: rect.height
76
- };
77
- }
78
- }
79
- if (this._boundingBox === null) {
80
- return {
81
- x: 0,
82
- y: 0,
83
- width: 0,
84
- height: 0
85
- };
86
- }
87
- return {
88
- x: (round ? Math.round(this._boundingBox.x) : this._boundingBox.x) * this._widgetScale,
89
- y: (round ? Math.round(this._boundingBox.y) : this._boundingBox.y) * this._widgetScale,
90
- width: (round ? Math.round(this._boundingBox.width) : this._boundingBox.width) * this._widgetScale,
91
- height: (round ? Math.round(this._boundingBox.height) : this._boundingBox.height) * this._widgetScale
92
- };
93
- }
94
-
95
- reposition(pos?) {
96
- // const retVal = super.reposition(pos);
97
- if (this._placeholderElement) {
98
- this._placeholderElement
99
- .style("left", pos.x + "px")
100
- .style("top", pos.y + "px")
101
- ;
102
- }
103
- return this;
104
- }
105
-
106
- resize(size?) {
107
- const retVal = super.resize(size);
108
- if (this._placeholderElement) {
109
- this._placeholderElement
110
- .style("width", this._size.width + "px")
111
- .style("height", this._size.height + "px")
112
- ;
113
- }
114
- return retVal;
115
- }
116
-
117
- // Properties ---
118
- target(): null | HTMLElement | SVGElement;
119
- target(_: null | string | HTMLElement | SVGElement): this;
120
- target(_?: null | string | HTMLElement | SVGElement): null | HTMLElement | SVGElement | this {
121
- const retVal = super.target.apply(this, arguments);
122
- if (arguments.length) {
123
- if (this._target instanceof SVGElement) {
124
- // Target is a SVG Node, so create an item in the Overlay and force it "over" the overlay element (cough) ---
125
- this._isRootNode = false;
126
- const overlay = this.locateOverlayNode();
127
- this._placeholderElement = overlay.append("div")
128
- .style("position", "absolute")
129
- .style("top", "0px")
130
- .style("left", "0px")
131
- .style("overflow", "hidden")
132
- ;
133
- this._overlayElement = d3Select(this._target);
134
-
135
- this._prevPos = null;
136
- this.observer = new MutationObserver(_mutation => {
137
- this.syncOverlay();
138
- });
139
-
140
- let domNode = this._overlayElement.node();
141
- while (domNode) {
142
- this.observer.observe(domNode, { attributes: true });
143
- domNode = domNode.parentNode;
144
- }
145
- } else if (this._target) { // HTMLElement
146
- this._placeholderElement = d3Select(this._target);
147
- if (!this._size.width && !this._size.height) {
148
- const width = parseFloat(this._placeholderElement.style("width"));
149
- const height = parseFloat(this._placeholderElement.style("height"));
150
- this.size({
151
- width,
152
- height
153
- });
154
- }
155
- this._placeholderElement = d3Select(this._target).append("div");
156
- }
157
- }
158
- return retVal;
159
- }
160
-
161
- postUpdate(domNode, element) {
162
- super.postUpdate(domNode, element);
163
- if (this._drawStartPos === "origin") {
164
- this._element
165
- .style("position", "relative")
166
- .style("left", this._pos.x + "px")
167
- .style("top", this._pos.y + "px")
168
- ;
169
- } else {
170
- const bbox = this.getBBox(true);
171
- this._element
172
- .style("position", "relative")
173
- .style("float", "left")
174
- .style("left", this._pos.x + (this._size.width - bbox.width) / 2 + "px")
175
- .style("top", this._pos.y + (this._size.height - bbox.height) / 2 + "px")
176
- ;
177
- }
178
- }
179
-
180
- exit(domNode?, element?) {
181
- if (this.observer) {
182
- this.observer.disconnect();
183
- }
184
- this._prevPos = null;
185
- if (this._placeholderElement) {
186
- this._placeholderElement.remove();
187
- }
188
- super.exit(domNode, element);
189
- }
190
- }
191
- HTMLWidget.prototype._class += " common_HTMLWidget";
1
+ import { select as d3Select } from "d3-selection";
2
+ import { Widget } from "./Widget";
3
+
4
+ export class HTMLWidget extends Widget {
5
+
6
+ private observer;
7
+ protected _drawStartPos: "origin" | "center";
8
+ protected _boundingBox;
9
+
10
+ constructor() {
11
+ super();
12
+
13
+ this._drawStartPos = "origin";
14
+ this._tag = "div";
15
+ this._boundingBox = null;
16
+ }
17
+
18
+ calcFrameWidth(element) {
19
+ const retVal = parseFloat(element.style("padding-left")) +
20
+ parseFloat(element.style("padding-right")) +
21
+ parseFloat(element.style("margin-left")) +
22
+ parseFloat(element.style("margin-right")) +
23
+ parseFloat(element.style("border-left-width")) +
24
+ parseFloat(element.style("border-right-width"))
25
+ ;
26
+ return retVal;
27
+ }
28
+
29
+ calcWidth(element) {
30
+ return parseFloat(element.style("width")) - this.calcFrameWidth(element);
31
+ }
32
+
33
+ calcFrameHeight(element) {
34
+ const retVal = parseFloat(element.style("padding-top")) +
35
+ parseFloat(element.style("padding-bottom")) +
36
+ parseFloat(element.style("margin-top")) +
37
+ parseFloat(element.style("margin-bottom")) +
38
+ parseFloat(element.style("border-top-width")) +
39
+ parseFloat(element.style("border-bottom-width"))
40
+ ;
41
+ return retVal;
42
+ }
43
+
44
+ calcHeight(element) {
45
+ return parseFloat(element.style("height")) + this.calcFrameHeight(element);
46
+ }
47
+
48
+ hasHScroll(element?) {
49
+ element = element || this._element;
50
+ return element.property("scrollWidth") > element.property("clientWidth");
51
+ }
52
+
53
+ hasVScroll(element?) {
54
+ element = element || this._element;
55
+ return element.property("scrollHeight") > element.property("clientHeight");
56
+ }
57
+
58
+ clientWidth() {
59
+ return this._size.width - this.calcFrameWidth(this._element);
60
+ }
61
+
62
+ clientHeight() {
63
+ return this._size.height - this.calcFrameHeight(this._element);
64
+ }
65
+
66
+ getBBox(refresh = false, round = false) {
67
+ if (refresh || this._boundingBox === null) {
68
+ const domNode = this._element.node() ? this._element.node().firstElementChild : null; // Needs to be first child, as element has its width/height forced onto it.
69
+ if (domNode instanceof Element) {
70
+ const rect = domNode.getBoundingClientRect();
71
+ this._boundingBox = {
72
+ x: rect.left,
73
+ y: rect.top,
74
+ width: rect.width,
75
+ height: rect.height
76
+ };
77
+ }
78
+ }
79
+ if (this._boundingBox === null) {
80
+ return {
81
+ x: 0,
82
+ y: 0,
83
+ width: 0,
84
+ height: 0
85
+ };
86
+ }
87
+ return {
88
+ x: (round ? Math.round(this._boundingBox.x) : this._boundingBox.x) * this._widgetScale,
89
+ y: (round ? Math.round(this._boundingBox.y) : this._boundingBox.y) * this._widgetScale,
90
+ width: (round ? Math.round(this._boundingBox.width) : this._boundingBox.width) * this._widgetScale,
91
+ height: (round ? Math.round(this._boundingBox.height) : this._boundingBox.height) * this._widgetScale
92
+ };
93
+ }
94
+
95
+ reposition(pos?) {
96
+ // const retVal = super.reposition(pos);
97
+ if (this._placeholderElement) {
98
+ this._placeholderElement
99
+ .style("left", pos.x + "px")
100
+ .style("top", pos.y + "px")
101
+ ;
102
+ }
103
+ return this;
104
+ }
105
+
106
+ resize(size?) {
107
+ const retVal = super.resize(size);
108
+ if (this._placeholderElement) {
109
+ this._placeholderElement
110
+ .style("width", this._size.width + "px")
111
+ .style("height", this._size.height + "px")
112
+ ;
113
+ }
114
+ return retVal;
115
+ }
116
+
117
+ // Properties ---
118
+ target(): null | HTMLElement | SVGElement;
119
+ target(_: null | string | HTMLElement | SVGElement): this;
120
+ target(_?: null | string | HTMLElement | SVGElement): null | HTMLElement | SVGElement | this {
121
+ const retVal = super.target.apply(this, arguments);
122
+ if (arguments.length) {
123
+ if (this._target instanceof SVGElement) {
124
+ // Target is a SVG Node, so create an item in the Overlay and force it "over" the overlay element (cough) ---
125
+ this._isRootNode = false;
126
+ const overlay = this.locateOverlayNode();
127
+ this._placeholderElement = overlay.append("div")
128
+ .style("position", "absolute")
129
+ .style("top", "0px")
130
+ .style("left", "0px")
131
+ .style("overflow", "hidden")
132
+ ;
133
+ this._overlayElement = d3Select(this._target);
134
+
135
+ this._prevPos = null;
136
+ this.observer = new MutationObserver(_mutation => {
137
+ this.syncOverlay();
138
+ });
139
+
140
+ let domNode = this._overlayElement.node();
141
+ while (domNode) {
142
+ this.observer.observe(domNode, { attributes: true });
143
+ domNode = domNode.parentNode;
144
+ }
145
+ } else if (this._target) { // HTMLElement
146
+ this._placeholderElement = d3Select(this._target);
147
+ if (!this._size.width && !this._size.height) {
148
+ const width = parseFloat(this._placeholderElement.style("width"));
149
+ const height = parseFloat(this._placeholderElement.style("height"));
150
+ this.size({
151
+ width,
152
+ height
153
+ });
154
+ }
155
+ this._placeholderElement = d3Select(this._target).append("div");
156
+ }
157
+ }
158
+ return retVal;
159
+ }
160
+
161
+ postUpdate(domNode, element) {
162
+ super.postUpdate(domNode, element);
163
+ if (this._drawStartPos === "origin") {
164
+ this._element
165
+ .style("position", "relative")
166
+ .style("left", this._pos.x + "px")
167
+ .style("top", this._pos.y + "px")
168
+ ;
169
+ } else {
170
+ const bbox = this.getBBox(true);
171
+ this._element
172
+ .style("position", "relative")
173
+ .style("float", "left")
174
+ .style("left", this._pos.x + (this._size.width - bbox.width) / 2 + "px")
175
+ .style("top", this._pos.y + (this._size.height - bbox.height) / 2 + "px")
176
+ ;
177
+ }
178
+ }
179
+
180
+ exit(domNode?, element?) {
181
+ if (this.observer) {
182
+ this.observer.disconnect();
183
+ }
184
+ this._prevPos = null;
185
+ if (this._placeholderElement) {
186
+ this._placeholderElement.remove();
187
+ }
188
+ super.exit(domNode, element);
189
+ }
190
+ }
191
+ HTMLWidget.prototype._class += " common_HTMLWidget";
package/src/IList.ts CHANGED
@@ -1,4 +1,4 @@
1
- export interface IList {
2
- click(d);
3
- dblclick(d);
4
- }
1
+ export interface IList {
2
+ click(d);
3
+ dblclick(d);
4
+ }
package/src/IMenu.ts CHANGED
@@ -1,5 +1,5 @@
1
- export interface IMenu {
2
- click(d);
3
- preShowMenu(d);
4
- postHideMenu(d);
5
- }
1
+ export interface IMenu {
2
+ click(d);
3
+ preShowMenu(d);
4
+ postHideMenu(d);
5
+ }
package/src/Icon.css CHANGED
@@ -1,9 +1,9 @@
1
- .common_Icon .common_FAChar .common_Text {
2
- fill: white;
3
- }
4
- .common_Icon .common_FAChar .common_Text,
5
- .common_Icon .common_FAChar .common_Text g,
6
- .common_Icon .common_FAChar .common_Text text,
7
- .common_Icon .common_FAChar .common_Text tspan {
8
- pointer-events: none;
9
- }
1
+ .common_Icon .common_FAChar .common_Text {
2
+ fill: white;
3
+ }
4
+ .common_Icon .common_FAChar .common_Text,
5
+ .common_Icon .common_FAChar .common_Text g,
6
+ .common_Icon .common_FAChar .common_Text text,
7
+ .common_Icon .common_FAChar .common_Text tspan {
8
+ pointer-events: none;
9
+ }