@hpcc-js/common 2.62.0 → 2.66.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 (92) hide show
  1. package/LICENSE +43 -43
  2. package/README.md +59 -59
  3. package/dist/index.es6.js +6607 -6607
  4. package/dist/index.es6.js.map +1 -1
  5. package/dist/index.js +6607 -6607
  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 +23 -39
  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 +138 -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 +350 -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 +820 -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/IList.d.ts +4 -4
  68. package/types/IMenu.d.ts +5 -5
  69. package/types/Icon.d.ts +62 -62
  70. package/types/Image.d.ts +33 -33
  71. package/types/List.d.ts +15 -15
  72. package/types/Menu.d.ts +28 -28
  73. package/types/Palette.d.ts +19 -19
  74. package/types/Platform.d.ts +5 -5
  75. package/types/ProgressBar.d.ts +21 -21
  76. package/types/PropertyExt.d.ts +114 -114
  77. package/types/ResizeSurface.d.ts +23 -23
  78. package/types/SVGWidget.d.ts +77 -77
  79. package/types/SVGZoomWidget.d.ts +68 -68
  80. package/types/Shape.d.ts +34 -34
  81. package/types/Surface.d.ts +69 -69
  82. package/types/Text.d.ts +37 -37
  83. package/types/TextBox.d.ts +76 -76
  84. package/types/TitleBar.d.ts +117 -117
  85. package/types/Transition.d.ts +11 -11
  86. package/types/Utility.d.ts +100 -100
  87. package/types/Widget.d.ts +149 -149
  88. package/types/WidgetArray.d.ts +6 -6
  89. package/types/__package__.d.ts +3 -3
  90. package/types/__package__.d.ts.map +1 -1
  91. package/types/index.d.ts +52 -52
  92. 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.62.0",
3
+ "version": "2.66.1",
4
4
  "description": "hpcc-js - Viz Common",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.es6",
@@ -34,37 +34,32 @@
34
34
  "gen-legacy-types": "downlevel-dts ./types ./types-3.4",
35
35
  "build": "npm run compile-es6 && npm run copy-resources && npm run bundle",
36
36
  "watch": "npm-run-all compile-es6 -p compile-es6-watch bundle-watch",
37
- "stamp": "node node_modules/@hpcc-js/bundle/src/stamp.js",
37
+ "stamp": "node ../../node_modules/@hpcc-js/bundle/src/stamp.js",
38
38
  "lint": "eslint src/**/*.ts",
39
- "docs": "typedoc --options tdoptions.json ."
39
+ "docs": "typedoc --options tdoptions.json .",
40
+ "update": "npx npm-check-updates -u -t minor"
40
41
  },
41
42
  "dependencies": {
42
- "@hpcc-js/util": "^2.42.0",
43
- "@types/d3-array": "1.2.6",
44
- "@types/d3-brush": "1.0.10",
45
- "@types/d3-collection": "1.0.8",
46
- "@types/d3-color": "1.2.2",
47
- "@types/d3-dispatch": "1.0.7",
48
- "@types/d3-drag": "1.2.3",
49
- "@types/d3-dsv": "1.0.36",
50
- "@types/d3-ease": "1.0.8",
51
- "@types/d3-format": "1.3.1",
52
- "@types/d3-interpolate": "1.3.1",
53
- "@types/d3-scale": "1.0.14",
54
- "@types/d3-selection": "1.4.1",
55
- "@types/d3-time-format": "2.1.1",
43
+ "@hpcc-js/util": "^2.46.1",
44
+ "@types/d3-array": "1.2.9",
45
+ "@types/d3-brush": "1.1.5",
46
+ "@types/d3-collection": "1.0.10",
47
+ "@types/d3-color": "1.4.2",
48
+ "@types/d3-dispatch": "1.0.9",
49
+ "@types/d3-drag": "1.2.5",
50
+ "@types/d3-dsv": "1.2.1",
51
+ "@types/d3-ease": "1.0.11",
52
+ "@types/d3-format": "1.4.2",
53
+ "@types/d3-interpolate": "1.4.2",
54
+ "@types/d3-scale": "1.0.17",
55
+ "@types/d3-selection": "1.4.3",
56
+ "@types/d3-time-format": "2.3.1",
56
57
  "@types/d3-transition": "1.3.2",
57
- "@types/d3-zoom": "1.7.4"
58
+ "@types/d3-zoom": "1.8.3"
58
59
  },
59
60
  "devDependencies": {
60
- "@hpcc-js/bundle": "^2.10.21",
61
- "@rollup/plugin-alias": "3.1.9",
62
- "@rollup/plugin-commonjs": "21.0.1",
63
- "@rollup/plugin-node-resolve": "13.1.3",
64
- "@typescript-eslint/eslint-plugin": "5.10.1",
65
- "@typescript-eslint/parser": "5.10.1",
66
- "colorbrewer": "1.5.1",
67
- "cpx": "1.5.0",
61
+ "@hpcc-js/bundle": "^2.11.1",
62
+ "colorbrewer": "1.5.2",
68
63
  "d3-array": "^1",
69
64
  "d3-brush": "^1",
70
65
  "d3-collection": "^1",
@@ -81,19 +76,8 @@
81
76
  "d3-time-format": "^2",
82
77
  "d3-transition": "^1",
83
78
  "d3-zoom": "^1",
84
- "downlevel-dts": "0.6.0",
85
- "eslint": "8.8.0",
86
- "eslint-plugin-react-hooks": "^4.3.0",
87
79
  "font-awesome": "4.7.0",
88
- "npm-run-all": "4.1.5",
89
- "rimraf": "3.0.2",
90
- "rollup": "2.66.1",
91
- "rollup-plugin-postcss": "4.0.2",
92
- "rollup-plugin-sourcemaps": "0.6.3",
93
- "terser": "5.10.0",
94
- "tslib": "2.3.1",
95
- "typedoc": "0.22.11",
96
- "typescript": "4.5.5"
80
+ "tslib": "2.3.1"
97
81
  },
98
82
  "repository": {
99
83
  "type": "git",
@@ -106,5 +90,5 @@
106
90
  "url": "https://github.com/hpcc-systems/Visualization/issues"
107
91
  },
108
92
  "homepage": "https://github.com/hpcc-systems/Visualization",
109
- "gitHead": "481c2fc2b4389cb32900bf2735bed31e7bfb7dfd"
93
+ "gitHead": "f3b1c5ca78cacee343620baef022e0d04a3678a8"
110
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 + " 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 + " 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";