@hpcc-js/common 2.66.1 → 2.68.1

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 (97) hide show
  1. package/LICENSE +43 -43
  2. package/README.md +59 -59
  3. package/dist/index.es6.js +6583 -6578
  4. package/dist/index.es6.js.map +1 -1
  5. package/dist/index.js +6583 -6578
  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 +4 -4
  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 -138
  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 +416 -416
  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 -350
  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 +832 -820
  52. package/src/Widget.css +8 -8
  53. package/src/Widget.ts +712 -712
  54. package/src/WidgetArray.ts +13 -13
  55. package/src/__package__.ts +2 -2
  56. package/src/index.ts +55 -55
  57. package/types/CanvasWidget.d.ts +8 -8
  58. package/types/Class.d.ts +12 -12
  59. package/types/Database.d.ts +136 -136
  60. package/types/Entity.d.ts +88 -88
  61. package/types/EntityCard.d.ts +13 -13
  62. package/types/EntityPin.d.ts +22 -22
  63. package/types/EntityRect.d.ts +45 -45
  64. package/types/EntityVertex.d.ts +30 -30
  65. package/types/FAChar.d.ts +29 -29
  66. package/types/HTMLWidget.d.ts +27 -27
  67. package/types/HTMLWidget.d.ts.map +1 -1
  68. package/types/IList.d.ts +4 -4
  69. package/types/IMenu.d.ts +5 -5
  70. package/types/Icon.d.ts +62 -62
  71. package/types/Image.d.ts +33 -33
  72. package/types/List.d.ts +15 -15
  73. package/types/Menu.d.ts +28 -28
  74. package/types/Menu.d.ts.map +1 -1
  75. package/types/Palette.d.ts +19 -19
  76. package/types/Platform.d.ts +5 -5
  77. package/types/ProgressBar.d.ts +21 -21
  78. package/types/PropertyExt.d.ts +114 -114
  79. package/types/ResizeSurface.d.ts +23 -23
  80. package/types/SVGWidget.d.ts +77 -77
  81. package/types/SVGZoomWidget.d.ts +68 -68
  82. package/types/Shape.d.ts +34 -34
  83. package/types/Surface.d.ts +69 -69
  84. package/types/Surface.d.ts.map +1 -1
  85. package/types/Text.d.ts +37 -37
  86. package/types/TextBox.d.ts +76 -76
  87. package/types/TitleBar.d.ts +117 -117
  88. package/types/Transition.d.ts +11 -11
  89. package/types/Utility.d.ts +102 -100
  90. package/types/Utility.d.ts.map +1 -1
  91. package/types/Widget.d.ts +149 -149
  92. package/types/WidgetArray.d.ts +6 -6
  93. package/types/__package__.d.ts +3 -3
  94. package/types/index.d.ts +52 -52
  95. package/types-3.4/HTMLWidget.d.ts +2 -2
  96. package/types-3.4/Utility.d.ts +4 -2
  97. package/types-3.4/__package__.d.ts +2 -2
