@hpcc-js/common 2.73.3 → 2.73.4

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 (58) 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-3.4/__package__.d.ts +2 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hpcc-js/common",
3
- "version": "2.73.3",
3
+ "version": "2.73.4",
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.3",
43
+ "@hpcc-js/util": "^2.53.2",
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": "0907b8d15d369c89483954a1d96e2247ba020cb6"
93
+ "gitHead": "81822aa7c1ef1b1ad45ca4cf7769d13fdaf36fba"
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";