@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
@@ -1,7 +1,7 @@
1
- .other_RadioCheckbox input {
2
- }
3
-
4
- .other_RadioCheckbox span,
5
- .other_RadioCheckbox label {
6
- vertical-align: top;
1
+ .other_RadioCheckbox input {
2
+ }
3
+
4
+ .other_RadioCheckbox span,
5
+ .other_RadioCheckbox label {
6
+ vertical-align: top;
7
7
  }
@@ -1,123 +1,123 @@
1
- import { HTMLWidget } from "@hpcc-js/common";
2
- import { select as d3Select } from "d3-selection";
3
-
4
- import "../src/RadioCheckbox.css";
5
-
6
- export class RadioCheckbox extends HTMLWidget {
7
- _span;
8
- _label;
9
- _Checkbox;
10
-
11
- constructor() {
12
- super();
13
- }
14
-
15
- rcData() {
16
- if (this.data().length === 0) return [];
17
- const view = this._db.rollupView([this.textColumn(), this.valueColumn()]);
18
- let retVal = [];
19
- retVal = retVal.concat(view.entries().map(function (row) {
20
- return {
21
- text: row.key,
22
- value: row.values.length ? row.values[0].key : "",
23
- origRow: row.values.length && row.values[0].values.length ? row.values[0].values[0] : []
24
- };
25
- }, this));
26
- if (this.sort_exists()) {
27
- const descending = this.sort() === "descending";
28
- retVal.sort(function (l, r) {
29
- if (l.text < r.text) return descending ? 1 : -1;
30
- if (l.text > r.text) return descending ? -1 : 1;
31
- return 0;
32
- });
33
- }
34
- return retVal;
35
- }
36
-
37
- enter(domNode, element) {
38
- super.enter(domNode, element);
39
- this._span = element.append("span");
40
- this._label = this._span.append("label")
41
- .attr("for", this.id() + "_radioCheckbox")
42
- ;
43
- this._Checkbox = this._span.append("div")
44
- .attr("id", this.id() + "_radioCheckbox");
45
- }
46
-
47
- update(domNode, element) {
48
- super.update(domNode, element);
49
- const context = this;
50
- this._label
51
- .text(this.label())
52
- ;
53
- const radioCheckbox = this._Checkbox.selectAll(".dataRow").data(this.rcData());
54
- radioCheckbox.enter().append("div")
55
- .attr("class", "dataRow")
56
- .each(function (row, idx) {
57
- const checkboxDiv = d3Select(this);
58
- const id = context.id() + "_checkbox_" + idx;
59
- checkboxDiv.append("input")
60
- .attr("id", id)
61
- .attr("name", context.id() + "_radioCheckbox")
62
- .on("change", function (selectedData) {
63
- context.handleClick();
64
- });
65
- checkboxDiv.append("label")
66
- .attr("for", id);
67
- });
68
- radioCheckbox
69
- .each(function (row, idx) {
70
- const rcDiv = d3Select(this);
71
- rcDiv.select("input")
72
- .attr("type", context.multiple() ? "checkbox" : "radio")
73
- .attr("value", row.value);
74
- rcDiv.select("label")
75
- .text(row.text);
76
- });
77
- radioCheckbox.exit().remove();
78
- radioCheckbox.order();
79
- }
80
-
81
- exit(domNode, element) {
82
- this._span.remove();
83
- super.exit(domNode, element);
84
- }
85
-
86
- handleClick() {
87
- const options = [];
88
- this._Checkbox.selectAll(".dataRow > input")
89
- .each(function (row, idx) {
90
- const input = d3Select(this);
91
- if (input.property("checked") && row && row.origRow) {
92
- options.push(row.origRow);
93
- }
94
- });
95
- if (options.length) {
96
- // TODO Handle Multiple Selections - part of 1.16.x
97
- this.click(this.rowToObj(options[0]), this.valueColumn(), true);
98
- } else {
99
- this.click([], this.valueColumn(), false);
100
- }
101
- }
102
-
103
- click(row, column, selected) {
104
- }
105
-
106
- label: { (): string; (_: string): RadioCheckbox };
107
- label_exists: () => boolean;
108
- valueColumn: { (): string; (_: string): RadioCheckbox };
109
- valueColumn_exists: () => boolean;
110
- textColumn: { (): string; (_: string): RadioCheckbox };
111
- textColumn_exists: () => boolean;
112
- sort: { (): string; (_: string): RadioCheckbox };
113
- sort_exists: () => boolean;
114
- multiple: { (): boolean; (_: boolean): RadioCheckbox };
115
- multiple_exists: () => boolean;
116
- }
117
- RadioCheckbox.prototype._class += " other_RadioCheckbox";
118
-
119
- RadioCheckbox.prototype.publish("label", null, "string", "Label for RadioCheckbox");
120
- RadioCheckbox.prototype.publish("valueColumn", null, "set", "RadioCheckbox display value", function () { return this.columns(); }, { optional: true });
121
- RadioCheckbox.prototype.publish("textColumn", null, "set", "RadioCheckbox value(s)", function () { return this.columns(); }, { optional: true });
122
- RadioCheckbox.prototype.publish("sort", null, "set", "Sort contents", ["", "ascending", "descending"], { optional: true });
123
- RadioCheckbox.prototype.publish("multiple", false, "boolean", "Multiple selection");
1
+ import { HTMLWidget } from "@hpcc-js/common";
2
+ import { select as d3Select } from "d3-selection";
3
+
4
+ import "../src/RadioCheckbox.css";
5
+
6
+ export class RadioCheckbox extends HTMLWidget {
7
+ _span;
8
+ _label;
9
+ _Checkbox;
10
+
11
+ constructor() {
12
+ super();
13
+ }
14
+
15
+ rcData() {
16
+ if (this.data().length === 0) return [];
17
+ const view = this._db.rollupView([this.textColumn(), this.valueColumn()]);
18
+ let retVal = [];
19
+ retVal = retVal.concat(view.entries().map(function (row) {
20
+ return {
21
+ text: row.key,
22
+ value: row.values.length ? row.values[0].key : "",
23
+ origRow: row.values.length && row.values[0].values.length ? row.values[0].values[0] : []
24
+ };
25
+ }, this));
26
+ if (this.sort_exists()) {
27
+ const descending = this.sort() === "descending";
28
+ retVal.sort(function (l, r) {
29
+ if (l.text < r.text) return descending ? 1 : -1;
30
+ if (l.text > r.text) return descending ? -1 : 1;
31
+ return 0;
32
+ });
33
+ }
34
+ return retVal;
35
+ }
36
+
37
+ enter(domNode, element) {
38
+ super.enter(domNode, element);
39
+ this._span = element.append("span");
40
+ this._label = this._span.append("label")
41
+ .attr("for", this.id() + "_radioCheckbox")
42
+ ;
43
+ this._Checkbox = this._span.append("div")
44
+ .attr("id", this.id() + "_radioCheckbox");
45
+ }
46
+
47
+ update(domNode, element) {
48
+ super.update(domNode, element);
49
+ const context = this;
50
+ this._label
51
+ .text(this.label())
52
+ ;
53
+ const radioCheckbox = this._Checkbox.selectAll(".dataRow").data(this.rcData());
54
+ radioCheckbox.enter().append("div")
55
+ .attr("class", "dataRow")
56
+ .each(function (row, idx) {
57
+ const checkboxDiv = d3Select(this);
58
+ const id = context.id() + "_checkbox_" + idx;
59
+ checkboxDiv.append("input")
60
+ .attr("id", id)
61
+ .attr("name", context.id() + "_radioCheckbox")
62
+ .on("change", function (selectedData) {
63
+ context.handleClick();
64
+ });
65
+ checkboxDiv.append("label")
66
+ .attr("for", id);
67
+ });
68
+ radioCheckbox
69
+ .each(function (row, idx) {
70
+ const rcDiv = d3Select(this);
71
+ rcDiv.select("input")
72
+ .attr("type", context.multiple() ? "checkbox" : "radio")
73
+ .attr("value", row.value);
74
+ rcDiv.select("label")
75
+ .text(row.text);
76
+ });
77
+ radioCheckbox.exit().remove();
78
+ radioCheckbox.order();
79
+ }
80
+
81
+ exit(domNode, element) {
82
+ this._span.remove();
83
+ super.exit(domNode, element);
84
+ }
85
+
86
+ handleClick() {
87
+ const options = [];
88
+ this._Checkbox.selectAll(".dataRow > input")
89
+ .each(function (row, idx) {
90
+ const input = d3Select(this);
91
+ if (input.property("checked") && row && row.origRow) {
92
+ options.push(row.origRow);
93
+ }
94
+ });
95
+ if (options.length) {
96
+ // TODO Handle Multiple Selections - part of 1.16.x
97
+ this.click(this.rowToObj(options[0]), this.valueColumn(), true);
98
+ } else {
99
+ this.click([], this.valueColumn(), false);
100
+ }
101
+ }
102
+
103
+ click(row, column, selected) {
104
+ }
105
+
106
+ label: { (): string; (_: string): RadioCheckbox };
107
+ label_exists: () => boolean;
108
+ valueColumn: { (): string; (_: string): RadioCheckbox };
109
+ valueColumn_exists: () => boolean;
110
+ textColumn: { (): string; (_: string): RadioCheckbox };
111
+ textColumn_exists: () => boolean;
112
+ sort: { (): string; (_: string): RadioCheckbox };
113
+ sort_exists: () => boolean;
114
+ multiple: { (): boolean; (_: boolean): RadioCheckbox };
115
+ multiple_exists: () => boolean;
116
+ }
117
+ RadioCheckbox.prototype._class += " other_RadioCheckbox";
118
+
119
+ RadioCheckbox.prototype.publish("label", null, "string", "Label for RadioCheckbox");
120
+ RadioCheckbox.prototype.publish("valueColumn", null, "set", "RadioCheckbox display value", function () { return this.columns(); }, { optional: true });
121
+ RadioCheckbox.prototype.publish("textColumn", null, "set", "RadioCheckbox value(s)", function () { return this.columns(); }, { optional: true });
122
+ RadioCheckbox.prototype.publish("sort", null, "set", "Sort contents", ["", "ascending", "descending"], { optional: true });
123
+ RadioCheckbox.prototype.publish("multiple", false, "boolean", "Multiple selection");
package/src/Select.css CHANGED
@@ -1,7 +1,7 @@
1
- .other_Select select {
2
- }
3
-
4
- .other_Select span,
5
- .other_Select label {
6
- vertical-align:top;
7
- }
1
+ .other_Select select {
2
+ }
3
+
4
+ .other_Select span,
5
+ .other_Select label {
6
+ vertical-align:top;
7
+ }
package/src/Select.ts CHANGED
@@ -1,120 +1,120 @@
1
- import { HTMLWidget } from "@hpcc-js/common";
2
- import { select as d3Select } from "d3-selection";
3
-
4
- import "../src/Select.css";
5
-
6
- export class Select extends HTMLWidget {
7
- _span;
8
- _prompt;
9
- _select;
10
-
11
- constructor() {
12
- super();
13
- }
14
-
15
- selectData() {
16
- if (this.data().length === 0) return [];
17
- const view = this._db.rollupView([this.textColumn(), this.valueColumn()]);
18
- let retVal = [];
19
- retVal = retVal.concat(view.entries().map(function (row) {
20
- return {
21
- text: row.key,
22
- value: row.values.length ? row.values[0].key : "",
23
- origRow: row.values.length && row.values[0].value.length ? row.values[0].value[0] : []
24
- };
25
- }, this));
26
- if (this.sort_exists()) {
27
- const descending = this.sort() === "descending";
28
- retVal.sort(function (l, r) {
29
- if (l.text < r.text) return descending ? 1 : -1;
30
- if (l.text > r.text) return descending ? -1 : 1;
31
- return 0;
32
- });
33
- }
34
- if (this.optional()) {
35
- retVal.unshift({ value: "", text: "" });
36
- }
37
- return retVal;
38
- }
39
-
40
- enter(domNode, element) {
41
- super.enter(domNode, element);
42
- this._span = element.append("span");
43
- this._prompt = this._span.append("label")
44
- .attr("for", this.id() + "_select")
45
- ;
46
-
47
- const context = this;
48
- this._select = this._span.append("select")
49
- .attr("id", this.id() + "_select")
50
- .on("change", function (d) {
51
- const options = [];
52
- const options_dom_node = context._select.node().options;
53
- for (let i = 0; i < options_dom_node.length; ++i) {
54
- const optionNode = options_dom_node[i];
55
- if (optionNode.selected) {
56
- options.push((d3Select(optionNode).datum() as any).origRow);
57
- }
58
- }
59
- if (options.length) {
60
- context.click(context.rowToObj(options[0]), context.valueColumn(), true); // TODO: Multiselect not support in HIPIE
61
- } else {
62
- context.click([], context.valueColumn(), false);
63
- }
64
- })
65
- ;
66
- }
67
-
68
- update(domNode, element) {
69
- super.update(domNode, element);
70
-
71
- this._prompt
72
- .text(this.label())
73
- ;
74
- this._select
75
- .attr("multiple", this.multiple() ? this.multiple() : null)
76
- .attr("size", this.multiple() && this.selectSize() ? this.selectSize() : null)
77
- ;
78
-
79
- const option = this._select.selectAll(".dataRow").data(this.selectData());
80
- const optionUpdate = option.enter().append("option")
81
- .attr("class", "dataRow")
82
- .merge(option)
83
- .attr("value", function (row) { return row.value; })
84
- .text(function (row) { return row.text; })
85
- ;
86
- option.exit().remove();
87
- optionUpdate.order();
88
- }
89
-
90
- exit(domNode, element) {
91
- this._span.remove();
92
- super.exit(domNode, element);
93
- }
94
-
95
- click(row, column, selected) {
96
- }
97
- label: { (): string; (_: string): Select };
98
- label_exists: () => boolean;
99
- valueColumn: { (): string; (_: string): Select };
100
- valueColumn_exists: () => boolean;
101
- textColumn: { (): string; (_: string): Select };
102
- textColumn_exists: () => boolean;
103
- optional: { (): boolean; (_: boolean): Select };
104
- optional_exists: () => boolean;
105
- sort: { (): string; (_: string): Select };
106
- sort_exists: () => boolean;
107
- multiple: { (): boolean; (_: boolean): Select };
108
- multiple_exists: () => boolean;
109
- selectSize: { (): number; (_: number): Select };
110
- selectSize_exists: () => boolean;
111
- }
112
- Select.prototype._class += " other_Select";
113
-
114
- Select.prototype.publish("label", null, "string", "Label for select");
115
- Select.prototype.publish("valueColumn", null, "set", "Select display value", function () { return this.columns(); }, { optional: true });
116
- Select.prototype.publish("textColumn", null, "set", "Select value(s)", function () { return this.columns(); }, { optional: true });
117
- Select.prototype.publish("optional", true, "boolean", "Optional Select");
118
- Select.prototype.publish("sort", null, "set", "Sort contents", ["", "ascending", "descending"], { optional: true });
119
- Select.prototype.publish("multiple", false, "boolean", "Multiple selection");
120
- Select.prototype.publish("selectSize", 5, "number", "Size of multiselect box", null, { disable: w => !w.multiple() });
1
+ import { HTMLWidget } from "@hpcc-js/common";
2
+ import { select as d3Select } from "d3-selection";
3
+
4
+ import "../src/Select.css";
5
+
6
+ export class Select extends HTMLWidget {
7
+ _span;
8
+ _prompt;
9
+ _select;
10
+
11
+ constructor() {
12
+ super();
13
+ }
14
+
15
+ selectData() {
16
+ if (this.data().length === 0) return [];
17
+ const view = this._db.rollupView([this.textColumn(), this.valueColumn()]);
18
+ let retVal = [];
19
+ retVal = retVal.concat(view.entries().map(function (row) {
20
+ return {
21
+ text: row.key,
22
+ value: row.values.length ? row.values[0].key : "",
23
+ origRow: row.values.length && row.values[0].value.length ? row.values[0].value[0] : []
24
+ };
25
+ }, this));
26
+ if (this.sort_exists()) {
27
+ const descending = this.sort() === "descending";
28
+ retVal.sort(function (l, r) {
29
+ if (l.text < r.text) return descending ? 1 : -1;
30
+ if (l.text > r.text) return descending ? -1 : 1;
31
+ return 0;
32
+ });
33
+ }
34
+ if (this.optional()) {
35
+ retVal.unshift({ value: "", text: "" });
36
+ }
37
+ return retVal;
38
+ }
39
+
40
+ enter(domNode, element) {
41
+ super.enter(domNode, element);
42
+ this._span = element.append("span");
43
+ this._prompt = this._span.append("label")
44
+ .attr("for", this.id() + "_select")
45
+ ;
46
+
47
+ const context = this;
48
+ this._select = this._span.append("select")
49
+ .attr("id", this.id() + "_select")
50
+ .on("change", function (d) {
51
+ const options = [];
52
+ const options_dom_node = context._select.node().options;
53
+ for (let i = 0; i < options_dom_node.length; ++i) {
54
+ const optionNode = options_dom_node[i];
55
+ if (optionNode.selected) {
56
+ options.push((d3Select(optionNode).datum() as any).origRow);
57
+ }
58
+ }
59
+ if (options.length) {
60
+ context.click(context.rowToObj(options[0]), context.valueColumn(), true); // TODO: Multiselect not support in HIPIE
61
+ } else {
62
+ context.click([], context.valueColumn(), false);
63
+ }
64
+ })
65
+ ;
66
+ }
67
+
68
+ update(domNode, element) {
69
+ super.update(domNode, element);
70
+
71
+ this._prompt
72
+ .text(this.label())
73
+ ;
74
+ this._select
75
+ .attr("multiple", this.multiple() ? this.multiple() : null)
76
+ .attr("size", this.multiple() && this.selectSize() ? this.selectSize() : null)
77
+ ;
78
+
79
+ const option = this._select.selectAll(".dataRow").data(this.selectData());
80
+ const optionUpdate = option.enter().append("option")
81
+ .attr("class", "dataRow")
82
+ .merge(option)
83
+ .attr("value", function (row) { return row.value; })
84
+ .text(function (row) { return row.text; })
85
+ ;
86
+ option.exit().remove();
87
+ optionUpdate.order();
88
+ }
89
+
90
+ exit(domNode, element) {
91
+ this._span.remove();
92
+ super.exit(domNode, element);
93
+ }
94
+
95
+ click(row, column, selected) {
96
+ }
97
+ label: { (): string; (_: string): Select };
98
+ label_exists: () => boolean;
99
+ valueColumn: { (): string; (_: string): Select };
100
+ valueColumn_exists: () => boolean;
101
+ textColumn: { (): string; (_: string): Select };
102
+ textColumn_exists: () => boolean;
103
+ optional: { (): boolean; (_: boolean): Select };
104
+ optional_exists: () => boolean;
105
+ sort: { (): string; (_: string): Select };
106
+ sort_exists: () => boolean;
107
+ multiple: { (): boolean; (_: boolean): Select };
108
+ multiple_exists: () => boolean;
109
+ selectSize: { (): number; (_: number): Select };
110
+ selectSize_exists: () => boolean;
111
+ }
112
+ Select.prototype._class += " other_Select";
113
+
114
+ Select.prototype.publish("label", null, "string", "Label for select");
115
+ Select.prototype.publish("valueColumn", null, "set", "Select display value", function () { return this.columns(); }, { optional: true });
116
+ Select.prototype.publish("textColumn", null, "set", "Select value(s)", function () { return this.columns(); }, { optional: true });
117
+ Select.prototype.publish("optional", true, "boolean", "Optional Select");
118
+ Select.prototype.publish("sort", null, "set", "Sort contents", ["", "ascending", "descending"], { optional: true });
119
+ Select.prototype.publish("multiple", false, "boolean", "Multiple selection");
120
+ Select.prototype.publish("selectSize", 5, "number", "Size of multiselect box", null, { disable: w => !w.multiple() });