@hpcc-js/other 2.17.3 → 2.17.5

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 +2 -2
  4. package/dist/index.es6.js.map +1 -1
  5. package/dist/index.js +2 -2
  6. package/dist/index.js.map +1 -1
  7. package/dist/index.min.js +1 -1
  8. package/dist/index.min.js.map +1 -1
  9. package/package.json +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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hpcc-js/other",
3
- "version": "2.17.3",
3
+ "version": "2.17.5",
4
4
  "description": "hpcc-js - Viz Other",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.es6",
@@ -38,9 +38,9 @@
38
38
  "update": "npx --yes npm-check-updates -u -t minor"
39
39
  },
40
40
  "dependencies": {
41
- "@hpcc-js/api": "^2.14.3",
42
- "@hpcc-js/common": "^2.73.3",
43
- "@hpcc-js/layout": "^2.51.3"
41
+ "@hpcc-js/api": "^2.14.4",
42
+ "@hpcc-js/common": "^2.73.4",
43
+ "@hpcc-js/layout": "^2.51.5"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@hpcc-js/bundle": "^2.12.0",
@@ -69,5 +69,5 @@
69
69
  "url": "https://github.com/hpcc-systems/Visualization/issues"
70
70
  },
71
71
  "homepage": "https://github.com/hpcc-systems/Visualization",
72
- "gitHead": "0907b8d15d369c89483954a1d96e2247ba020cb6"
72
+ "gitHead": "67d7f21dc1fd77ed2b730c01ebaecb77b124f1a1"
73
73
  }
