@hpcc-js/common 2.73.0 → 3.2.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 (143) hide show
  1. package/dist/index.js +294 -15311
  2. package/dist/index.js.map +7 -1
  3. package/package.json +31 -36
  4. package/src/CanvasWidget.ts +1 -1
  5. package/src/Class.ts +5 -0
  6. package/src/Database.ts +10 -6
  7. package/src/Entity.ts +5 -5
  8. package/src/EntityCard.ts +1 -1
  9. package/src/EntityPin.ts +1 -1
  10. package/src/EntityRect.ts +54 -36
  11. package/src/EntityVertex.ts +2 -2
  12. package/src/FAChar.ts +14 -7
  13. package/src/HTMLWidget.ts +1 -1
  14. package/src/Icon.ts +27 -15
  15. package/src/Image.ts +16 -7
  16. package/src/List.ts +8 -5
  17. package/src/Menu.ts +11 -6
  18. package/src/Palette.ts +6 -6
  19. package/src/ProgressBar.ts +28 -18
  20. package/src/PropertyExt.ts +7 -30
  21. package/src/ResizeSurface.ts +6 -2
  22. package/src/SVGWidget.ts +6 -8
  23. package/src/SVGZoomWidget.ts +4 -3
  24. package/src/Shape.ts +1 -1
  25. package/src/Surface.ts +32 -17
  26. package/src/Text.ts +1 -1
  27. package/src/TextBox.ts +34 -19
  28. package/src/TitleBar.ts +3 -3
  29. package/src/Transition.ts +3 -3
  30. package/src/Utility.ts +3 -3
  31. package/src/Widget.ts +11 -10
  32. package/src/WidgetArray.ts +7 -5
  33. package/src/__package__.ts +2 -2
  34. package/src/index.ts +32 -32
  35. package/types/CanvasWidget.d.ts +1 -2
  36. package/types/Class.d.ts +2 -1
  37. package/types/Database.d.ts +9 -18
  38. package/types/Entity.d.ts +5 -6
  39. package/types/EntityCard.d.ts +1 -2
  40. package/types/EntityPin.d.ts +1 -2
  41. package/types/EntityRect.d.ts +35 -20
  42. package/types/EntityVertex.d.ts +2 -3
  43. package/types/FAChar.d.ts +11 -18
  44. package/types/HTMLWidget.d.ts +1 -2
  45. package/types/IList.d.ts +0 -1
  46. package/types/IMenu.d.ts +0 -1
  47. package/types/Icon.d.ts +23 -40
  48. package/types/Image.d.ts +15 -26
  49. package/types/List.d.ts +6 -7
  50. package/types/Menu.d.ts +10 -13
  51. package/types/Palette.d.ts +0 -1
  52. package/types/Platform.d.ts +0 -1
  53. package/types/ProgressBar.d.ts +19 -10
  54. package/types/PropertyExt.d.ts +1 -13
  55. package/types/ResizeSurface.d.ts +5 -6
  56. package/types/SVGWidget.d.ts +2 -4
  57. package/types/SVGZoomWidget.d.ts +2 -3
  58. package/types/Shape.d.ts +1 -2
  59. package/types/Surface.d.ts +27 -50
  60. package/types/Text.d.ts +1 -2
  61. package/types/TextBox.d.ts +32 -57
  62. package/types/TitleBar.d.ts +2 -3
  63. package/types/Transition.d.ts +3 -4
  64. package/types/Utility.d.ts +3 -4
  65. package/types/Widget.d.ts +6 -6
  66. package/types/WidgetArray.d.ts +5 -4
  67. package/types/__package__.d.ts +2 -3
  68. package/types/index.d.ts +32 -33
  69. package/dist/index.es6.js +0 -15067
  70. package/dist/index.es6.js.map +0 -1
  71. package/dist/index.min.js +0 -2
  72. package/dist/index.min.js.map +0 -1
  73. package/font-awesome/css/font-awesome.css +0 -2337
  74. package/font-awesome/css/font-awesome.css.map +0 -7
  75. package/font-awesome/css/font-awesome.min.css +0 -4
  76. package/types/CanvasWidget.d.ts.map +0 -1
  77. package/types/Class.d.ts.map +0 -1
  78. package/types/Database.d.ts.map +0 -1
  79. package/types/Entity.d.ts.map +0 -1
  80. package/types/EntityCard.d.ts.map +0 -1
  81. package/types/EntityPin.d.ts.map +0 -1
  82. package/types/EntityRect.d.ts.map +0 -1
  83. package/types/EntityVertex.d.ts.map +0 -1
  84. package/types/FAChar.d.ts.map +0 -1
  85. package/types/HTMLWidget.d.ts.map +0 -1
  86. package/types/IList.d.ts.map +0 -1
  87. package/types/IMenu.d.ts.map +0 -1
  88. package/types/Icon.d.ts.map +0 -1
  89. package/types/Image.d.ts.map +0 -1
  90. package/types/List.d.ts.map +0 -1
  91. package/types/Menu.d.ts.map +0 -1
  92. package/types/Palette.d.ts.map +0 -1
  93. package/types/Platform.d.ts.map +0 -1
  94. package/types/ProgressBar.d.ts.map +0 -1
  95. package/types/PropertyExt.d.ts.map +0 -1
  96. package/types/ResizeSurface.d.ts.map +0 -1
  97. package/types/SVGWidget.d.ts.map +0 -1
  98. package/types/SVGZoomWidget.d.ts.map +0 -1
  99. package/types/Shape.d.ts.map +0 -1
  100. package/types/Surface.d.ts.map +0 -1
  101. package/types/Text.d.ts.map +0 -1
  102. package/types/TextBox.d.ts.map +0 -1
  103. package/types/TitleBar.d.ts.map +0 -1
  104. package/types/Transition.d.ts.map +0 -1
  105. package/types/Utility.d.ts.map +0 -1
  106. package/types/Widget.d.ts.map +0 -1
  107. package/types/WidgetArray.d.ts.map +0 -1
  108. package/types/__package__.d.ts.map +0 -1
  109. package/types/index.d.ts.map +0 -1
  110. package/types-3.4/CanvasWidget.d.ts +0 -9
  111. package/types-3.4/Class.d.ts +0 -13
  112. package/types-3.4/Database.d.ts +0 -137
  113. package/types-3.4/Entity.d.ts +0 -89
  114. package/types-3.4/EntityCard.d.ts +0 -14
  115. package/types-3.4/EntityPin.d.ts +0 -23
  116. package/types-3.4/EntityRect.d.ts +0 -46
  117. package/types-3.4/EntityVertex.d.ts +0 -31
  118. package/types-3.4/FAChar.d.ts +0 -30
  119. package/types-3.4/HTMLWidget.d.ts +0 -28
  120. package/types-3.4/IList.d.ts +0 -5
  121. package/types-3.4/IMenu.d.ts +0 -6
  122. package/types-3.4/Icon.d.ts +0 -63
  123. package/types-3.4/Image.d.ts +0 -34
  124. package/types-3.4/List.d.ts +0 -16
  125. package/types-3.4/Menu.d.ts +0 -29
  126. package/types-3.4/Palette.d.ts +0 -20
  127. package/types-3.4/Platform.d.ts +0 -6
  128. package/types-3.4/ProgressBar.d.ts +0 -22
  129. package/types-3.4/PropertyExt.d.ts +0 -115
  130. package/types-3.4/ResizeSurface.d.ts +0 -24
  131. package/types-3.4/SVGWidget.d.ts +0 -78
  132. package/types-3.4/SVGZoomWidget.d.ts +0 -74
  133. package/types-3.4/Shape.d.ts +0 -35
  134. package/types-3.4/Surface.d.ts +0 -70
  135. package/types-3.4/Text.d.ts +0 -38
  136. package/types-3.4/TextBox.d.ts +0 -77
  137. package/types-3.4/TitleBar.d.ts +0 -118
  138. package/types-3.4/Transition.d.ts +0 -12
  139. package/types-3.4/Utility.d.ts +0 -103
  140. package/types-3.4/Widget.d.ts +0 -154
  141. package/types-3.4/WidgetArray.d.ts +0 -7
  142. package/types-3.4/__package__.d.ts +0 -4
  143. package/types-3.4/index.d.ts +0 -53