@@ -1,39 +1,39 @@
1
- .resizeN {
2
- cursor: ns-resize;
3
- opacity: 0;
4
- }
5
-
6
- .resizeNE {
7
- cursor: ne-resize;
8
- opacity: 0;
9
- }
10
-
11
- .resizeE {
12
- cursor: ew-resize;
13
- opacity: 0;
14
- }
15
-
16
- .resizeSE {
17
- cursor: se-resize;
18
- opacity: 0;
19
- }
20
-
21
- .resizeS {
22
- cursor: ns-resize;
23
- opacity: 0;
24
- }
25
-
26
- .resizeSW {
27
- cursor: sw-resize;
28
- opacity: 0;
29
- }
30
-
31
- .resizeW {
32
- cursor: ew-resize;
33
- opacity: 0;
34
- }
35
-
36
- .resizeNW {
37
- cursor: nw-resize;
38
- opacity: 0;
39
- }
1
+ .resizeN {
2
+ cursor: ns-resize;
3
+ opacity: 0;
4
+ }
5
+
6
+ .resizeNE {
7
+ cursor: ne-resize;
8
+ opacity: 0;
9
+ }
10
+
11
+ .resizeE {
12
+ cursor: ew-resize;
13
+ opacity: 0;
14
+ }
15
+
16
+ .resizeSE {
17
+ cursor: se-resize;
18
+ opacity: 0;
19
+ }
20
+
21
+ .resizeS {
22
+ cursor: ns-resize;
23
+ opacity: 0;
24
+ }
25
+
26
+ .resizeSW {
27
+ cursor: sw-resize;
28
+ opacity: 0;
29
+ }
30
+
31
+ .resizeW {
32
+ cursor: ew-resize;
33
+ opacity: 0;
34
+ }
35
+
36
+ .resizeNW {
37
+ cursor: nw-resize;
38
+ opacity: 0;
39
+ }
@@ -1,221 +1,221 @@
1
- import { dispatch as d3Dispatch } from "d3-dispatch";
2
- import { drag as d3Drag } from "d3-drag";
3
- import { event as d3Event, select as d3Select } from "d3-selection";
4
- import { Surface } from "./Surface";
5
-
6
- import "../src/ResizeSurface.css";
7
-
8
- export class ResizeSurface extends Surface {
9
-
10
- protected handleWidth;
11
- protected handles;
12
- protected dispatch;
13
- protected drag;
14
- protected _domNode;
15
- protected _dragHandlePos;
16
- protected _dragStartPos;
17
- protected _dragStartSize;
18
- protected _prevPosSize;
19
- protected _textPosSize;
20
- protected _iconPosSize;
21
-
22
- constructor() {
23
- super();
24
-
25
- this.handleWidth = 8;
26
- this.handles = [{ loc: "NW" }, { loc: "N" }, { loc: "NE" }, { loc: "E" }, { loc: "SE" }, { loc: "S" }, { loc: "SW" }, { loc: "W" }];
27
-
28
- const context = this;
29
- this.dispatch = d3Dispatch("sizestart", "size", "sizeend");
30
- this.drag = d3Drag()
31
- .subject(function (d) { return d; })
32
- ;
33
- this.drag
34
- .on("start", function (d) {
35
- context.dispatch.call("sizestart", context, d.loc);
36
- if (context.allowResize()) {
37
- d3Event.sourceEvent.stopPropagation();
38
- context._dragHandlePos = { x: d.x, y: d.y };
39
- context._dragStartPos = context.pos();
40
- context._dragStartSize = context.size();
41
- context._prevPosSize = {
42
- x: context._dragStartPos.x,
43
- y: context._dragStartPos.y,
44
- width: context._dragStartSize.width,
45
- height: context._dragStartSize.height
46
- };
47
- context._textPosSize = context._textWidget.getBBox(true);
48
- context._iconPosSize = context._iconWidget.getBBox(true);
49
- context.showContent(false);
50
- }
51
- })
52
- .on("drag", function (d) {
53
- if (context.allowResize()) {
54
- d3Event.sourceEvent.stopPropagation();
55
- const _dx = d3Event.x - context._dragHandlePos.x;
56
- const _dy = d3Event.y - context._dragHandlePos.y;
57
- const delta = { x: 0, y: 0, w: 0, h: 0 };
58
- switch (d.loc) {
59
- case "NW":
60
- delta.x = _dx / 2;
61
- delta.w = -_dx;
62
- /* falls through */
63
- case "N":
64
- delta.y = _dy / 2;
65
- delta.h = -_dy;
66
- break;
67
- case "NE":
68
- delta.y = _dy / 2;
69
- delta.h = -_dy;
70
- /* falls through */
71
- case "E":
72
- delta.x = _dx / 2;
73
- delta.w = _dx;
74
- break;
75
- case "SE":
76
- delta.x = _dx / 2;
77
- delta.w = _dx;
78
- /* falls through */
79
- case "S":
80
- delta.y = _dy / 2;
81
- delta.h = _dy;
82
- break;
83
- case "SW":
84
- delta.y = _dy / 2;
85
- delta.h = _dy;
86
- /* falls through */
87
- case "W":
88
- delta.x = _dx / 2;
89
- delta.w = -_dx;
90
- break;
91
- }
92
- const posSize = {
93
- x: context._dragStartPos.x + delta.x,
94
- y: context._dragStartPos.y + delta.y,
95
- width: context._dragStartSize.width + delta.w,
96
- height: context._dragStartSize.height + delta.h
97
- };
98
- if (posSize.width < context._iconPosSize.width * 2 + context._textPosSize.width) {
99
- posSize.x = context._prevPosSize.x;
100
- posSize.width = context._prevPosSize.width;
101
- }
102
- if (posSize.height < context._textPosSize.height + 48) {
103
- posSize.y = context._prevPosSize.y;
104
- posSize.height = context._prevPosSize.height;
105
- }
106
- context
107
- .pos({ x: posSize.x, y: posSize.y })
108
- .size({ width: posSize.width, height: posSize.height })
109
- .render()
110
- .getBBox(true)
111
- ;
112
- context.dispatch.call("size", context, d.loc);
113
- context._prevPosSize = posSize;
114
- }
115
- })
116
- .on("end", function (d) {
117
- if (context.allowResize()) {
118
- d3Event.sourceEvent.stopPropagation();
119
- context
120
- .showContent(true)
121
- .render()
122
- ;
123
- context._containerWidget.getBBox(true);
124
- context._titleRectWidget.getBBox(true);
125
- context.dispatch.call("sizeend", context, d.loc);
126
- }
127
- })
128
- ;
129
- }
130
-
131
- move(_) {
132
- const retVal = super.move.apply(this, arguments);
133
- this.updateHandles(this._domNode, this._element);
134
- return retVal;
135
- }
136
-
137
- update(domNode, element) {
138
- super.update(domNode, element);
139
- this.updateHandles(domNode, element);
140
- }
141
-
142
- updateHandles(_domNode, _element) {
143
- const sizeHandles = this._placeholderElement.selectAll("rect").data(this.handles, function (d) { return d.loc; });
144
- const sizeHandlesEnter = sizeHandles.enter().append("rect")
145
- .attr("class", function (d) { return "resize" + d.loc; })
146
- .call(this.drag)
147
- ;
148
-
149
- const l = this._pos.x + this._containerWidget._pos.x - this._containerWidget.width() / 2;
150
- const t = this._pos.y + this._titleRectWidget._pos.y - this._titleRectWidget.height() / 2;
151
- const r = this._pos.x + this._containerWidget._pos.x + this._containerWidget.width() / 2;
152
- const b = this._pos.y + this._containerWidget._pos.y + this._containerWidget.height() / 2;
153
- const w = r - l;
154
- const h = b - t;
155
- const context = this;
156
- sizeHandlesEnter.merge(sizeHandles)
157
- .each(function (d) {
158
- switch (d.loc) {
159
- case "NW":
160
- d.x = l - context.handleWidth / 2;
161
- d.y = t - context.handleWidth / 2;
162
- d.width = context.handleWidth;
163
- d.height = context.handleWidth;
164
- break;
165
- case "N":
166
- d.x = l + context.handleWidth / 2;
167
- d.y = t - context.handleWidth / 2;
168
- d.width = w - context.handleWidth;
169
- d.height = context.handleWidth;
170
- break;
171
- case "NE":
172
- d.x = r - context.handleWidth / 2;
173
- d.y = t - context.handleWidth / 2;
174
- d.width = context.handleWidth;
175
- d.height = context.handleWidth;
176
- break;
177
- case "E":
178
- d.x = r - context.handleWidth / 2;
179
- d.y = t + context.handleWidth / 2;
180
- d.width = context.handleWidth;
181
- d.height = h - context.handleWidth;
182
- break;
183
- case "SE":
184
- d.x = r - context.handleWidth / 2;
185
- d.y = b - context.handleWidth / 2;
186
- d.width = context.handleWidth;
187
- d.height = context.handleWidth;
188
- break;
189
- case "S":
190
- d.x = l + context.handleWidth / 2;
191
- d.y = b - context.handleWidth / 2;
192
- d.width = w - context.handleWidth;
193
- d.height = context.handleWidth;
194
- break;
195
- case "SW":
196
- d.x = l - context.handleWidth / 2;
197
- d.y = b - context.handleWidth / 2;
198
- d.width = context.handleWidth;
199
- d.height = context.handleWidth;
200
- break;
201
- case "W":
202
- d.x = l - context.handleWidth / 2;
203
- d.y = t + context.handleWidth / 2;
204
- d.width = context.handleWidth;
205
- d.height = h - context.handleWidth;
206
- break;
207
- }
208
- d3Select(this)
209
- .attr("x", d.x)
210
- .attr("y", d.y)
211
- .attr("width", d.width)
212
- .attr("height", d.height)
213
- ;
214
- })
215
- ;
216
- }
217
- allowResize: { (): boolean; (_: boolean): ResizeSurface; };
218
- }
219
- ResizeSurface.prototype._class += " common_ResizeSurface";
220
-
221
- ResizeSurface.prototype.publish("allowResize", true, "boolean", "Sets if surface can be resized", null, { tags: ["Private", "Shared"] });
1
+ import { dispatch as d3Dispatch } from "d3-dispatch";
2
+ import { drag as d3Drag } from "d3-drag";
3
+ import { event as d3Event, select as d3Select } from "d3-selection";
4
+ import { Surface } from "./Surface";
5
+
6
+ import "../src/ResizeSurface.css";
7
+
8
+ export class ResizeSurface extends Surface {
9
+
10
+ protected handleWidth;
11
+ protected handles;
12
+ protected dispatch;
13
+ protected drag;
14
+ protected _domNode;
15
+ protected _dragHandlePos;
16
+ protected _dragStartPos;
17
+ protected _dragStartSize;
18
+ protected _prevPosSize;
19
+ protected _textPosSize;
20
+ protected _iconPosSize;
21
+
22
+ constructor() {
23
+ super();
24
+
25
+ this.handleWidth = 8;
26
+ this.handles = [{ loc: "NW" }, { loc: "N" }, { loc: "NE" }, { loc: "E" }, { loc: "SE" }, { loc: "S" }, { loc: "SW" }, { loc: "W" }];
27
+
28
+ const context = this;
29
+ this.dispatch = d3Dispatch("sizestart", "size", "sizeend");
30
+ this.drag = d3Drag()
31
+ .subject(function (d) { return d; })
32
+ ;
33
+ this.drag
34
+ .on("start", function (d) {
35
+ context.dispatch.call("sizestart", context, d.loc);
36
+ if (context.allowResize()) {
37
+ d3Event.sourceEvent.stopPropagation();
38
+ context._dragHandlePos = { x: d.x, y: d.y };
39
+ context._dragStartPos = context.pos();
40
+ context._dragStartSize = context.size();
41
+ context._prevPosSize = {
42
+ x: context._dragStartPos.x,
43
+ y: context._dragStartPos.y,
44
+ width: context._dragStartSize.width,
45
+ height: context._dragStartSize.height
46
+ };
47
+ context._textPosSize = context._textWidget.getBBox(true);
48
+ context._iconPosSize = context._iconWidget.getBBox(true);
49
+ context.showContent(false);
50
+ }
51
+ })
52
+ .on("drag", function (d) {
53
+ if (context.allowResize()) {
54
+ d3Event.sourceEvent.stopPropagation();
55
+ const _dx = d3Event.x - context._dragHandlePos.x;
56
+ const _dy = d3Event.y - context._dragHandlePos.y;
57
+ const delta = { x: 0, y: 0, w: 0, h: 0 };
58
+ switch (d.loc) {
59
+ case "NW":
60
+ delta.x = _dx / 2;
61
+ delta.w = -_dx;
62
+ /* falls through */
63
+ case "N":
64
+ delta.y = _dy / 2;
65
+ delta.h = -_dy;
66
+ break;
67
+ case "NE":
68
+ delta.y = _dy / 2;
69
+ delta.h = -_dy;
70
+ /* falls through */
71
+ case "E":
72
+ delta.x = _dx / 2;
73
+ delta.w = _dx;
74
+ break;
75
+ case "SE":
76
+ delta.x = _dx / 2;
77
+ delta.w = _dx;
78
+ /* falls through */
79
+ case "S":
80
+ delta.y = _dy / 2;
81
+ delta.h = _dy;
82
+ break;
83
+ case "SW":
84
+ delta.y = _dy / 2;
85
+ delta.h = _dy;
86
+ /* falls through */
87
+ case "W":
88
+ delta.x = _dx / 2;
89
+ delta.w = -_dx;
90
+ break;
91
+ }
92
+ const posSize = {
93
+ x: context._dragStartPos.x + delta.x,
94
+ y: context._dragStartPos.y + delta.y,
95
+ width: context._dragStartSize.width + delta.w,
96
+ height: context._dragStartSize.height + delta.h
97
+ };
98
+ if (posSize.width < context._iconPosSize.width * 2 + context._textPosSize.width) {
99
+ posSize.x = context._prevPosSize.x;
100
+ posSize.width = context._prevPosSize.width;
101
+ }
102
+ if (posSize.height < context._textPosSize.height + 48) {
103
+ posSize.y = context._prevPosSize.y;
104
+ posSize.height = context._prevPosSize.height;
105
+ }
106
+ context
107
+ .pos({ x: posSize.x, y: posSize.y })
108
+ .size({ width: posSize.width, height: posSize.height })
109
+ .render()
110
+ .getBBox(true)
111
+ ;
112
+ context.dispatch.call("size", context, d.loc);
113
+ context._prevPosSize = posSize;
114
+ }
115
+ })
116
+ .on("end", function (d) {
117
+ if (context.allowResize()) {
118
+ d3Event.sourceEvent.stopPropagation();
119
+ context
120
+ .showContent(true)
121
+ .render()
122
+ ;
123
+ context._containerWidget.getBBox(true);
124
+ context._titleRectWidget.getBBox(true);
125
+ context.dispatch.call("sizeend", context, d.loc);
126
+ }
127
+ })
128
+ ;
129
+ }
130
+
131
+ move(_) {
132
+ const retVal = super.move.apply(this, arguments);
133
+ this.updateHandles(this._domNode, this._element);
134
+ return retVal;
135
+ }
136
+
137
+ update(domNode, element) {
138
+ super.update(domNode, element);
139
+ this.updateHandles(domNode, element);
140
+ }
141
+
142
+ updateHandles(_domNode, _element) {
143
+ const sizeHandles = this._placeholderElement.selectAll("rect").data(this.handles, function (d) { return d.loc; });
144
+ const sizeHandlesEnter = sizeHandles.enter().append("rect")
145
+ .attr("class", function (d) { return "resize" + d.loc; })
146
+ .call(this.drag)
147
+ ;
148
+
149
+ const l = this._pos.x + this._containerWidget._pos.x - this._containerWidget.width() / 2;
150
+ const t = this._pos.y + this._titleRectWidget._pos.y - this._titleRectWidget.height() / 2;
151
+ const r = this._pos.x + this._containerWidget._pos.x + this._containerWidget.width() / 2;
152
+ const b = this._pos.y + this._containerWidget._pos.y + this._containerWidget.height() / 2;
153
+ const w = r - l;
154
+ const h = b - t;
155
+ const context = this;
156
+ sizeHandlesEnter.merge(sizeHandles)
157
+ .each(function (d) {
158
+ switch (d.loc) {
159
+ case "NW":
160
+ d.x = l - context.handleWidth / 2;
161
+ d.y = t - context.handleWidth / 2;
162
+ d.width = context.handleWidth;
163
+ d.height = context.handleWidth;
164
+ break;
165
+ case "N":
166
+ d.x = l + context.handleWidth / 2;
167
+ d.y = t - context.handleWidth / 2;
168
+ d.width = w - context.handleWidth;
169
+ d.height = context.handleWidth;
170
+ break;
171
+ case "NE":
172
+ d.x = r - context.handleWidth / 2;
173
+ d.y = t - context.handleWidth / 2;
174
+ d.width = context.handleWidth;
175
+ d.height = context.handleWidth;
176
+ break;
177
+ case "E":
178
+ d.x = r - context.handleWidth / 2;
179
+ d.y = t + context.handleWidth / 2;
180
+ d.width = context.handleWidth;
181
+ d.height = h - context.handleWidth;
182
+ break;
183
+ case "SE":
184
+ d.x = r - context.handleWidth / 2;
185
+ d.y = b - context.handleWidth / 2;
186
+ d.width = context.handleWidth;
187
+ d.height = context.handleWidth;
188
+ break;
189
+ case "S":
190
+ d.x = l + context.handleWidth / 2;
191
+ d.y = b - context.handleWidth / 2;
192
+ d.width = w - context.handleWidth;
193
+ d.height = context.handleWidth;
194
+ break;
195
+ case "SW":
196
+ d.x = l - context.handleWidth / 2;
197
+ d.y = b - context.handleWidth / 2;
198
+ d.width = context.handleWidth;
199
+ d.height = context.handleWidth;
200
+ break;
201
+ case "W":
202
+ d.x = l - context.handleWidth / 2;
203
+ d.y = t + context.handleWidth / 2;
204
+ d.width = context.handleWidth;
205
+ d.height = h - context.handleWidth;
206
+ break;
207
+ }
208
+ d3Select(this)
209
+ .attr("x", d.x)
210
+ .attr("y", d.y)
211
+ .attr("width", d.width)
212
+ .attr("height", d.height)
213
+ ;
214
+ })
215
+ ;
216
+ }
217
+ allowResize: { (): boolean; (_: boolean): ResizeSurface; };
218
+ }
219
+ ResizeSurface.prototype._class += " common_ResizeSurface";
220
+
221
+ ResizeSurface.prototype.publish("allowResize", true, "boolean", "Sets if surface can be resized", null, { tags: ["Private", "Shared"] });