@hpcc-js/other 2.17.1 → 2.17.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 (46) hide show
  1. package/LICENSE +43 -43
  2. package/README.md +41 -41
  3. package/dist/index.es6.js +5 -5
  4. package/dist/index.es6.js.map +1 -1
  5. package/dist/index.js +5 -5
  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 +5 -5
  10. package/src/Audio.ts +83 -83
  11. package/src/AutoCompleteText.css +21 -21
  12. package/src/AutoCompleteText.ts +124 -124
  13. package/src/CalendarHeatMap.css +26 -26
  14. package/src/CalendarHeatMap.ts +243 -243
  15. package/src/Comms.ts +1085 -1085
  16. package/src/ESP.ts +451 -451
  17. package/src/HPCCBadge.ts +220 -220
  18. package/src/HeatMap.ts +135 -135
  19. package/src/Html.css +5 -5
  20. package/src/Html.ts +44 -44
  21. package/src/IconList.css +3 -3
  22. package/src/IconList.ts +86 -86
  23. package/src/Legend.css +85 -85
  24. package/src/Legend.ts +220 -220
  25. package/src/MorphText.css +11 -11
  26. package/src/MorphText.ts +102 -102
  27. package/src/NestedTable.ts +51 -51
  28. package/src/Opportunity.css +80 -80
  29. package/src/Opportunity.ts +488 -488
  30. package/src/Paginator.css +120 -120
  31. package/src/Paginator.ts +164 -164
  32. package/src/Persist.ts +151 -151
  33. package/src/PropertyEditor.css +130 -130
  34. package/src/PropertyEditor.ts +750 -750
  35. package/src/RadioCheckbox.css +6 -6
  36. package/src/RadioCheckbox.ts +123 -123
  37. package/src/Select.css +7 -7
  38. package/src/Select.ts +120 -120
  39. package/src/Table.css +92 -92
  40. package/src/Table.ts +1050 -1050
  41. package/src/ThemeEditor.css +195 -195
  42. package/src/ThemeEditor.ts +744 -744
  43. package/src/__package__.ts +3 -3
  44. package/src/index.ts +23 -23
  45. package/types/__package__.d.ts +2 -2
  46. package/types-3.4/__package__.d.ts +2 -2
