@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hpcc-js/common",
3
- "version": "2.73.2",
3
+ "version": "2.73.3",
4
4
  "description": "hpcc-js - Viz Common",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.es6",
@@ -40,7 +40,7 @@
40
40
  "update": "npx --yes npm-check-updates -u -t minor"
41
41
  },
42
42
  "dependencies": {
43
- "@hpcc-js/util": "^2.53.1",
43
+ "@hpcc-js/util": "^2.53.3",
44
44
  "@types/d3-array": "1.2.12",
45
45
  "@types/d3-brush": "1.1.8",
46
46
  "@types/d3-collection": "1.0.13",
@@ -90,5 +90,5 @@
90
90
  "url": "https://github.com/hpcc-systems/Visualization/issues"
91
91
  },
92
92
  "homepage": "https://github.com/hpcc-systems/Visualization",
93
- "gitHead": "84f852a555c8d7b7381e4fcb93bfad829b1db62e"
93
+ "gitHead": "0907b8d15d369c89483954a1d96e2247ba020cb6"
94
94
  }
@@ -1,31 +1,31 @@
1
- import { HTMLWidget } from "./HTMLWidget";
2
-
3
- export class CanvasWidget extends HTMLWidget {
4
-
5
- _ctx: CanvasRenderingContext2D;
6
- constructor() {
7
- super();
8
- this._tag = "canvas";
9
- }
10
-
11
- resize(size) {
12
- const retVal = super.resize(size);
13
- try {
14
- this._element.attr("width", this._size.width);
15
- this._element.attr("height", this._size.height);
16
- this.resetContext();
17
- } catch (e) {
18
- console.error(e);
19
- }
20
- return retVal;
21
- }
22
-
23
- resetContext() {
24
- this._ctx = this._element.node().getContext("2d");
25
- }
26
-
27
- click(d, c) {
28
- // console.log(d);
29
- }
30
- }
31
- CanvasWidget.prototype._class += " common_CanvasWidget";
1
+ import { HTMLWidget } from "./HTMLWidget";
2
+
3
+ export class CanvasWidget extends HTMLWidget {
4
+
5
+ _ctx: CanvasRenderingContext2D;
6
+ constructor() {
7
+ super();
8
+ this._tag = "canvas";
9
+ }
10
+
11
+ resize(size) {
12
+ const retVal = super.resize(size);
13
+ try {
14
+ this._element.attr("width", this._size.width);
15
+ this._element.attr("height", this._size.height);
16
+ this.resetContext();
17
+ } catch (e) {
18
+ console.error(e);
19
+ }
20
+ return retVal;
21
+ }
22
+
23
+ resetContext() {
24
+ this._ctx = this._element.node().getContext("2d");
25
+ }
26
+
27
+ click(d, c) {
28
+ // console.log(d);
29
+ }
30
+ }
31
+ CanvasWidget.prototype._class += " common_CanvasWidget";
package/src/Class.ts CHANGED
@@ -1,67 +1,67 @@
1
- import { classID2Meta, ClassMeta } from "@hpcc-js/util";
2
-
3
- function applyMixins(derivedCtor: any, baseCtors: any[]) {
4
- baseCtors.forEach(baseCtor => {
5
- Object.getOwnPropertyNames(baseCtor).forEach(name => {
6
- if (name !== "constructor") {
7
- const descriptor = Object.getOwnPropertyDescriptor(baseCtor, name);
8
- Object.defineProperty(derivedCtor, name, descriptor);
9
- }
10
- });
11
- });
12
- }
13
-
14
- export class Class {
15
- _class: string;
16
-
17
- class(): string;
18
- class(_: string): this;
19
- class(_?: string): string | this {
20
- if (!arguments.length) return this._class;
21
- this._class = _;
22
- return this;
23
- }
24
-
25
- classID() {
26
- return this._class.split(" ").pop();
27
- }
28
-
29
- classMeta(): ClassMeta {
30
- return classID2Meta(this.classID());
31
- }
32
-
33
- implements(source) {
34
- applyMixins(this, [source]);
35
- }
36
-
37
- mixin(mixinClass) {
38
- this.implements(mixinClass.prototype);
39
- // Special case mixins ---
40
- if (mixinClass.prototype.hasOwnProperty("_class")) {
41
- this._class += " " + mixinClass.prototype._class.split(" ").pop();
42
- }
43
- }
44
-
45
- overrideMethod<M extends keyof this>(methodID: M, newMethod: this[M]): this {
46
- if (this[methodID] === undefined) {
47
- throw new Error(`Method: ${methodID.toString()} does not exist.`);
48
- }
49
- const origMethod = this[methodID];
50
- this[methodID] = function () {
51
- arguments[arguments.length] = origMethod;
52
- arguments.length++;
53
- return (newMethod as any).apply(this, arguments);
54
- } as any;
55
- return this;
56
- }
57
-
58
- cssTag(id: string): string {
59
- return ("" + id).replace(/[^a-z0-9]/g, (s) => {
60
- const c = s.charCodeAt(0);
61
- if (c === 32) return "-";
62
- if (c >= 65 && c <= 90) return "_" + s.toLowerCase();
63
- return "_0x" + c.toString(16);
64
- });
65
- }
66
- }
67
- Class.prototype._class = "common_Class";
1
+ import { classID2Meta, ClassMeta } from "@hpcc-js/util";
2
+
3
+ function applyMixins(derivedCtor: any, baseCtors: any[]) {
4
+ baseCtors.forEach(baseCtor => {
5
+ Object.getOwnPropertyNames(baseCtor).forEach(name => {
6
+ if (name !== "constructor") {
7
+ const descriptor = Object.getOwnPropertyDescriptor(baseCtor, name);
8
+ Object.defineProperty(derivedCtor, name, descriptor);
9
+ }
10
+ });
11
+ });
12
+ }
13
+
14
+ export class Class {
15
+ _class: string;
16
+
17
+ class(): string;
18
+ class(_: string): this;
19
+ class(_?: string): string | this {
20
+ if (!arguments.length) return this._class;
21
+ this._class = _;
22
+ return this;
23
+ }
24
+
25
+ classID() {
26
+ return this._class.split(" ").pop();
27
+ }
28
+
29
+ classMeta(): ClassMeta {
30
+ return classID2Meta(this.classID());
31
+ }
32
+
33
+ implements(source) {
34
+ applyMixins(this, [source]);
35
+ }
36
+
37
+ mixin(mixinClass) {
38
+ this.implements(mixinClass.prototype);
39
+ // Special case mixins ---
40
+ if (mixinClass.prototype.hasOwnProperty("_class")) {
41
+ this._class += " " + mixinClass.prototype._class.split(" ").pop();
42
+ }
43
+ }
44
+
45
+ overrideMethod<M extends keyof this>(methodID: M, newMethod: this[M]): this {
46
+ if (this[methodID] === undefined) {
47
+ throw new Error(`Method: ${methodID.toString()} does not exist.`);
48
+ }
49
+ const origMethod = this[methodID];
50
+ this[methodID] = function () {
51
+ arguments[arguments.length] = origMethod;
52
+ arguments.length++;
53
+ return (newMethod as any).apply(this, arguments);
54
+ } as any;
55
+ return this;
56
+ }
57
+
58
+ cssTag(id: string): string {
59
+ return ("" + id).replace(/[^a-z0-9]/g, (s) => {
60
+ const c = s.charCodeAt(0);
61
+ if (c === 32) return "-";
62
+ if (c >= 65 && c <= 90) return "_" + s.toLowerCase();
63
+ return "_0x" + c.toString(16);
64
+ });
65
+ }
66
+ }
67
+ Class.prototype._class = "common_Class";