@hpcc-js/common 2.73.0 → 3.1.0

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 (142) hide show
  1. package/dist/index.css +2 -0
  2. package/dist/index.css.map +7 -0
  3. package/dist/index.js +30 -15313
  4. package/dist/index.js.map +7 -1
  5. package/package.json +28 -34
  6. package/src/CanvasWidget.ts +1 -1
  7. package/src/Class.ts +5 -0
  8. package/src/Database.ts +10 -6
  9. package/src/Entity.ts +5 -5
  10. package/src/EntityCard.ts +1 -1
  11. package/src/EntityPin.ts +1 -1
  12. package/src/EntityRect.ts +54 -36
  13. package/src/EntityVertex.ts +2 -2
  14. package/src/FAChar.ts +14 -7
  15. package/src/HTMLWidget.ts +1 -1
  16. package/src/Icon.ts +27 -15
  17. package/src/Image.ts +16 -7
  18. package/src/List.ts +9 -4
  19. package/src/Menu.ts +11 -6
  20. package/src/ProgressBar.ts +28 -18
  21. package/src/PropertyExt.ts +1 -24
  22. package/src/ResizeSurface.ts +6 -2
  23. package/src/SVGWidget.ts +5 -7
  24. package/src/SVGZoomWidget.ts +3 -3
  25. package/src/Shape.ts +1 -1
  26. package/src/Surface.ts +32 -17
  27. package/src/Text.ts +1 -1
  28. package/src/TextBox.ts +34 -19
  29. package/src/TitleBar.ts +3 -3
  30. package/src/Widget.ts +7 -8
  31. package/src/WidgetArray.ts +7 -5
  32. package/src/__package__.ts +1 -1
  33. package/src/index.ts +32 -32
  34. package/types/CanvasWidget.d.ts +1 -2
  35. package/types/Class.d.ts +2 -1
  36. package/types/Database.d.ts +9 -18
  37. package/types/Entity.d.ts +5 -6
  38. package/types/EntityCard.d.ts +1 -2
  39. package/types/EntityPin.d.ts +1 -2
  40. package/types/EntityRect.d.ts +35 -20
  41. package/types/EntityVertex.d.ts +2 -3
  42. package/types/FAChar.d.ts +11 -18
  43. package/types/HTMLWidget.d.ts +1 -2
  44. package/types/IList.d.ts +0 -1
  45. package/types/IMenu.d.ts +0 -1
  46. package/types/Icon.d.ts +23 -40
  47. package/types/Image.d.ts +15 -26
  48. package/types/List.d.ts +6 -7
  49. package/types/Menu.d.ts +10 -13
  50. package/types/Palette.d.ts +0 -1
  51. package/types/Platform.d.ts +0 -1
  52. package/types/ProgressBar.d.ts +19 -10
  53. package/types/PropertyExt.d.ts +1 -13
  54. package/types/ResizeSurface.d.ts +5 -6
  55. package/types/SVGWidget.d.ts +1 -3
  56. package/types/SVGZoomWidget.d.ts +2 -3
  57. package/types/Shape.d.ts +1 -2
  58. package/types/Surface.d.ts +27 -50
  59. package/types/Text.d.ts +1 -2
  60. package/types/TextBox.d.ts +32 -57
  61. package/types/TitleBar.d.ts +2 -3
  62. package/types/Transition.d.ts +0 -1
  63. package/types/Utility.d.ts +0 -1
  64. package/types/Widget.d.ts +4 -5
  65. package/types/WidgetArray.d.ts +5 -4
  66. package/types/__package__.d.ts +1 -2
  67. package/types/index.d.ts +32 -33
  68. package/dist/index.es6.js +0 -15067
  69. package/dist/index.es6.js.map +0 -1
  70. package/dist/index.min.js +0 -2
  71. package/dist/index.min.js.map +0 -1
  72. package/font-awesome/css/font-awesome.css +0 -2337
  73. package/font-awesome/css/font-awesome.css.map +0 -7
  74. package/font-awesome/css/font-awesome.min.css +0 -4
  75. package/types/CanvasWidget.d.ts.map +0 -1
  76. package/types/Class.d.ts.map +0 -1
  77. package/types/Database.d.ts.map +0 -1
  78. package/types/Entity.d.ts.map +0 -1
  79. package/types/EntityCard.d.ts.map +0 -1
  80. package/types/EntityPin.d.ts.map +0 -1
  81. package/types/EntityRect.d.ts.map +0 -1
  82. package/types/EntityVertex.d.ts.map +0 -1
  83. package/types/FAChar.d.ts.map +0 -1
  84. package/types/HTMLWidget.d.ts.map +0 -1
  85. package/types/IList.d.ts.map +0 -1
  86. package/types/IMenu.d.ts.map +0 -1
  87. package/types/Icon.d.ts.map +0 -1
  88. package/types/Image.d.ts.map +0 -1
  89. package/types/List.d.ts.map +0 -1
  90. package/types/Menu.d.ts.map +0 -1
  91. package/types/Palette.d.ts.map +0 -1
  92. package/types/Platform.d.ts.map +0 -1
  93. package/types/ProgressBar.d.ts.map +0 -1
  94. package/types/PropertyExt.d.ts.map +0 -1
  95. package/types/ResizeSurface.d.ts.map +0 -1
  96. package/types/SVGWidget.d.ts.map +0 -1
  97. package/types/SVGZoomWidget.d.ts.map +0 -1
  98. package/types/Shape.d.ts.map +0 -1
  99. package/types/Surface.d.ts.map +0 -1
  100. package/types/Text.d.ts.map +0 -1
  101. package/types/TextBox.d.ts.map +0 -1
  102. package/types/TitleBar.d.ts.map +0 -1
  103. package/types/Transition.d.ts.map +0 -1
  104. package/types/Utility.d.ts.map +0 -1
  105. package/types/Widget.d.ts.map +0 -1
  106. package/types/WidgetArray.d.ts.map +0 -1
  107. package/types/__package__.d.ts.map +0 -1
  108. package/types/index.d.ts.map +0 -1
  109. package/types-3.4/CanvasWidget.d.ts +0 -9
  110. package/types-3.4/Class.d.ts +0 -13
  111. package/types-3.4/Database.d.ts +0 -137
  112. package/types-3.4/Entity.d.ts +0 -89
  113. package/types-3.4/EntityCard.d.ts +0 -14
  114. package/types-3.4/EntityPin.d.ts +0 -23
  115. package/types-3.4/EntityRect.d.ts +0 -46
  116. package/types-3.4/EntityVertex.d.ts +0 -31
  117. package/types-3.4/FAChar.d.ts +0 -30
  118. package/types-3.4/HTMLWidget.d.ts +0 -28
  119. package/types-3.4/IList.d.ts +0 -5
  120. package/types-3.4/IMenu.d.ts +0 -6
  121. package/types-3.4/Icon.d.ts +0 -63
  122. package/types-3.4/Image.d.ts +0 -34
  123. package/types-3.4/List.d.ts +0 -16
  124. package/types-3.4/Menu.d.ts +0 -29
  125. package/types-3.4/Palette.d.ts +0 -20
  126. package/types-3.4/Platform.d.ts +0 -6
  127. package/types-3.4/ProgressBar.d.ts +0 -22
  128. package/types-3.4/PropertyExt.d.ts +0 -115
  129. package/types-3.4/ResizeSurface.d.ts +0 -24
  130. package/types-3.4/SVGWidget.d.ts +0 -78
  131. package/types-3.4/SVGZoomWidget.d.ts +0 -74
  132. package/types-3.4/Shape.d.ts +0 -35
  133. package/types-3.4/Surface.d.ts +0 -70
  134. package/types-3.4/Text.d.ts +0 -38
  135. package/types-3.4/TextBox.d.ts +0 -77
  136. package/types-3.4/TitleBar.d.ts +0 -118
  137. package/types-3.4/Transition.d.ts +0 -12
  138. package/types-3.4/Utility.d.ts +0 -103
  139. package/types-3.4/Widget.d.ts +0 -154
  140. package/types-3.4/WidgetArray.d.ts +0 -7
  141. package/types-3.4/__package__.d.ts +0 -4
  142. package/types-3.4/index.d.ts +0 -53