package/package.json CHANGED
@@ -1,46 +1,42 @@
1
1
  {
2
2
  "name": "@hpcc-js/common",
3
- "version": "2.73.0",
3
+ "version": "3.2.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
- ]
15
- }
5
+ "type": "module",
6
+ "exports": {
7
+ ".": {
8
+ "types": "./types/index.d.ts",
9
+ "default": "./dist/index.js"
10
+ },
11
+ "./dist/*": "./dist/*",
12
+ "./font-awesome/*": "./font-awesome/*"
16
13
  },
14
+ "module": "./dist/index.js",
15
+ "browser": "./dist/index.js",
16
+ "types": "./types/index.d.ts",
17
17
  "files": [
18
18
  "dist/*",
19
- "types/*",
20
- "types-3.4/*",
21
19
  "src/*",
20
+ "types/*",
22
21
  "font-awesome/**/*"
23
22
  ],
24
23
  "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",
37
- "stamp": "node ../../node_modules/@hpcc-js/bundle/src/stamp.js",
24
+ "clean": "rimraf --glob lib* types dist *.tsbuildinfo .turbo",
25
+ "bundle": "node esbuild.js",
26
+ "bundle-watch": "npm run bundle -- --development --watch",
27
+ "gen-types": "tsc --project tsconfig.json",
28
+ "gen-types-watch": "npm run gen-types -- --watch",
29
+ "build": "run-p gen-types bundle",
38
30
  "lint": "eslint ./src",
31
+ "lint-fix": "eslint --fix src/**/*.ts",
39
32
  "docs": "typedoc --options tdoptions.json .",