package/src/HeatMap.ts CHANGED
@@ -1,135 +1,135 @@
1
- import { CanvasWidget, Palette } from "@hpcc-js/common";
2
- import * as _simpleheat from "simpleheat";
3
-
4
- const simpleheat = (window as any).simpleheat || (_simpleheat && _simpleheat.default) || _simpleheat;
5
-
6
- export class HeatMap extends CanvasWidget {
7
- _heat;
8
- _palette;
9
-
10
- constructor() {
11
- super();
12
- }
13
-
14
- enter(domNode, element) {
15
- super.enter(domNode, element);
16
- // canvas size needs to be set before render
17
- this.resize(this._size);
18
- this._heat = simpleheat(domNode);
19
- }
20
-
21
- update(domNode, element) {
22
- super.update(domNode, element);
23
-
24
- this._palette = this._palette.switch(this.paletteID());
25
- if (this.useClonedPalette()) {
26
- this._palette = this._palette.cloneNotExists(this.paletteID() + "_" + this.id());
27
- }
28
-
29
- if (this.topLeftX_exists() && this.topLeftY_exists() && this.bottomRightX_exists() && this.bottomRightY_exists()) {
30
- this._heat.data(this.skewedData());
31
- } else {
32
- this._heat.data(this.data());
33
- }
34
-
35
- if (this.radius()) {
36
- this._heat.radius(this.radius(), this.blur());
37
- }
38
- if (this.usePalette()) {
39
- const grad = {};
40
- for (let idx = 1; idx <= this.colorCount(); idx++) {
41
- const value = idx / this.colorCount();
42
- grad[value] = this._palette(idx, 1, this.colorCount());
43
- }
44
- this._heat.defaultGradient = grad;
45
- this._heat.gradient(grad);
46
- } else if (this.gradient()) {
47
- this._heat.defaultGradient = this.gradient();
48
- this._heat.gradient(this.gradient());
49
- }
50
-
51
- this._heat.draw();
52
- }
53
-
54
- exit(domNode, element) {
55
- delete this._heat;
56
- super.exit(domNode, element);
57
- }
58
-
59
- resize(size: any): this {
60
- const retVal = CanvasWidget.prototype.resize.apply(this, arguments);
61
- if (this._heat !== undefined) {
62
- this._heat.resize();
63
- }
64
- return retVal;
65
- }
66
-
67
- skewedData() {
68
- const context = this;
69
- const retArr = [];
70
- const arr = this.data();
71
- const box = this.size();
72
-
73
- const coordsWidth = this.bottomRightX() - this.topLeftX();
74
- const coordsHeight = this.bottomRightY() - this.topLeftY();
75
-
76
- const pixelValueX = coordsWidth / box.width;
77
- const pixelValueY = coordsHeight / box.height;
78
-
79
- arr.forEach(function (n) {
80
- const left = Math.abs(n[0] - context.topLeftX());
81
- const top = Math.abs(n[1] - context.topLeftY());
82
-
83
- const newX = left / pixelValueX;
84
- const newY = top / pixelValueY;
85
-
86
- retArr.push([newX, newY, n[2]]);
87
- });
88
-
89
- return retArr;
90
- }
91
-
92
- radius: { (): number; (_: number): HeatMap };
93
- radius_exists: () => boolean;
94
- blur: { (): number; (_: number): HeatMap };
95
- blur_exists: () => boolean;
96
- max: { (): number; (_: number): HeatMap };
97
- max_exists: () => boolean;
98
- gradient: { (): object; (_: object): HeatMap };
99
- gradient_exists: () => boolean;
100
- usePalette: { (): boolean; (_: boolean): HeatMap };
101
- usePalette_exists: () => boolean;
102
- colorCount: { (): number; (_: number): HeatMap };
103
- colorCount_exists: () => boolean;
104
- paletteID: { (): string; (_: string): HeatMap };
105
- paletteID_exists: () => boolean;
106
- useClonedPalette: { (): boolean; (_: boolean): HeatMap };
107
- useClonedPalette_exists: () => boolean;
108
- topLeftX: { (): number; (_: number): HeatMap };
109
- topLeftX_exists: () => boolean;
110
- topLeftY: { (): number; (_: number): HeatMap };
111
- topLeftY_exists: () => boolean;
112
- bottomRightX: { (): number; (_: number): HeatMap };
113
- bottomRightX_exists: () => boolean;
114
- bottomRightY: { (): number; (_: number): HeatMap };
115
- bottomRightY_exists: () => boolean;
116
- }
117
- HeatMap.prototype._class += " other_HeatMap";
118
- HeatMap.prototype._palette = Palette.rainbow("default");
119
-
120
- HeatMap.prototype.publish("radius", 15, "number", "Set point radius", null, { tags: ["Basic"] });
121
- HeatMap.prototype.publish("blur", 15, "number", "Set point blur", null, { tags: ["Basic"] });
122
- HeatMap.prototype.publish("max", 1, "number", "Set max data value", null, { tags: ["Basic"] });
123
-
124
- HeatMap.prototype.publish("gradient", { 0.4: "blue", 0.6: "cyan", 0.7: "lime", 0.8: "yellow", 1.0: "red" }, "object", "Set gradient colors", null, { tags: ["Basic"] });
125
-
126
- HeatMap.prototype.publish("usePalette", false, "boolean", "If true, uses paletteID and colorCount to determine gradient", null, { tags: ["Basic"] });
127
-
128
- HeatMap.prototype.publish("colorCount", 10, "number", "Top left x-value", null, { tags: ["Basic"] });
129
- HeatMap.prototype.publish("paletteID", "default", "set", "Color palette for this widget", HeatMap.prototype._palette.switch(), { tags: ["Basic"] });
130
- HeatMap.prototype.publish("useClonedPalette", false, "boolean", "Enable or disable using a cloned palette", null, { tags: ["Intermediate", "Shared"] });
131
-
132
- HeatMap.prototype.publish("topLeftX", null, "number", "Top left x-value", null, { tags: ["Basic"], optional: true });
133
- HeatMap.prototype.publish("topLeftY", null, "number", "Top left y-value", null, { tags: ["Basic"], optional: true });
134
- HeatMap.prototype.publish("bottomRightX", null, "number", "Bottom right x-value", null, { tags: ["Basic"], optional: true });
135
- HeatMap.prototype.publish("bottomRightY", null, "number", "Bottom right y-value", null, { tags: ["Basic"], optional: true });
1
+ import { CanvasWidget, Palette } from "@hpcc-js/common";
2
+ import * as _simpleheat from "simpleheat";
3
+
4
+ const simpleheat = (window as any).simpleheat || (_simpleheat && _simpleheat.default) || _simpleheat;
5
+
6
+ export class HeatMap extends CanvasWidget {
7
+ _heat;
8
+ _palette;
9
+
10
+ constructor() {
11
+ super();
12
+ }
13
+
14
+ enter(domNode, element) {
15
+ super.enter(domNode, element);
16
+ // canvas size needs to be set before render
17
+ this.resize(this._size);
18
+ this._heat = simpleheat(domNode);
19
+ }
20
+
21
+ update(domNode, element) {
22
+ super.update(domNode, element);
23
+
24
+ this._palette = this._palette.switch(this.paletteID());
25
+ if (this.useClonedPalette()) {
26
+ this._palette = this._palette.cloneNotExists(this.paletteID() + "_" + this.id());
27
+ }
28
+
29
+ if (this.topLeftX_exists() && this.topLeftY_exists() && this.bottomRightX_exists() && this.bottomRightY_exists()) {
30
+ this._heat.data(this.skewedData());
31
+ } else {
32
+ this._heat.data(this.data());
33
+ }
34
+
35
+ if (this.radius()) {
36
+ this._heat.radius(this.radius(), this.blur());
37
+ }
38
+ if (this.usePalette()) {
39
+ const grad = {};
40
+ for (let idx = 1; idx <= this.colorCount(); idx++) {
41
+ const value = idx / this.colorCount();
42
+ grad[value] = this._palette(idx, 1, this.colorCount());
43
+ }
44
+ this._heat.defaultGradient = grad;
45
+ this._heat.gradient(grad);
46
+ } else if (this.gradient()) {
47
+ this._heat.defaultGradient = this.gradient();
48
+ this._heat.gradient(this.gradient());
49
+ }
50
+
51
+ this._heat.draw();
52
+ }
53
+
54
+ exit(domNode, element) {
55
+ delete this._heat;
56
+ super.exit(domNode, element);
57
+ }
58
+
59
+ resize(size: any): this {
60
+ const retVal = CanvasWidget.prototype.resize.apply(this, arguments);
61
+ if (this._heat !== undefined) {
62
+ this._heat.resize();
63
+ }
64
+ return retVal;
65
+ }
66
+
67
+ skewedData() {
68
+ const context = this;
69
+ const retArr = [];
70
+ const arr = this.data();
71
+ const box = this.size();
72
+
73
+ const coordsWidth = this.bottomRightX() - this.topLeftX();
74
+ const coordsHeight = this.bottomRightY() - this.topLeftY();
75
+
76
+ const pixelValueX = coordsWidth / box.width;
77
+ const pixelValueY = coordsHeight / box.height;
78
+
79
+ arr.forEach(function (n) {
80
+ const left = Math.abs(n[0] - context.topLeftX());
81
+ const top = Math.abs(n[1] - context.topLeftY());
82
+
83
+ const newX = left / pixelValueX;
84
+ const newY = top / pixelValueY;
85
+
86
+ retArr.push([newX, newY, n[2]]);
87
+ });
88
+
89
+ return retArr;
90
+ }
91
+
92
+ radius: { (): number; (_: number): HeatMap };
93
+ radius_exists: () => boolean;
94
+ blur: { (): number; (_: number): HeatMap };
95
+ blur_exists: () => boolean;
96
+ max: { (): number; (_: number): HeatMap };
97
+ max_exists: () => boolean;
98
+ gradient: { (): object; (_: object): HeatMap };
99
+ gradient_exists: () => boolean;
100
+ usePalette: { (): boolean; (_: boolean): HeatMap };
101
+ usePalette_exists: () => boolean;
102
+ colorCount: { (): number; (_: number): HeatMap };
103
+ colorCount_exists: () => boolean;
104
+ paletteID: { (): string; (_: string): HeatMap };
105
+ paletteID_exists: () => boolean;
106
+ useClonedPalette: { (): boolean; (_: boolean): HeatMap };
107
+ useClonedPalette_exists: () => boolean;
108
+ topLeftX: { (): number; (_: number): HeatMap };
109
+ topLeftX_exists: () => boolean;
110
+ topLeftY: { (): number; (_: number): HeatMap };
111
+ topLeftY_exists: () => boolean;
112
+ bottomRightX: { (): number; (_: number): HeatMap };
113
+ bottomRightX_exists: () => boolean;
114
+ bottomRightY: { (): number; (_: number): HeatMap };
115
+ bottomRightY_exists: () => boolean;
116
+ }
117
+ HeatMap.prototype._class += " other_HeatMap";
118
+ HeatMap.prototype._palette = Palette.rainbow("default");
119
+
120
+ HeatMap.prototype.publish("radius", 15, "number", "Set point radius", null, { tags: ["Basic"] });
121
+ HeatMap.prototype.publish("blur", 15, "number", "Set point blur", null, { tags: ["Basic"] });
122
+ HeatMap.prototype.publish("max", 1, "number", "Set max data value", null, { tags: ["Basic"] });
123
+
124
+ HeatMap.prototype.publish("gradient", { 0.4: "blue", 0.6: "cyan", 0.7: "lime", 0.8: "yellow", 1.0: "red" }, "object", "Set gradient colors", null, { tags: ["Basic"] });
125
+
126
+ HeatMap.prototype.publish("usePalette", false, "boolean", "If true, uses paletteID and colorCount to determine gradient", null, { tags: ["Basic"] });
127
+
128
+ HeatMap.prototype.publish("colorCount", 10, "number", "Top left x-value", null, { tags: ["Basic"] });
129
+ HeatMap.prototype.publish("paletteID", "default", "set", "Color palette for this widget", HeatMap.prototype._palette.switch(), { tags: ["Basic"] });
130
+ HeatMap.prototype.publish("useClonedPalette", false, "boolean", "Enable or disable using a cloned palette", null, { tags: ["Intermediate", "Shared"] });
131
+
132
+ HeatMap.prototype.publish("topLeftX", null, "number", "Top left x-value", null, { tags: ["Basic"], optional: true });
133
+ HeatMap.prototype.publish("topLeftY", null, "number", "Top left y-value", null, { tags: ["Basic"], optional: true });
134
+ HeatMap.prototype.publish("bottomRightX", null, "number", "Bottom right x-value", null, { tags: ["Basic"], optional: true });
135
+ HeatMap.prototype.publish("bottomRightY", null, "number", "Bottom right y-value", null, { tags: ["Basic"], optional: true });
package/src/Html.css CHANGED
@@ -1,6 +1,6 @@
1
- .other_Html{
2
- height:100%;
3
- width:100%;
4
- overflow-x:auto;
5
- overflow-y:scroll;
1
+ .other_Html{
2
+ height:100%;
3
+ width:100%;
4
+ overflow-x:auto;
5
+ overflow-y:scroll;
6
6
  }
package/src/Html.ts CHANGED
@@ -1,44 +1,44 @@
1
- import { HTMLWidget } from "@hpcc-js/common";
2
-
3
- import "../src/Html.css";
4
-
5
- export class Html extends HTMLWidget {
6
- constructor() {
7
- super();
8
-
9
- this._tag = "div";
10
- }
11
-
12
- enter(domNode, element) {
13
- super.enter(domNode, element);
14
- }
15
-
16
- update(domNode, element) {
17
- super.update(domNode, element);
18
-
19
- element
20
- .style("overflow-x", this.overflowX_exists() ? this.overflowX() : "")
21
- .style("overflow-y", this.overflowY_exists() ? this.overflowY() : "")
22
- ;
23
-
24
- const html = element.selectAll(".htmlWrapper").data(this.data().length > 0 ? this.data() : [this.html()]);
25
- html.enter().append("div")
26
- .attr("class", "htmlWrapper")
27
- .merge(html)
28
- .html(function (d) { return d; })
29
- ;
30
- html.exit().remove();
31
- }
32
-
33
- html: { (): string; (_: string): Html };
34
- html_exists: () => boolean;
35
- overflowX: { (): string; (_: string): Html };
36
- overflowX_exists: () => boolean;
37
- overflowY: { (): string; (_: string): Html };
38
- overflowY_exists: () => boolean;
39
- }
40
- Html.prototype._class += " other_Html";
41
-
42
- Html.prototype.publish("html", "", "string", "Html to render", null, { tags: ["Basic"] });
43
- Html.prototype.publish("overflowX", null, "set", "CSS overflow-x", ["", "visible", "hidden", "scroll", "auto", "initial", "inherit"], { tags: ["Basic"], optional: true });
44
- Html.prototype.publish("overflowY", null, "set", "CSS overflow-y", ["", "visible", "hidden", "scroll", "auto", "initial", "inherit"], { tags: ["Basic"], optional: true });
1
+ import { HTMLWidget } from "@hpcc-js/common";
2
+
3
+ import "../src/Html.css";
4
+
5
+ export class Html extends HTMLWidget {
6
+ constructor() {
7
+ super();
8
+
9
+ this._tag = "div";
10
+ }
11
+
12
+ enter(domNode, element) {
13
+ super.enter(domNode, element);
14
+ }
15
+
16
+ update(domNode, element) {
17
+ super.update(domNode, element);
18
+
19
+ element
20
+ .style("overflow-x", this.overflowX_exists() ? this.overflowX() : "")
21
+ .style("overflow-y", this.overflowY_exists() ? this.overflowY() : "")
22
+ ;
23
+
24
+ const html = element.selectAll(".htmlWrapper").data(this.data().length > 0 ? this.data() : [this.html()]);
25
+ html.enter().append("div")
26
+ .attr("class", "htmlWrapper")
27
+ .merge(html)
28
+ .html(function (d) { return d; })
29
+ ;
30
+ html.exit().remove();
31
+ }
32
+
33
+ html: { (): string; (_: string): Html };
34
+ html_exists: () => boolean;
35
+ overflowX: { (): string; (_: string): Html };
36
+ overflowX_exists: () => boolean;
37
+ overflowY: { (): string; (_: string): Html };
38
+ overflowY_exists: () => boolean;
39
+ }
40
+ Html.prototype._class += " other_Html";
41
+
42
+ Html.prototype.publish("html", "", "string", "Html to render", null, { tags: ["Basic"] });
43
+ Html.prototype.publish("overflowX", null, "set", "CSS overflow-x", ["", "visible", "hidden", "scroll", "auto", "initial", "inherit"], { tags: ["Basic"], optional: true });
44
+ Html.prototype.publish("overflowY", null, "set", "CSS overflow-y", ["", "visible", "hidden", "scroll", "auto", "initial", "inherit"], { tags: ["Basic"], optional: true });
package/src/IconList.css CHANGED
@@ -1,4 +1,4 @@
1
- .other_IconList .other_Html{
2
- overflow-x: hidden;
3
- overflow-y: hidden;
1
+ .other_IconList .other_Html{
2
+ overflow-x: hidden;
3
+ overflow-y: hidden;
4
4
  }
package/src/IconList.ts CHANGED
@@ -1,86 +1,86 @@
1
- import { Entity, HTMLWidget } from "@hpcc-js/common";
2
- import { HorizontalList, VerticalList } from "@hpcc-js/layout";
3
- import { select as d3Select } from "d3-selection";
4
- import { Html } from "./Html";
5
-
6
- import "../src/IconList.css";
7
-
8
- export class IconList extends HTMLWidget {
9
- protected _list;
10
- protected _entity_list = [];
11
- protected _content_list = [];
12
- constructor() {
13
- super();
14
- this._list = new HorizontalList()
15
- .orientation_default("horizontal")
16
- .flexWrap_default("nowrap")
17
- ;
18
- }
19
- enter(domNode, element) {
20
- super.enter(domNode, element);
21
- element
22
- .style("height", "100%")
23
- .style("width", "100%")
24
- ;
25
- d3Select(domNode.parentElement)
26
- .style("height", "100%")
27
- .style("width", "100%")
28
- ;
29
- this._list.target(domNode);
30
- }
31
- update(domNode, element) {
32
- super.update(domNode, element);
33
- const listWidgets = this._list.widgets();
34
- this.data().forEach((row, idx) => {
35
- if (!listWidgets[idx]) {
36
- listWidgets[idx] = this.updateListProperties(new VerticalList(), idx)
37
- .widgets([
38
- this.updateEntityProperties(new Entity(), idx),
39
- new Html().html(this.data()[idx][this.htmlColumnIndex_exists() ? this.htmlColumnIndex() : 1])
40
- ]);
41
- } else {
42
- listWidgets[idx] = this.updateListProperties(listWidgets[idx], idx);
43
- this.updateEntityProperties(listWidgets[idx].widgets()[0], idx);
44
- listWidgets[idx]
45
- .widgets()[1]
46
- .html(this.data()[idx][this.htmlColumnIndex_exists() ? this.htmlColumnIndex() : 1])
47
- ;
48
- }
49
- });
50
- this._list.widgets(listWidgets.slice(0, this.data().length));
51
- this._list.resize().render();
52
- }
53
- updateListProperties(list, idx) {
54
- return list
55
- .disableScroll(true)
56
- .widgetsFlexBasis([this.iconSize() + "px", `calc(100% - ${this.iconSize()}px)`])
57
- ;
58
- }
59
- updateEntityProperties(entity, idx) {
60
- return entity
61
- .icon(this.iconColumnIndex_exists() ? this.data()[idx][this.iconColumnIndex()] : "?")
62
- .iconColor(this.iconColorColumnIndex_exists() ? this.data()[idx][this.iconColorColumnIndex()] : "#000")
63
- .iconDiameter(this.iconSize())
64
- .iconPaddingPercent(0)
65
- ;
66
- }
67
- }
68
- IconList.prototype._class += " other_IconList";
69
-
70
- export interface IconList {
71
- iconSize(): number;
72
- iconSize(_: number): this;
73
- iconColumnIndex(): number;
74
- iconColumnIndex(_: number): this;
75
- iconColumnIndex_exists(): boolean;
76
- iconColorColumnIndex(): number;
77
- iconColorColumnIndex(_: number): this;
78
- iconColorColumnIndex_exists(): boolean;
79
- htmlColumnIndex(): number;
80
- htmlColumnIndex(_: number): this;
81
- htmlColumnIndex_exists(): boolean;
82
- }
83
- IconList.prototype.publish("iconSize", 72, "number", "Size of icon (pixels)");
84
- IconList.prototype.publish("iconColumnIndex", 0, "number", "Index of column containing icon character");
85
- IconList.prototype.publish("iconColorColumnIndex", 1, "number", "Index of column containing icon color");
86
- IconList.prototype.publish("htmlColumnIndex", 2, "number", "Index of column containing html string");
1
+ import { Entity, HTMLWidget } from "@hpcc-js/common";
2
+ import { HorizontalList, VerticalList } from "@hpcc-js/layout";
3
+ import { select as d3Select } from "d3-selection";
4
+ import { Html } from "./Html";
5
+
6
+ import "../src/IconList.css";
7
+
8
+ export class IconList extends HTMLWidget {
9
+ protected _list;
10
+ protected _entity_list = [];
11
+ protected _content_list = [];
12
+ constructor() {
13
+ super();
14
+ this._list = new HorizontalList()
15
+ .orientation_default("horizontal")
16
+ .flexWrap_default("nowrap")
17
+ ;
18
+ }
19
+ enter(domNode, element) {
20
+ super.enter(domNode, element);
21
+ element
22
+ .style("height", "100%")
23
+ .style("width", "100%")
24
+ ;
25
+ d3Select(domNode.parentElement)
26
+ .style("height", "100%")
27
+ .style("width", "100%")
28
+ ;
29
+ this._list.target(domNode);
30
+ }
31
+ update(domNode, element) {
32
+ super.update(domNode, element);
33
+ const listWidgets = this._list.widgets();
34
+ this.data().forEach((row, idx) => {
35
+ if (!listWidgets[idx]) {
36
+ listWidgets[idx] = this.updateListProperties(new VerticalList(), idx)
37
+ .widgets([
38
+ this.updateEntityProperties(new Entity(), idx),
39
+ new Html().html(this.data()[idx][this.htmlColumnIndex_exists() ? this.htmlColumnIndex() : 1])
40
+ ]);
41
+ } else {
42
+ listWidgets[idx] = this.updateListProperties(listWidgets[idx], idx);
43
+ this.updateEntityProperties(listWidgets[idx].widgets()[0], idx);
44
+ listWidgets[idx]
45
+ .widgets()[1]
46
+ .html(this.data()[idx][this.htmlColumnIndex_exists() ? this.htmlColumnIndex() : 1])
47
+ ;
48
+ }
49
+ });
50
+ this._list.widgets(listWidgets.slice(0, this.data().length));
51
+ this._list.resize().render();
52
+ }
53
+ updateListProperties(list, idx) {
54
+ return list
55
+ .disableScroll(true)
56
+ .widgetsFlexBasis([this.iconSize() + "px", `calc(100% - ${this.iconSize()}px)`])
57
+ ;
58
+ }
59
+ updateEntityProperties(entity, idx) {
60
+ return entity
61
+ .icon(this.iconColumnIndex_exists() ? this.data()[idx][this.iconColumnIndex()] : "?")
62
+ .iconColor(this.iconColorColumnIndex_exists() ? this.data()[idx][this.iconColorColumnIndex()] : "#000")
63
+ .iconDiameter(this.iconSize())
64
+ .iconPaddingPercent(0)
65
+ ;
66
+ }
67
+ }
68
+ IconList.prototype._class += " other_IconList";
69
+
70
+ export interface IconList {
71
+ iconSize(): number;
72
+ iconSize(_: number): this;
73
+ iconColumnIndex(): number;
74
+ iconColumnIndex(_: number): this;
75
+ iconColumnIndex_exists(): boolean;
76
+ iconColorColumnIndex(): number;
77
+ iconColorColumnIndex(_: number): this;
78
+ iconColorColumnIndex_exists(): boolean;
79
+ htmlColumnIndex(): number;
80
+ htmlColumnIndex(_: number): this;
81
+ htmlColumnIndex_exists(): boolean;
82
+ }
83
+ IconList.prototype.publish("iconSize", 72, "number", "Size of icon (pixels)");
84
+ IconList.prototype.publish("iconColumnIndex", 0, "number", "Index of column containing icon character");
85
+ IconList.prototype.publish("iconColorColumnIndex", 1, "number", "Index of column containing icon color");
86
+ IconList.prototype.publish("htmlColumnIndex", 2, "number", "Index of column containing html string");