package/package.json CHANGED
@@ -1,46 +1,41 @@
1
1
  {
2
2
  "name": "@hpcc-js/common",
3
- "version": "2.73.0",
3
+ "version": "3.1.0",
4
4
  "description": "hpcc-js - Viz Common",
5
- "main": "dist/index.js",
6
- "module": "dist/index.es6",
7
- "unpkg": "dist/index.min.js",
8
- "jsdelivr": "dist/index.min.js",
9
- "types": "types/index.d.ts",
10
- "typesVersions": {
11
- "<3.8": {
12
- "*": [
13
- "types-3.4/index.d.ts"
14
- ]
5
+ "type": "module",
6
+ "exports": {
7
+ ".": {
8
+ "types": "./types/index.d.ts",
9
+ "default": "./dist/index.js"
15
10
  }
16
11
  },
12
+ "module": "./dist/index.js",
13
+ "browser": "./dist/index.js",
14
+ "types": "./types/index.d.ts",
17
15
  "files": [
18
16
  "dist/*",
19
- "types/*",
20
- "types-3.4/*",
21
17
  "src/*",
18
+ "types/*",
22
19
  "font-awesome/**/*"
23
20
  ],
24
21
  "scripts": {
25
- "clean": "rimraf --glob lib* types dist *.tsbuildinfo",
26
- "copy-resources": "cpx \"../../node_modules/font-awesome/fonts/*\" \"./font-awesome/fonts\" && cpx \"../../node_modules/font-awesome/css/*\" \"./font-awesome/css\"",
27
- "compile-es6": "tsc --module es6 --outDir ./lib-es6",
28
- "compile-es6-watch": "npm run compile-es6 -- -w",
29
- "compile-umd": "tsc --module umd --outDir ./lib-umd",
30
- "compile-umd-watch": "npm run compile-umd -- -w",
31
- "bundle": "rollup -c",
32
- "bundle-watch": "npm run bundle -- -w",
33
- "minimize": "terser dist/index.js -c -m --source-map \"content='dist/index.js.map',url='index.min.js.map'\" -o dist/index.min.js",
34
- "gen-legacy-types": "downlevel-dts ./types ./types-3.4",
35
- "build": "npm run compile-es6 && npm run copy-resources && npm run bundle",
36
- "watch": "npm-run-all compile-es6 -p compile-es6-watch bundle-watch",
22
+ "clean": "rimraf --glob lib* types dist *.tsbuildinfo .turbo",
23
+ "bundle": "node esbuild.js",
24
+ "bundle-watch": "npm run bundle -- --development --watch",
25
+ "gen-types": "tsc --project tsconfig.json",
26
+ "gen-types-watch": "npm run gen-types -- --watch",
27
+ "build": "run-p gen-types bundle",
37
28
  "stamp": "node ../../node_modules/@hpcc-js/bundle/src/stamp.js",
38
29
  "lint": "eslint ./src",
30
+ "lint-fix": "eslint --fix src/**/*.ts",
39
31
  "docs": "typedoc --options tdoptions.json .",
40
- "update": "npx --yes npm-check-updates -u -t minor"
32
+ "test-browser": "vitest run --project browser",
33
+ "test": "vitest run",
34
+ "coverage": "vitest run --coverage",
35
+ "update": "npx -y npm-check-updates -u -t minor"
41
36
  },
42
37
  "dependencies": {
43
- "@hpcc-js/util": "^2.53.0",
38
+ "@hpcc-js/util": "^3.1.0",
44
39
  "@types/d3-array": "1.2.12",
45
40
  "@types/d3-brush": "1.1.8",
46
41
  "@types/d3-collection": "1.0.13",
@@ -52,14 +47,14 @@
52
47
  "@types/d3-format": "1.4.5",
53
48
  "@types/d3-interpolate": "1.4.5",
54
49
  "@types/d3-scale": "1.0.22",
55
- "@types/d3-selection": "1.4.6",
50
+ "@types/d3-selection": "1.4.7",
56
51
  "@types/d3-time-format": "2.3.4",
57
- "@types/d3-transition": "1.3.5",
52
+ "@types/d3-transition": "1.3.6",
58
53
  "@types/d3-zoom": "1.8.7"
59
54
  },
60
55
  "devDependencies": {
61
- "@hpcc-js/bundle": "^2.12.0",
62
- "colorbrewer": "1.5.6",
56
+ "@hpcc-js/esbuild-plugins": "^1.2.0",
57
+ "colorbrewer": "1.5.7",
63
58
  "d3-array": "^1",
64
59
  "d3-brush": "^1",
65
60
  "d3-collection": "^1",
@@ -76,8 +71,7 @@
76
71
  "d3-time-format": "^2",
77
72
  "d3-transition": "^1",
78
73
  "d3-zoom": "^1",
79
- "font-awesome": "4.7.0",
80
- "tslib": "2.7.0"
74
+ "font-awesome": "4.7.0"
81
75
  },
82
76
  "repository": {
83
77
  "type": "git",
@@ -90,5 +84,5 @@
90
84
  "url": "https://github.com/hpcc-systems/Visualization/issues"
91
85
  },
92
86
  "homepage": "https://github.com/hpcc-systems/Visualization",
93
- "gitHead": "fbbef050700b0e9d76ef99714856383d95155149"
87
+ "gitHead": "3f6146539f487dca08a35cdd5f94ca29609b4343"
94
88
  }
@@ -1,4 +1,4 @@
1
- import { HTMLWidget } from "./HTMLWidget";
1
+ import { HTMLWidget } from "./HTMLWidget.ts";
2
2
 
3
3
  export class CanvasWidget extends HTMLWidget {
4
4
 
package/src/Class.ts CHANGED
@@ -12,8 +12,13 @@ function applyMixins(derivedCtor: any, baseCtors: any[]) {
12
12
  }
13
13
 
14
14
  export class Class {
15
+ static _class: string;
15
16
  _class: string;
16
17
 
18
+ constructor() {
19
+ this._class = Object.getPrototypeOf(this)._class;
20
+ }
21
+
17
22
  class(): string;
18
23
  class(_: string): this;
19
24
  class(_?: string): string | this {
package/src/Database.ts CHANGED
@@ -3,8 +3,8 @@ import { map as d3Map, nest as d3Nest } from "d3-collection";
3
3
  import { csvFormatRows as d3CsvFormatRows, csvParse as d3CsvParse, tsvFormatRows as d3TsvFormatRows, tsvParse as d3TsvParse } from "d3-dsv";
4
4
  import { format as d3Format } from "d3-format";
5
5
  import { timeFormat as d3TimeFormat, timeParse as d3TimeParse } from "d3-time-format";
6
- import { PropertyExt } from "./PropertyExt";
7
- import * as Utility from "./Utility";
6
+ import { PropertyExt } from "./PropertyExt.ts";
7
+ import * as Utility from "./Utility.ts";
8
8
 
9
9
  const d3Aggr = {
10
10
  min: d3Min,
@@ -173,16 +173,20 @@ export class Field extends PropertyExt {
173
173
  return this;
174
174
  }
175
175
 
176
- label_default: { (): string; (x: string): Field; };
177
- label: { (): string; (x: string): Field; };
178
- mask: { (): string; (x: string): Field; };
179
- format: { (): string; (x: string): Field; };
180
176
  }
181
177
  Field.prototype._class += " common_Database.Field";
182
178
 
183
179
  export interface Field {
180
+ label(): string;
181
+ label(_: string): this;
182
+ label_default(): string;
183
+ label_default(_: string): this;
184
184
  type(): FieldType;
185
185
  type(_: FieldType): this;
186
+ mask(): string;
187
+ mask(_: string): this;
188
+ format(): string;
189
+ format(_: string): this;
186
190
  }
187
191
 
188
192
  Field.prototype.publish("label", "", "string", "Label", null, { optional: true });
package/src/Entity.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import { local as d3Local } from "d3-selection";
2
- import { Icon } from "./Icon";
3
- import { Shape } from "./Shape";
4
- import { SVGWidget } from "./SVGWidget";
5
- import { Text } from "./Text";
6
- import { BBox, Widget } from "./Widget";
2
+ import { Icon } from "./Icon.ts";
3
+ import { Shape } from "./Shape.ts";
4
+ import { SVGWidget } from "./SVGWidget.ts";
5
+ import { Text } from "./Text.ts";
6
+ import { BBox, Widget } from "./Widget.ts";
7
7
 
8
8
  export interface IAnnotation {
9
9
  faChar: string;
package/src/EntityCard.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Entity } from "./Entity";
1
+ import { Entity } from "./Entity.ts";
2
2
 
3
3
  export class EntityCard extends Entity {
4
4
  protected _element_textbox;
package/src/EntityPin.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Entity } from "./Entity";
1
+ import { Entity } from "./Entity.ts";
2
2
 
3
3
  export class EntityPin extends Entity {
4
4
  protected _element_textbox;
package/src/EntityRect.ts CHANGED
@@ -1,9 +1,8 @@
1
1
  import { local as d3Local, select as d3Select } from "d3-selection";
2
- import { Entity } from "./Entity";
3
- import { HTMLWidget } from "./HTMLWidget";
4
- import { publish } from "./PropertyExt";
5
- import * as Utility from "./Utility";
6
- import { InputField } from "./Widget";
2
+ import { Entity } from "./Entity.ts";
3
+ import { HTMLWidget } from "./HTMLWidget.ts";
4
+ import * as Utility from "./Utility.ts";
5
+ import { InputField } from "./Widget.ts";
7
6
 
8
7
  import "../src/EntityRect.css";
9
8
 
@@ -95,37 +94,6 @@ export class EntityRectList extends HTMLWidget {
95
94
  type: "string"
96
95
  }];
97
96
 
98
- @publish(64, "number", "fixedHeight")
99
- fixedHeight: publish<this, number>;
100
- @publish("#f8f8f8", "string", "Default Background Color", null, { inputType: "html-color" })
101
- backgroundColor: publish<this, string>;
102
- @publish(null, "set", "Background Color Column", function () { return this.columns(); }, { optional: true })
103
- backgroundColorColumn: publish<this, string>;
104
- @publish("black", "string", "Default Border Color", null, { inputType: "html-color" })
105
- borderColor: publish<this, string>;
106
- @publish(null, "set", "Border Color Column", function () { return this.columns(); }, { optional: true })
107
- borderColorColumn: publish<this, string>;
108
- @publish("", "string", "Icon")
109
- icon: publish<this, string>;
110
- @publish(null, "set", "Icon Column", function () { return this.columns(); }, { optional: true })
111
- iconColumn: publish<this, string>;
112
- @publish("red", "string", "Default Icon Color", null, { inputType: "html-color" })
113
- iconColor: publish<this, string>;
114
- @publish(null, "set", "Icon Color Column ", function () { return this.columns(); }, { optional: true })
115
- iconColorColumn: publish<this, string>;
116
- @publish(null, "set", "Title Column", function () { return this.columns(); }, { optional: true })
117
- titleColumn: publish<this, string>;
118
- @publish("black", "string", "Default Title Color", null, { inputType: "html-color" })
119
- titleColor: publish<this, string>;
120
- @publish(null, "set", "Title Color Column ", function () { return this.columns(); }, { optional: true })
121
- titleColorColumn: publish<this, string>;
122
- @publish(null, "set", "Description Column", function () { return this.columns(); }, { optional: true })
123
- descriptionColumn: publish<this, string>;
124
- @publish("black", "string", "Default Description Color", null, { inputType: "html-color" })
125
- descriptionColor: publish<this, string>;
126
- @publish(null, "set", "Description Color Column ", function () { return this.columns(); }, { optional: true })
127
- descriptionColorColumn: publish<this, string>;
128
-
129
97
  private _enityRectLocal = d3Local<EntityRect>();
130
98
 
131
99
  constructor() {
@@ -234,3 +202,53 @@ export class EntityRectList extends HTMLWidget {
234
202
  _selection;
235
203
  }
236
204
  EntityRectList.prototype._class += " common_EntityRectList";
205
+
206
+ export interface EntityRectList {
207
+ fixedHeight(): number;
208
+ fixedHeight(_: number): this;
209
+ backgroundColor(): string;
210
+ backgroundColor(_: string): this;
211
+ backgroundColorColumn(): string;
212
+ backgroundColorColumn(_: string): this;
213
+ borderColor(): string;
214
+ borderColor(_: string): this;
215
+ borderColorColumn(): string;
216
+ borderColorColumn(_: string): this;
217
+ icon(): string;
218
+ icon(_: string): this;
219
+ iconColumn(): string;
220
+ iconColumn(_: string): this;
221
+ iconColor(): string;
222
+ iconColor(_: string): this;
223
+ iconColorColumn(): string;
224
+ iconColorColumn(_: string): this;
225
+ titleColumn(): string;
226
+ titleColumn(_: string): this;
227
+ titleColor(): string;
228
+ titleColor(_: string): this;
229
+ titleColorColumn(): string;
230
+ titleColorColumn(_: string): this;
231
+ descriptionColumn(): string;
232
+ descriptionColumn(_: string): this;
233
+ descriptionColor(): string;
234
+ descriptionColor(_: string): this;
235
+ descriptionColorColumn(): string;
236
+ descriptionColorColumn(_: string): this;
237
+ }
238
+
239
+ EntityRectList.prototype.publish("fixedHeight", 64, "number", "fixedHeight");
240
+ EntityRectList.prototype.publish("backgroundColor", "#f8f8f8", "string", "Default Background Color", null, { inputType: "html-color" });
241
+ EntityRectList.prototype.publish("backgroundColorColumn", null, "set", "Background Color Column", function () { return this.columns(); }, { optional: true });
242
+ EntityRectList.prototype.publish("borderColor", "black", "string", "Default Border Color", null, { inputType: "html-color" });
243
+ EntityRectList.prototype.publish("borderColorColumn", null, "set", "Border Color Column", function () { return this.columns(); }, { optional: true });
244
+ EntityRectList.prototype.publish("icon", "", "string", "Icon");
245
+ EntityRectList.prototype.publish("iconColumn", null, "set", "Icon Column", function () { return this.columns(); }, { optional: true });
246
+ EntityRectList.prototype.publish("iconColor", "red", "string", "Default Icon Color", null, { inputType: "html-color" });
247
+ EntityRectList.prototype.publish("iconColorColumn", null, "set", "Icon Color Column ", function () { return this.columns(); }, { optional: true });
248
+ EntityRectList.prototype.publish("titleColumn", null, "set", "Title Column", function () { return this.columns(); }, { optional: true });
249
+ EntityRectList.prototype.publish("titleColor", "black", "string", "Default Title Color", null, { inputType: "html-color" });
250
+ EntityRectList.prototype.publish("titleColorColumn", null, "set", "Title Color Column ", function () { return this.columns(); }, { optional: true });
251
+ EntityRectList.prototype.publish("descriptionColumn", null, "set", "Description Column", function () { return this.columns(); }, { optional: true });
252
+ EntityRectList.prototype.publish("descriptionColor", "black", "string", "Default Description Color", null, { inputType: "html-color" });
253
+ EntityRectList.prototype.publish("descriptionColorColumn", null, "set", "Description Color Column ", function () { return this.columns(); }, { optional: true });
254
+
@@ -1,5 +1,5 @@
1
- import { Entity } from "./Entity";
2
- import { TextBox } from "./TextBox";
1
+ import { Entity } from "./Entity.ts";
2
+ import { TextBox } from "./TextBox.ts";
3
3
 
4
4
  export class EntityVertex extends Entity {
5
5
  protected _textbox_widget: TextBox;
package/src/FAChar.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { SVGWidget } from "./SVGWidget";
2
- import { Text } from "./Text";
3
- import * as Utility from "./Utility";
1
+ import { SVGWidget } from "./SVGWidget.ts";
2
+ import { Text } from "./Text.ts";
3
+ import * as Utility from "./Utility.ts";
4
4
 
5
5
  import "../src/FAChar.css";
6
6
 
@@ -61,13 +61,20 @@ export class FAChar extends SVGWidget {
61
61
  // console.log("Double click:", this);
62
62
  }
63
63
 
64
- char: { (): string; (_: string): FAChar; };
65
- fontSize: { (): number; (_: number): FAChar; };
66
- text_colorFill: { (): string; (_: string): FAChar; };
67
- text_fontFamily: { (): string; (_: string): FAChar; };
68
64
  }
69
65
  FAChar.prototype._class += " common_FAChar";
70
66
 
67
+ export interface FAChar {
68
+ char(): string;
69
+ char(_: string): this;
70
+ fontSize(): number;
71
+ fontSize(_: number): this;
72
+ text_colorFill(): string;
73
+ text_colorFill(_: string): this;
74
+ text_fontFamily(): string;
75
+ text_fontFamily(_: string): this;
76
+ }
77
+
71
78
  FAChar.prototype.publish("char", "", "set", "Font Awesome Item", Utility.faKeys(), { tags: ["Private"] });
72
79
  FAChar.prototype.publish("fontSize", null, "number", "Font Size", null, { tags: ["Private"] });
73
80
  FAChar.prototype.publishProxy("text_colorFill", "_text", "colorFill");
package/src/HTMLWidget.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { select as d3Select } from "d3-selection";
2
- import { Widget } from "./Widget";
2
+ import { Widget } from "./Widget.ts";
3
3
 
4
4
  export class HTMLWidget extends Widget {
5
5
 
package/src/Icon.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { FAChar } from "./FAChar";
2
- import { textColor } from "./Palette";
3
- import { Shape } from "./Shape";
4
- import { SVGWidget } from "./SVGWidget";
1
+ import { FAChar } from "./FAChar.ts";
2
+ import { textColor } from "./Palette.ts";
3
+ import { Shape } from "./Shape.ts";
4
+ import { SVGWidget } from "./SVGWidget.ts";
5
5
 
6
6
  import "../src/Icon.css";
7
7
 
@@ -138,20 +138,32 @@ export class Icon extends SVGWidget {
138
138
  ;
139
139
  }
140
140
 
141
- shape: { (): string; (_: string): Icon; };
142
- faChar: { (): string; (_: string): Icon; };
143
- imageUrl: { (): string; (_: string): Icon; };
144
- image_colorFill: { (): string; (_: string): Icon; };
145
- image_colorFill_exists: () => boolean;
146
- tooltip: { (): string; (_: string): Icon; };
147
- diameter: { (): number; (_: number): Icon; };
148
- paddingPercent: { (): number; (_: number): Icon; };
149
- shape_colorFill: { (): string; (_: string): Icon; };
150
- shape_colorFill_exists: () => boolean;
151
- shape_colorStroke: { (): string; (_: string): Icon; };
152
141
  }
153
142
  Icon.prototype._class += " common_Icon";
154
143
 
144
+ export interface Icon {
145
+ shape(): string;
146
+ shape(_: string): this;
147
+ faChar(): string;
148
+ faChar(_: string): this;
149
+ imageUrl(): string;
150
+ imageUrl(_: string): this;
151
+ image_colorFill(): string;
152
+ image_colorFill(_: string): this;
153
+ image_colorFill_exists(): boolean;
154
+ tooltip(): string;
155
+ tooltip(_: string): this;
156
+ diameter(): number;
157
+ diameter(_: number): this;
158
+ paddingPercent(): number;
159
+ paddingPercent(_: number): this;
160
+ shape_colorFill(): string;
161
+ shape_colorFill(_: string): this;
162
+ shape_colorFill_exists(): boolean;
163
+ shape_colorStroke(): string;
164
+ shape_colorStroke(_: string): this;
165
+ }
166
+
155
167
  Icon.prototype.publish("shape", "circle", "set", "Shape Type", ["circle", "square"], { tags: ["Private"] });
156
168
  Icon.prototype.publishProxy("faChar", "_faChar", "char");
157
169
  Icon.prototype.publishProxy("fontFamily", "_faChar", "text_fontFamily");
package/src/Image.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { select as d3Select } from "d3-selection";
2
- import { HTMLWidget } from "./HTMLWidget";
2
+ import { HTMLWidget } from "./HTMLWidget.ts";
3
3
 
4
4
  export class Image extends HTMLWidget {
5
5
  private _imgElement;
@@ -78,15 +78,24 @@ export class Image extends HTMLWidget {
78
78
  super.exit(domNode, element);
79
79
  }
80
80
 
81
- source: { (): string; (_: string): Image; };
82
- sizing: { (): string; (_: string): Image; };
83
- customWidth: { (): string; (_: string): Image; };
84
- customHeight: { (): string; (_: string): Image; };
85
- lockAspectRatio: { (): boolean; (_: boolean): Image; };
86
- alignment: { (): string; (_: string): Image; };
87
81
  }
88
82
  Image.prototype._class += " common_Image";
89
83
 
84
+ export interface Image {
85
+ source(): string;
86
+ source(_: string): this;
87
+ sizing(): "actual" | "fit" | "custom";
88
+ sizing(_: "actual" | "fit" | "custom"): this;
89
+ customWidth(): string;
90
+ customWidth(_: string): this;
91
+ customHeight(): string;
92
+ customHeight(_: string): this;
93
+ lockAspectRatio(): boolean;
94
+ lockAspectRatio(_: boolean): this;
95
+ alignment(): "center" | "origin";
96
+ alignment(_: "center" | "origin"): this;
97
+ }
98
+
90
99
  Image.prototype.publish("source", null, "string", "Image Source", null, { tags: ["Basic"] });
91
100
  Image.prototype.publish("sizing", "actual", "set", "Controls sizing mode", ["actual", "fit", "custom"], { tags: ["Basic"] });
92
101
  Image.prototype.publish("customWidth", "50%", "string", "Applies this width to IMG element if 'sizing' is set to 'custom' (user should set 'px' or 'em' etc.)", null, { tags: ["Basic"], disable: (w) => w.sizing() !== "custom" });
package/src/List.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { IList } from "./IList";
2
- import { SVGWidget } from "./SVGWidget";
3
- import { TextBox } from "./TextBox";
1
+ import { IList } from "./IList.ts";
2
+ import { SVGWidget } from "./SVGWidget.ts";
3
+ import { TextBox } from "./TextBox.ts";
4
4
 
5
5
  import "../src/List.css";
6
6
 
@@ -92,8 +92,13 @@ export class List extends SVGWidget implements IList {
92
92
  // console.log("Double click: " + d);
93
93
  }
94
94
 
95
- anchor: { (): string; (_: string): List; };
95
+ // anchor: { (): string; (_: string): List; };
96
96
  }
97
97
  List.prototype._class += " common_List";
98
98
 
99
+ export interface List {
100
+ anchor(): "" | "start" | "middle" | "end";
101
+ anchor(_: "" | "start" | "middle" | "end"): this;
102
+ }
103
+
99
104
  List.prototype.publish("anchor", "start", "set", "Anchor Position", ["", "start", "middle", "end"], { tags: ["Private"] });
package/src/Menu.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { event as d3Event, select as d3Select } from "d3-selection";
2
- import { Icon } from "./Icon";
3
- import { IMenu } from "./IMenu";
4
- import { List } from "./List";
5
- import { SVGWidget } from "./SVGWidget";
2
+ import { Icon } from "./Icon.ts";
3
+ import { IMenu } from "./IMenu.ts";
4
+ import { List } from "./List.ts";
5
+ import { SVGWidget } from "./SVGWidget.ts";
6
6
 
7
7
  import "../src/Menu.css";
8
8
 
@@ -125,10 +125,15 @@ export class Menu extends SVGWidget implements IMenu {
125
125
  postHideMenu() {
126
126
  }
127
127
 
128
- faChar: { (): string; (_: string): Menu; };
129
- paddingPercent: { (): number; (_: number): Menu; };
130
128
  }
131
129
  Menu.prototype._class += " common_Menu";
132
130
 
131
+ export interface Menu {
132
+ faChar(): string;
133
+ faChar(_: string): this;
134
+ paddingPercent(): number;
135
+ paddingPercent(_: number): this;
136
+ }
137
+
133
138
  Menu.prototype.publishProxy("faChar", "_icon", null, "\uf0c9");
134
139
  Menu.prototype.publishProxy("paddingPercent", "_icon", null, 10);
@@ -1,24 +1,7 @@
1
- import { PropertyExt, publish } from "./PropertyExt";
1
+ import { PropertyExt } from "./PropertyExt.ts";
2
2
 
3
3
  export class ProgressBar extends PropertyExt {
4
4
 
5
- @publish(5000, "number", "Half Life")
6
- halfLife: publish<this, number>;
7
- @publish(1.2, "number", "Decay")
8
- decay: publish<this, number>;
9
- @publish(2, "number", "Size")
10
- size: publish<this, number>;
11
- @publish("#2ed573", "string", "Color")
12
- color: publish<this, string>;
13
- @publish(true, "boolean", "Bar Blur")
14
- blurBar: publish<this, boolean>;
15
- @publish(50, "number", "Blur Size")
16
- blurSize: publish<this, number>;
17
- @publish("#7bed9f", "string", "Blur Color (hex)", null, { optional: true })
18
- blurColor: publish<this, string>;
19
- @publish(0.35, "number", "Blur Opacity")
20
- blurOpacity: publish<this, number>;
21
-
22
5
  protected _elementID: string;
23
6
  protected _running: boolean = false;
24
7
  protected _style;
@@ -103,3 +86,30 @@ export class ProgressBar extends PropertyExt {
103
86
  }
104
87
  }
105
88
  ProgressBar.prototype._class += " common_ProgressBar";
89
+
90
+ export interface ProgressBar {
91
+ halfLife(): number;
92
+ halfLife(_: number): this;
93
+ decay(): number;
94
+ decay(_: number): this;
95
+ size(): number;
96
+ size(_: number): this;
97
+ color(): string;
98
+ color(_: string): this;
99
+ blurBar(): boolean;
100
+ blurBar(_: boolean): this;
101
+ blurSize(): number;
102
+ blurSize(_: number): this;
103
+ blurColor(): string;
104
+ blurColor(_: string): this;
105
+ blurOpacity(): number;
106
+ blurOpacity(_: number): this;
107
+ }
108
+ ProgressBar.prototype.publish("halfLife", 5000, "number", "Half Life");
109
+ ProgressBar.prototype.publish("decay", 1.2, "number", "Decay");
110
+ ProgressBar.prototype.publish("size", 2, "number", "Size");
111
+ ProgressBar.prototype.publish("color", "#2ed573", "string", "Color");
112
+ ProgressBar.prototype.publish("blurBar", true, "boolean", "Bar Blur");
113
+ ProgressBar.prototype.publish("blurSize", 50, "number", "Blur Size");
114
+ ProgressBar.prototype.publish("blurColor", "#7bed9f", "string", "Blur Color (hex)", null, { optional: true });
115
+ ProgressBar.prototype.publish("blurOpacity", 0.35, "number", "Blur Opacity");
@@ -1,6 +1,6 @@
1
1
  import { hashSum } from "@hpcc-js/util";
2
2
  import { event as d3Event } from "d3-selection";
3
- import { Class } from "./Class";
3
+ import { Class } from "./Class.ts";
4
4
 
5
5
  const GEN_PUB_STUBS: boolean = false;
6
6
 
@@ -768,26 +768,3 @@ export class PropertyExt extends Class {
768
768
  }
769
769
  }
770
770
  PropertyExt.prototype._class += " common_PropertyExt";
771
-
772
- export function publish(defaultValue, type?: PublishTypes, description?: string, set?: string[] | (() => string[] | Array<{ value: string, text: string }>) | IPublishExt, ext: IPublishExt = {}) {
773
- return function (target: any, key: string) {
774
- if (!key) throw new Error("???");
775
- if (ext.reset) {
776
- target.publishReset();
777
- }
778
- target.publish(key, defaultValue, type, description, set, ext);
779
- };
780
- }
781
- export type publish<T, U> = {
782
- (_: U): T;
783
- (): U;
784
- };
785
-
786
- export function publishProxy(proxy: string, method?: string, defaultValue?, ext: { reset?: boolean } = {}) {
787
- return function (target: any, key: string) {
788
- if (ext.reset) {
789
- target.publishReset();
790
- }
791
- target.publishProxy(key, proxy, method, defaultValue);
792
- };
793
- }
@@ -1,7 +1,7 @@
1
1
  import { dispatch as d3Dispatch } from "d3-dispatch";
2
2
  import { drag as d3Drag } from "d3-drag";
3
3
  import { event as d3Event, select as d3Select } from "d3-selection";
4
- import { Surface } from "./Surface";
4
+ import { Surface } from "./Surface.ts";
5
5
 
6
6
  import "../src/ResizeSurface.css";
7
7
 
@@ -214,8 +214,12 @@ export class ResizeSurface extends Surface {
214
214
  })
215
215
  ;
216
216
  }
217
- allowResize: { (): boolean; (_: boolean): ResizeSurface; };
218
217
  }
219
218
  ResizeSurface.prototype._class += " common_ResizeSurface";
220
219
 
220
+ export interface ResizeSurface {
221
+ allowResize(): boolean;
222
+ allowResize(_: boolean): this;
223
+ }
224
+
221
225
  ResizeSurface.prototype.publish("allowResize", true, "boolean", "Sets if surface can be resized", null, { tags: ["Private", "Shared"] });
package/src/SVGWidget.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  import { rgb as d3Rgb } from "d3-color";
2
2
  import { select as d3Select } from "d3-selection";
3
- import { fontAwsesomeStyle } from "./FAChar";
4
- import { svgMarkerGlitch } from "./Platform";
5
- import { Transition } from "./Transition";
6
- import { debounce, downloadBlob, downloadString, timestamp } from "./Utility";
7
- import { ISize, Widget } from "./Widget";
3
+ import { fontAwsesomeStyle } from "./FAChar.ts";
4
+ import { svgMarkerGlitch } from "./Platform.ts";
5
+ import { Transition } from "./Transition.ts";
6
+ import { debounce, downloadBlob, downloadString, timestamp } from "./Utility.ts";
7
+ import { ISize, Widget } from "./Widget.ts";
8
8
 
9
9
  type Point = { x: number, y: number };
10
10
  type Rect = { x: number, y: number, width: number, height: number };
@@ -144,8 +144,6 @@ export class SVGGlowFilter {
144
144
  export class SVGWidget extends Widget {
145
145
  static _class = "common_SVGWidget";
146
146
 
147
- _tag;
148
-
149
147
  protected _boundingBox;
150
148
  protected transition;
151
149
  protected _drawStartPos: "center" | "origin";
@@ -1,8 +1,8 @@
1
1
  import { event as d3Event, mouse as d3Mouse } from "d3-selection";
2
2
  import { zoom as d3Zoom, zoomIdentity as d3ZoomIdentity } from "d3-zoom";
3
- import { SVGWidget } from "./SVGWidget";
4
- import { safeRaise } from "./Utility";
5
- import { Button, IconBar, Spacer, ToggleButton } from "./TitleBar";
3
+ import { SVGWidget } from "./SVGWidget.ts";
4
+ import { safeRaise } from "./Utility.ts";
5
+ import { Button, IconBar, Spacer, ToggleButton } from "./TitleBar.ts";
6
6
 
7
7
  import "../src/SVGZoomWidget.css";
8
8