40
- "update": "npx --yes npm-check-updates -u -t minor"
33
+ "test-browser": "vitest run --project browser",
34
+ "test": "vitest run",
35
+ "coverage": "vitest run --coverage",
36
+ "update": "npx -y npm-check-updates -u -t minor"
41
37
  },
42
38
  "dependencies": {
43
- "@hpcc-js/util": "^2.53.0",
39
+ "@hpcc-js/util": "^3.2.0",
44
40
  "@types/d3-array": "1.2.12",
45
41
  "@types/d3-brush": "1.1.8",
46
42
  "@types/d3-collection": "1.0.13",
@@ -52,14 +48,14 @@
52
48
  "@types/d3-format": "1.4.5",
53
49
  "@types/d3-interpolate": "1.4.5",
54
50
  "@types/d3-scale": "1.0.22",
55
- "@types/d3-selection": "1.4.6",
51
+ "@types/d3-selection": "1.4.7",
56
52
  "@types/d3-time-format": "2.3.4",
57
- "@types/d3-transition": "1.3.5",
53
+ "@types/d3-transition": "1.3.6",
58
54
  "@types/d3-zoom": "1.8.7"
59
55
  },
60
56
  "devDependencies": {
61
- "@hpcc-js/bundle": "^2.12.0",
62
- "colorbrewer": "1.5.6",
57
+ "@hpcc-js/esbuild-plugins": "^1.3.0",
58
+ "colorbrewer": "1.5.7",
63
59
  "d3-array": "^1",
64
60
  "d3-brush": "^1",
65
61
  "d3-collection": "^1",
@@ -76,8 +72,7 @@
76
72
  "d3-time-format": "^2",
77
73
  "d3-transition": "^1",
78
74
  "d3-zoom": "^1",
79
- "font-awesome": "4.7.0",
80
- "tslib": "2.7.0"
75
+ "font-awesome": "4.7.0"
81
76
  },
82
77
  "repository": {
83
78
  "type": "git",
@@ -90,5 +85,5 @@
90
85
  "url": "https://github.com/hpcc-systems/Visualization/issues"
91
86
  },
92
87
  "homepage": "https://github.com/hpcc-systems/Visualization",
93
- "gitHead": "fbbef050700b0e9d76ef99714856383d95155149"
88
+ "gitHead": "658c50fd965a7744ba8db675ba6878607c44d5e2"
94
89
  }
@@ -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
 
@@ -91,9 +91,12 @@ export class List extends SVGWidget implements IList {
91
91
  dblclick(d) {
92
92
  // console.log("Double click: " + d);
93
93
  }
94
-
95
- anchor: { (): string; (_: string): List; };
96
94
  }
97
95
  List.prototype._class += " common_List";
98
96
 
97
+ export interface List {
98
+ anchor(): "" | "start" | "middle" | "end";
99
+ anchor(_: "" | "start" | "middle" | "end"): this;
100
+ }
101
+
99
102
  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);
package/src/Palette.ts CHANGED
@@ -124,12 +124,12 @@ function palette_ordinal(id?, colors?): any {
124
124
  ordinal.type = function () {
125
125
  return "ordinal";
126
126
  };
127
- ordinal.id = function (_) {
127
+ ordinal.id = function (_?) {
128
128
  if (!arguments.length) return id;
129
129
  id = _;
130
130
  return ordinal;
131
131
  };
132
- ordinal.colors = function (_) {
132
+ ordinal.colors = function (_?) {
133
133
  if (!arguments.length) return colors;
134
134
  colors = _;
135
135
  return ordinal;
@@ -145,7 +145,7 @@ function palette_ordinal(id?, colors?): any {
145
145
  }
146
146
  return this.clone(newID);
147
147
  };
148
- ordinal.switch = function (_id, _colors) {
148
+ ordinal.switch = function (_id?, _colors?) {
149
149
  if (id === _id) {
150
150
  return this;
151
151
  }
@@ -239,12 +239,12 @@ function palette_rainbow(id?, _colors?, _steps?) {
239
239
  rainbow.type = function () {
240
240
  return "rainbow";
241
241
  };
242
- rainbow.id = function (_) {
242
+ rainbow.id = function (_?) {
243
243
  if (!arguments.length) return id;
244
244
  id = _;
245
245
  return rainbow;
246
246
  };
247
- rainbow.colors = function (_) {
247
+ rainbow.colors = function (_?) {
248
248
  if (!arguments.length) return colors;
249
249
  colors = _;
250
250
  return rainbow;
@@ -259,7 +259,7 @@ function palette_rainbow(id?, _colors?, _steps?) {
259
259
  }
260
260
  return this.clone(newID);
261
261
  };
262
- rainbow.switch = function (_id, _colors) {
262
+ rainbow.switch = function (_id?, _colors?) {
263
263
  if (id === _id) {
264
264
  return this;
265
265
  }
@@ -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");