package/src/Audio.ts CHANGED
@@ -1,83 +1,83 @@
1
- import { HTMLWidget } from "@hpcc-js/common";
2
- import { timer as d3Timer } from "d3-timer";
3
-
4
- export class Audio extends HTMLWidget {
5
- _sections;
6
-
7
- constructor() {
8
- super();
9
- this._tag = "audio";
10
-
11
- this._sections = {};
12
- }
13
-
14
- section(label, offset, beatLength, beatCount) {
15
- if (!arguments.length) return this._sections;
16
- if (arguments.length === 1) return this._sections[label];
17
- this._sections[label] = {
18
- label,
19
- offset,
20
- beatLength,
21
- beatCount,
22
- endOffset: offset + beatCount * beatLength
23
- };
24
- return this;
25
- }
26
-
27
- getType(fileExt) {
28
- switch (fileExt) {
29
- case "mp3":
30
- return "audio/mpeg; codecs='mp3'";
31
- case "ogg":
32
- return "audio/ogg; codecs='vorbis'";
33
- }
34
- return "";
35
- }
36
-
37
- enter(domNode, element) {
38
- const context = this;
39
- element.on("play", function (d) { context.onPlay(d); });
40
- }
41
-
42
- update(domNode, element) {
43
- const source = element.selectAll("source").data(this.source(), function (d) { return d; });
44
- source.enter().append("source")
45
- .attr("src", function (d) { return d; })
46
- ;
47
- }
48
-
49
- createTimer(params, startTime, beat) {
50
- const context = this;
51
- d3Timer(function () {
52
- context.onTick(params.label, beat, params);
53
- return true;
54
- }, beat * params.beatLength, startTime + params.offset);
55
- }
56
-
57
- onTick(label, beat, params) {
58
- }
59
-
60
- onPlay(d) {
61
- const startTime = Date.now();
62
- for (const key in this._sections) {
63
- const section = this._sections[key];
64
- for (let i = 0; i < section.beatCount; ++i) {
65
- this.createTimer(section, startTime, i);
66
- }
67
- }
68
- }
69
-
70
- play(d) {
71
- const context = this;
72
- this._element.on("canplaythrough", function (d2) {
73
- context.node().play();
74
- });
75
- this.node().load();
76
- }
77
-
78
- source: { (): string; (_: string): Audio };
79
- source_exists: () => boolean;
80
- }
81
- Audio.prototype._class += " other_Audio";
82
-
83
- Audio.prototype.publish("source", "", "string", "Audio Source");
1
+ import { HTMLWidget } from "@hpcc-js/common";
2
+ import { timer as d3Timer } from "d3-timer";
3
+
4
+ export class Audio extends HTMLWidget {
5
+ _sections;
6
+
7
+ constructor() {
8
+ super();
9
+ this._tag = "audio";
10
+
11
+ this._sections = {};
12
+ }
13
+
14
+ section(label, offset, beatLength, beatCount) {
15
+ if (!arguments.length) return this._sections;
16
+ if (arguments.length === 1) return this._sections[label];
17
+ this._sections[label] = {
18
+ label,
19
+ offset,
20
+ beatLength,
21
+ beatCount,
22
+ endOffset: offset + beatCount * beatLength
23
+ };
24
+ return this;
25
+ }
26
+
27
+ getType(fileExt) {
28
+ switch (fileExt) {
29
+ case "mp3":
30
+ return "audio/mpeg; codecs='mp3'";
31
+ case "ogg":
32
+ return "audio/ogg; codecs='vorbis'";
33
+ }
34
+ return "";
35
+ }
36
+
37
+ enter(domNode, element) {
38
+ const context = this;
39
+ element.on("play", function (d) { context.onPlay(d); });
40
+ }
41
+
42
+ update(domNode, element) {
43
+ const source = element.selectAll("source").data(this.source(), function (d) { return d; });
44
+ source.enter().append("source")
45
+ .attr("src", function (d) { return d; })
46
+ ;
47
+ }
48
+
49
+ createTimer(params, startTime, beat) {
50
+ const context = this;
51
+ d3Timer(function () {
52
+ context.onTick(params.label, beat, params);
53
+ return true;
54
+ }, beat * params.beatLength, startTime + params.offset);
55
+ }
56
+
57
+ onTick(label, beat, params) {
58
+ }
59
+
60
+ onPlay(d) {
61
+ const startTime = Date.now();
62
+ for (const key in this._sections) {
63
+ const section = this._sections[key];
64
+ for (let i = 0; i < section.beatCount; ++i) {
65
+ this.createTimer(section, startTime, i);
66
+ }
67
+ }
68
+ }
69
+
70
+ play(d) {
71
+ const context = this;
72
+ this._element.on("canplaythrough", function (d2) {
73
+ context.node().play();
74
+ });
75
+ this.node().load();
76
+ }
77
+
78
+ source: { (): string; (_: string): Audio };
79
+ source_exists: () => boolean;
80
+ }
81
+ Audio.prototype._class += " other_Audio";
82
+
83
+ Audio.prototype.publish("source", "", "string", "Audio Source");
@@ -1,21 +1,21 @@
1
- .other_autoCompleteText label {
2
- display: inline-block;
3
- vertical-align: top;
4
- }
5
-
6
- .other_autoCompleteText input {
7
- width: 100%;
8
- max-width: 600px;
9
- outline: 0;
10
- border-radius: 100;
11
- }
12
-
13
- .autocomplete-suggestions {
14
- text-align: left; cursor: default; border: 1px solid #ccc; border-top: 0; background: #fff; box-shadow: -1px 1px 3px rgba(0,0,0,.1);
15
- /* core styles should not be changed */
16
- position: absolute; display: none; z-index: 9999; max-height: 254px; overflow: hidden; overflow-y: auto; box-sizing: border-box;
17
- }
18
- .autocomplete-suggestion { position: relative; padding: 0 .6em; line-height: 23px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 1.02em; color: #333; }
19
- .autocomplete-suggestion b { font-weight: normal; color: #1f8dd6; }
20
- .autocomplete-suggestion.selected { background: #f0f0f0; }
21
-
1
+ .other_autoCompleteText label {
2
+ display: inline-block;
3
+ vertical-align: top;
4
+ }
5
+
6
+ .other_autoCompleteText input {
7
+ width: 100%;
8
+ max-width: 600px;
9
+ outline: 0;
10
+ border-radius: 100;
11
+ }
12
+
13
+ .autocomplete-suggestions {
14
+ text-align: left; cursor: default; border: 1px solid #ccc; border-top: 0; background: #fff; box-shadow: -1px 1px 3px rgba(0,0,0,.1);
15
+ /* core styles should not be changed */
16
+ position: absolute; display: none; z-index: 9999; max-height: 254px; overflow: hidden; overflow-y: auto; box-sizing: border-box;
17
+ }
18
+ .autocomplete-suggestion { position: relative; padding: 0 .6em; line-height: 23px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 1.02em; color: #333; }
19
+ .autocomplete-suggestion b { font-weight: normal; color: #1f8dd6; }
20
+ .autocomplete-suggestion.selected { background: #f0f0f0; }
21
+
@@ -1,124 +1,124 @@
1
- import { HTMLWidget } from "@hpcc-js/common";
2
- import * as AutoComplete from "javascript-autocomplete";
3
-
4
- import "../src/AutoCompleteText.css";
5
-
6
- export class AutoCompleteText extends HTMLWidget {
7
- _span;
8
- _prompt;
9
- _input;
10
- _prevMinCharsText;
11
- _autoComplete;
12
-
13
- constructor() {
14
- super();
15
- this._tag = "div";
16
- }
17
-
18
- autoCompleteTextData() {
19
- if (this.data().length === 0) return [];
20
- const view = this._db.rollupView([this.textColumn(), this.valueColumn()]);
21
- return view.entries().map(function (row, idx) {
22
- return {
23
- idx,
24
- text: row.key,
25
- value: row.values.length ? row.values[0].key : "",
26
- origRow: row.values.length && row.values[0].value.length ? row.values[0].value[0] : []
27
- };
28
- }, this);
29
- }
30
-
31
- enter(domNode, element) {
32
- super.enter(domNode, element);
33
- this._span = element.append("span");
34
- this._prompt = this._span.append("label")
35
- .attr("for", this.id() + "_input")
36
- ;
37
- this._input = this._span.append("input")
38
- .attr("id", this.id() + "_input")
39
- .attr("name", this.id() + "_input_name")
40
- .attr("type", "text")
41
- .attr("placeholder", this.placeholder())
42
- ;
43
- }
44
-
45
- update(domNode, element) {
46
- super.update(domNode, element);
47
-
48
- this._prompt.text(this.label());
49
- this._input.style("width", this.textboxWidth_exists() ? this.textboxWidth() + "px" : null);
50
-
51
- if (this._prevMinCharsText !== this.minCharsText()) {
52
- this._prevMinCharsText = this.minCharsText();
53
-
54
- if (this._autoComplete) {
55
- this._autoComplete.destroy();
56
- }
57
- const context = this;
58
- this._autoComplete = new AutoComplete({
59
- selector: "#" + this.id() + "_input",
60
- minChars: this.minCharsText(),
61
- delay: 150,
62
- offsetLeft: 0,
63
- offsetTop: 1,
64
- source: (term, suggest) => {
65
- const field = context._db.fieldByLabel(context.textColumn());
66
- if (field) {
67
- term = term.toLowerCase();
68
- const suggestions = context.autoCompleteTextData().filter(function (row) {
69
- return row.origRow[field.idx].toLowerCase().indexOf(term) >= 0;
70
- }).map(function (row) {
71
- return {
72
- text: row.origRow[field.idx],
73
- rowIdx: row.idx
74
- };
75
- });
76
- suggest(suggestions);
77
- }
78
- },
79
- renderItem: (item, search) => {
80
- search = search.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&");
81
- const re = new RegExp("(" + search.split(" ").join("|") + ")", "gi");
82
- return '<div class="autocomplete-suggestion" data-val="' + item.text + '" data-row-idx="' + item.rowIdx + '">' + item.text.replace(re, "<b>$1</b>") + "</div>";
83
- },
84
- onSelect: (e, term, item) => {
85
- const rowIdx = +item.getAttribute("data-row-idx");
86
- const row = context.autoCompleteTextData()[rowIdx];
87
- context.click(context.rowToObj(row.origRow), context.valueColumn(), true);
88
- }
89
- });
90
- }
91
- }
92
-
93
- exit(domNode, element) {
94
- if (this._autoComplete) {
95
- this._autoComplete.destroy();
96
- }
97
- this._span.remove();
98
- super.exit(domNode, element);
99
- }
100
-
101
- click(row, column, selected) {
102
- }
103
-
104
- label: { (): string; (_: string): AutoCompleteText };
105
- label_exists: () => boolean;
106
- textboxWidth: { (): number; (_: number): AutoCompleteText };
107
- textboxWidth_exists: () => boolean;
108
- placeholder: { (): string; (_: string): AutoCompleteText };
109
- placeholder_exists: () => boolean;
110
- valueColumn: { (): string; (_: string): AutoCompleteText };
111
- valueColumn_exists: () => boolean;
112
- textColumn: { (): string; (_: string): AutoCompleteText };
113
- textColumn_exists: () => boolean;
114
- minCharsText: { (): number; (_: number): AutoCompleteText };
115
- minCharsText_exists: () => boolean;
116
- }
117
- AutoCompleteText.prototype._class += " other_AutoCompleteText";
118
-
119
- AutoCompleteText.prototype.publish("label", "Label: ", "string", "Label for AutoCompleteText");
120
- AutoCompleteText.prototype.publish("textboxWidth", null, "number", "width of textbox", null, { optional: true });
121
- AutoCompleteText.prototype.publish("placeholder", "Search...", "string", "Placeholder for AutoCompleteText");
122
- AutoCompleteText.prototype.publish("valueColumn", null, "set", "Select column for autocomplete", function () { return this.columns(); }, { optional: true });
123
- AutoCompleteText.prototype.publish("textColumn", null, "set", "Select value(s)", function () { return this.columns(); }, { optional: true });
124
- AutoCompleteText.prototype.publish("minCharsText", 1, "number", "Size of multiAutoCompleteText box");
1
+ import { HTMLWidget } from "@hpcc-js/common";
2
+ import * as AutoComplete from "javascript-autocomplete";
3
+
4
+ import "../src/AutoCompleteText.css";
5
+
6
+ export class AutoCompleteText extends HTMLWidget {
7
+ _span;
8
+ _prompt;
9
+ _input;
10
+ _prevMinCharsText;
11
+ _autoComplete;
12
+
13
+ constructor() {
14
+ super();
15
+ this._tag = "div";
16
+ }
17
+
18
+ autoCompleteTextData() {
19
+ if (this.data().length === 0) return [];
20
+ const view = this._db.rollupView([this.textColumn(), this.valueColumn()]);
21
+ return view.entries().map(function (row, idx) {
22
+ return {
23
+ idx,
24
+ text: row.key,
25
+ value: row.values.length ? row.values[0].key : "",
26
+ origRow: row.values.length && row.values[0].value.length ? row.values[0].value[0] : []
27
+ };
28
+ }, this);
29
+ }
30
+
31
+ enter(domNode, element) {
32
+ super.enter(domNode, element);
33
+ this._span = element.append("span");
34
+ this._prompt = this._span.append("label")
35
+ .attr("for", this.id() + "_input")
36
+ ;
37
+ this._input = this._span.append("input")
38
+ .attr("id", this.id() + "_input")
39
+ .attr("name", this.id() + "_input_name")
40
+ .attr("type", "text")
41
+ .attr("placeholder", this.placeholder())
42
+ ;
43
+ }
44
+
45
+ update(domNode, element) {
46
+ super.update(domNode, element);
47
+
48
+ this._prompt.text(this.label());
49
+ this._input.style("width", this.textboxWidth_exists() ? this.textboxWidth() + "px" : null);
50
+
51
+ if (this._prevMinCharsText !== this.minCharsText()) {
52
+ this._prevMinCharsText = this.minCharsText();
53
+
54
+ if (this._autoComplete) {
55
+ this._autoComplete.destroy();
56
+ }
57
+ const context = this;
58
+ this._autoComplete = new AutoComplete({
59
+ selector: "#" + this.id() + "_input",
60
+ minChars: this.minCharsText(),
61
+ delay: 150,
62
+ offsetLeft: 0,
63
+ offsetTop: 1,
64
+ source: (term, suggest) => {
65
+ const field = context._db.fieldByLabel(context.textColumn());
66
+ if (field) {
67
+ term = term.toLowerCase();
68
+ const suggestions = context.autoCompleteTextData().filter(function (row) {
69
+ return row.origRow[field.idx].toLowerCase().indexOf(term) >= 0;
70
+ }).map(function (row) {
71
+ return {
72
+ text: row.origRow[field.idx],
73
+ rowIdx: row.idx
74
+ };
75
+ });
76
+ suggest(suggestions);
77
+ }
78
+ },
79
+ renderItem: (item, search) => {
80
+ search = search.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&");
81
+ const re = new RegExp("(" + search.split(" ").join("|") + ")", "gi");
82
+ return '<div class="autocomplete-suggestion" data-val="' + item.text + '" data-row-idx="' + item.rowIdx + '">' + item.text.replace(re, "<b>$1</b>") + "</div>";
83
+ },
84
+ onSelect: (e, term, item) => {
85
+ const rowIdx = +item.getAttribute("data-row-idx");
86
+ const row = context.autoCompleteTextData()[rowIdx];
87
+ context.click(context.rowToObj(row.origRow), context.valueColumn(), true);
88
+ }
89
+ });
90
+ }
91
+ }
92
+
93
+ exit(domNode, element) {
94
+ if (this._autoComplete) {
95
+ this._autoComplete.destroy();
96
+ }
97
+ this._span.remove();
98
+ super.exit(domNode, element);
99
+ }
100
+
101
+ click(row, column, selected) {
102
+ }
103
+
104
+ label: { (): string; (_: string): AutoCompleteText };
105
+ label_exists: () => boolean;
106
+ textboxWidth: { (): number; (_: number): AutoCompleteText };
107
+ textboxWidth_exists: () => boolean;
108
+ placeholder: { (): string; (_: string): AutoCompleteText };
109
+ placeholder_exists: () => boolean;
110
+ valueColumn: { (): string; (_: string): AutoCompleteText };
111
+ valueColumn_exists: () => boolean;
112
+ textColumn: { (): string; (_: string): AutoCompleteText };
113
+ textColumn_exists: () => boolean;
114
+ minCharsText: { (): number; (_: number): AutoCompleteText };
115
+ minCharsText_exists: () => boolean;
116
+ }
117
+ AutoCompleteText.prototype._class += " other_AutoCompleteText";
118
+
119
+ AutoCompleteText.prototype.publish("label", "Label: ", "string", "Label for AutoCompleteText");
120
+ AutoCompleteText.prototype.publish("textboxWidth", null, "number", "width of textbox", null, { optional: true });
121
+ AutoCompleteText.prototype.publish("placeholder", "Search...", "string", "Placeholder for AutoCompleteText");
122
+ AutoCompleteText.prototype.publish("valueColumn", null, "set", "Select column for autocomplete", function () { return this.columns(); }, { optional: true });
123
+ AutoCompleteText.prototype.publish("textColumn", null, "set", "Select value(s)", function () { return this.columns(); }, { optional: true });
124
+ AutoCompleteText.prototype.publish("minCharsText", 1, "number", "Size of multiAutoCompleteText box");
@@ -1,26 +1,26 @@
1
- .other_CalendarHeatMap {
2
- shape-rendering: crispEdges;
3
- }
4
-
5
- .other_CalendarHeatMap .day {
6
- fill: #fff;
7
- stroke: #ccc;
8
- }
9
-
10
- .other_CalendarHeatMap .day.selected {
11
- stroke: red;
12
- }
13
-
14
- .other_CalendarHeatMap .day.over {
15
- stroke: orange;
16
- }
17
-
18
- .other_CalendarHeatMap .day.selected.over {
19
- stroke: red;
20
- }
21
-
22
- .other_CalendarHeatMap .month {
23
- fill: none;
24
- stroke: #000;
25
- stroke-width: 2px;
26
- }
1
+ .other_CalendarHeatMap {
2
+ shape-rendering: crispEdges;
3
+ }
4
+
5
+ .other_CalendarHeatMap .day {
6
+ fill: #fff;
7
+ stroke: #ccc;
8
+ }
9
+
10
+ .other_CalendarHeatMap .day.selected {
11
+ stroke: red;
12
+ }
13
+
14
+ .other_CalendarHeatMap .day.over {
15
+ stroke: orange;
16
+ }
17
+
18
+ .other_CalendarHeatMap .day.selected.over {
19
+ stroke: red;
20
+ }
21
+
22
+ .other_CalendarHeatMap .month {
23
+ fill: none;
24
+ stroke: #000;
25
+ stroke-width: 2px;
26
+ }