@hpcc-js/api 3.4.13 → 3.4.15

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.
package/src/IInput.ts CHANGED
@@ -1,87 +1,87 @@
1
- import { Widget } from "@hpcc-js/common";
2
-
3
- // Use old school class declaration as this is a mixin ---
4
- export function IInput() {
5
- }
6
- IInput.prototype = Object.create(Widget.prototype);
7
- IInput.prototype.constructor = IInput;
8
-
9
- // abstract target(): any;
10
- // abstract target(_: any): this;
11
-
12
- // Implementation ---
13
- IInput.prototype.isValid = function () {
14
- if (this.validate()) {
15
- const re = new RegExp(this.validate());
16
- if (!re.test(this.value())) {
17
- return false;
18
- }
19
- }
20
- return true;
21
- };
22
-
23
- IInput.prototype.hasValue = function () {
24
- if (typeof (this as any).type === "function") {
25
- switch ((this as any).type()) {
26
- case "radio":
27
- /* falls through */
28
- case "checkbox":
29
- if (this.value() && this.value() !== "false") {
30
- return true;
31
- }
32
- break;
33
- default:
34
- if (this.value()) {
35
- return true;
36
- }
37
- break;
38
- }
39
- return false;
40
- }
41
- return this.value() !== "";
42
- };
43
-
44
- // Events ---
45
- IInput.prototype.blur = function (_w) {
46
- };
47
- IInput.prototype.keyup = function (_w) {
48
- };
49
- IInput.prototype.focus = function (_w) {
50
- };
51
- IInput.prototype.click = function (_w) {
52
- };
53
- IInput.prototype.dblclick = function (_w) {
54
- };
55
- IInput.prototype.change = function (_w, complete: boolean) {
56
- };
57
-
58
- IInput.prototype.resetValue = function (w) {
59
- w.value(w._inputElement[0].node().value);
60
- };
61
-
62
- IInput.prototype.disable = function (disable) {
63
- this._inputElement.forEach(function (e, idx) {
64
- e.attr("disabled", disable ? "disabled" : null);
65
- });
66
- };
67
-
68
- IInput.prototype.setFocus = function () {
69
- if (this._inputElement.length) {
70
- this._inputElement[0].node().focus();
71
- }
72
- };
73
-
74
- export interface IInput {
75
- name: { (): string; (_: string): IInput };
76
- name_exists: () => boolean;
77
- label: { (): string; (_: string): IInput };
78
- label_exists: () => boolean;
79
- value: { (): any; (_: any): IInput };
80
- value_exists: () => boolean;
81
- validate: { (): string; (_: string): IInput };
82
- validate_exists: () => boolean;
83
- }
84
- IInput.prototype.publish("name", "", "string", "HTML name for the input");
85
- IInput.prototype.publish("label", "", "string", "Descriptive label");
86
- IInput.prototype.publish("value", "", "string", "Input Current Value");
87
- IInput.prototype.publish("validate", null, "string", "Input Validation");
1
+ import { Widget } from "@hpcc-js/common";
2
+
3
+ // Use old school class declaration as this is a mixin ---
4
+ export function IInput() {
5
+ }
6
+ IInput.prototype = Object.create(Widget.prototype);
7
+ IInput.prototype.constructor = IInput;
8
+
9
+ // abstract target(): any;
10
+ // abstract target(_: any): this;
11
+
12
+ // Implementation ---
13
+ IInput.prototype.isValid = function () {
14
+ if (this.validate()) {
15
+ const re = new RegExp(this.validate());
16
+ if (!re.test(this.value())) {
17
+ return false;
18
+ }
19
+ }
20
+ return true;
21
+ };
22
+
23
+ IInput.prototype.hasValue = function () {
24
+ if (typeof (this as any).type === "function") {
25
+ switch ((this as any).type()) {
26
+ case "radio":
27
+ /* falls through */
28
+ case "checkbox":
29
+ if (this.value() && this.value() !== "false") {
30
+ return true;
31
+ }
32
+ break;
33
+ default:
34
+ if (this.value()) {
35
+ return true;
36
+ }
37
+ break;
38
+ }
39
+ return false;
40
+ }
41
+ return this.value() !== "";
42
+ };
43
+
44
+ // Events ---
45
+ IInput.prototype.blur = function (_w) {
46
+ };
47
+ IInput.prototype.keyup = function (_w) {
48
+ };
49
+ IInput.prototype.focus = function (_w) {
50
+ };
51
+ IInput.prototype.click = function (_w) {
52
+ };
53
+ IInput.prototype.dblclick = function (_w) {
54
+ };
55
+ IInput.prototype.change = function (_w, complete: boolean) {
56
+ };
57
+
58
+ IInput.prototype.resetValue = function (w) {
59
+ w.value(w._inputElement[0].node().value);
60
+ };
61
+
62
+ IInput.prototype.disable = function (disable) {
63
+ this._inputElement.forEach(function (e, idx) {
64
+ e.attr("disabled", disable ? "disabled" : null);
65
+ });
66
+ };
67
+
68
+ IInput.prototype.setFocus = function () {
69
+ if (this._inputElement.length) {
70
+ this._inputElement[0].node().focus();
71
+ }
72
+ };
73
+
74
+ export interface IInput {
75
+ name: { (): string; (_: string): IInput };
76
+ name_exists: () => boolean;
77
+ label: { (): string; (_: string): IInput };
78
+ label_exists: () => boolean;
79
+ value: { (): any; (_: any): IInput };
80
+ value_exists: () => boolean;
81
+ validate: { (): string; (_: string): IInput };
82
+ validate_exists: () => boolean;
83
+ }
84
+ IInput.prototype.publish("name", "", "string", "HTML name for the input");
85
+ IInput.prototype.publish("label", "", "string", "Descriptive label");
86
+ IInput.prototype.publish("value", "", "string", "Input Current Value");
87
+ IInput.prototype.publish("validate", null, "string", "Input Validation");
package/src/INDChart.ts CHANGED
@@ -1,26 +1,26 @@
1
- import { Palette } from "@hpcc-js/common";
2
- import { hsl as d3Hsl } from "d3-color";
3
-
4
- export function INDChart() {
5
- }
6
- INDChart.prototype._dataFamily = "ND";
7
- INDChart.prototype._palette = Palette.ordinal("default");
8
-
9
- INDChart.prototype.fillColor = function (row: any[], column: string, value: number, origRow: any): string {
10
- return this._palette(column);
11
- };
12
-
13
- INDChart.prototype.strokeColor = function (row: any[], column: string, value: number, origRow: any): string {
14
- return d3Hsl(this.fillColor(row, column, value, origRow)).darker().toString();
15
- };
16
-
17
- INDChart.prototype.textColor = function (row: any[], column: string, value: number, origRow: any): string {
18
- return Palette.textColor(this.fillColor(row, column, value, origRow));
19
- };
20
-
21
- // Events ---
22
- INDChart.prototype.click = function (row, column, selected) {
23
- };
24
-
25
- INDChart.prototype.dblclick = function (row, column, selected) {
26
- };
1
+ import { Palette } from "@hpcc-js/common";
2
+ import { hsl as d3Hsl } from "d3-color";
3
+
4
+ export function INDChart() {
5
+ }
6
+ INDChart.prototype._dataFamily = "ND";
7
+ INDChart.prototype._palette = Palette.ordinal("default");
8
+
9
+ INDChart.prototype.fillColor = function (row: any[], column: string, value: number, origRow: any): string {
10
+ return this._palette(column);
11
+ };
12
+
13
+ INDChart.prototype.strokeColor = function (row: any[], column: string, value: number, origRow: any): string {
14
+ return d3Hsl(this.fillColor(row, column, value, origRow)).darker().toString();
15
+ };
16
+
17
+ INDChart.prototype.textColor = function (row: any[], column: string, value: number, origRow: any): string {
18
+ return Palette.textColor(this.fillColor(row, column, value, origRow));
19
+ };
20
+
21
+ // Events ---
22
+ INDChart.prototype.click = function (row, column, selected) {
23
+ };
24
+
25
+ INDChart.prototype.dblclick = function (row, column, selected) {
26
+ };
package/src/ITooltip.css CHANGED
@@ -1,120 +1,120 @@
1
- .d3-tip {
2
- line-height: 1;
3
- font-weight: bold;
4
- padding: 12px;
5
- background: rgba(0, 0, 0, 0.66);
6
- color: #fff;
7
- border-radius: 2px;
8
- pointer-events: none !important;
9
- z-index: 10;
10
- }
11
-
12
- .d3-tip.hidden {
13
- visibility: hidden;
14
- }
15
-
16
- /* Creates a small triangle extender for the tooltip */
17
- .d3-tip:after {
18
- content: " ";
19
- box-sizing: border-box;
20
- display: inline-block;
21
- border: 4px solid rgba(0, 0, 0, 0.66);
22
- position: absolute;
23
- pointer-events: none !important;
24
- width: 8px;
25
- height: 8px;
26
- margin: 0;
27
- }
28
-
29
- /* Northward tooltips */
30
- .d3-tip.n:after {
31
- top: 100%;
32
- left: calc(50% - 4px);
33
- border-top-width: 8px;
34
- border-right-color: transparent;
35
- border-bottom-color: transparent;
36
- border-left-color: transparent;
37
- }
38
-
39
- /* Eastward tooltips */
40
- .d3-tip.e:after {
41
- top: calc(50% - 4px);
42
- left: -12px;
43
- border-top-color: transparent;
44
- border-right-width: 8px;
45
- border-bottom-color: transparent;
46
- border-left-color: transparent;
47
- }
48
-
49
- /* Southward tooltips */
50
- .d3-tip.s {
51
- margin-top: 8px;
52
- }
53
-
54
- .d3-tip.s:after {
55
- top: -12px;
56
- left: calc(50% - 4px);
57
- border-top-color: transparent;
58
- border-right-color: transparent;
59
- border-bottom-width: 8px;
60
- border-left-color: transparent;
61
- }
62
-
63
- /* Westward tooltips */
64
- .d3-tip.w:after {
65
- top: calc(50% - 4px);
66
- left: 100%;
67
- border-top-color: transparent;
68
- border-right-color: transparent;
69
- border-bottom-color: transparent;
70
- border-left-width: 8px;
71
- }
72
-
73
- .d3-tip.notick:after {
74
- border-color: transparent !important;
75
- }
76
-
77
- .common_Widget .over {
78
- stroke: rgba(0, 0, 0, 0.66);
79
- opacity: 0.66;
80
- }
81
-
82
- .d3-tip.ITooltip-tooltipStyle-series-table {
83
- padding: 0;
84
- }
85
-
86
- .d3-tip .ITooltip-series-table th,
87
- .d3-tip .ITooltip-series-table td {
88
- padding: 6px;
89
- text-align: left;
90
- border: 1px solid #D1D1D1;
91
- }
92
-
93
- .d3-tip .ITooltip-series-table .series-table-row-color {
94
- display: inline-block;
95
- height: 10px;
96
- width: 10px;
97
- margin-right: 10px;
98
- }
99
-
100
- .d3-tip .ITooltip-series-table .series-table-row-label {
101
- display: inline-block;
102
- }
103
-
104
- .d3-tip .ITooltip-series-table th {
105
- background-color: #B3B3B3;
106
- }
107
-
108
- .d3-tip .ITooltip-series-table td {
109
- background-color: #FFF;
110
- color: #555;
111
- font-weight: normal;
112
- }
113
-
114
- .d3-tip .ITooltip-series-table td:first-child {
115
- border-right: 0;
116
- }
117
-
118
- table.ITooltip-series-table td:last-child {
119
- border-left: 1px dotted #A3A3A3;
1
+ .d3-tip {
2
+ line-height: 1;
3
+ font-weight: bold;
4
+ padding: 12px;
5
+ background: rgba(0, 0, 0, 0.66);
6
+ color: #fff;
7
+ border-radius: 2px;
8
+ pointer-events: none !important;
9
+ z-index: 10;
10
+ }
11
+
12
+ .d3-tip.hidden {
13
+ visibility: hidden;
14
+ }
15
+
16
+ /* Creates a small triangle extender for the tooltip */
17
+ .d3-tip:after {
18
+ content: " ";
19
+ box-sizing: border-box;
20
+ display: inline-block;
21
+ border: 4px solid rgba(0, 0, 0, 0.66);
22
+ position: absolute;
23
+ pointer-events: none !important;
24
+ width: 8px;
25
+ height: 8px;
26
+ margin: 0;
27
+ }
28
+
29
+ /* Northward tooltips */
30
+ .d3-tip.n:after {
31
+ top: 100%;
32
+ left: calc(50% - 4px);
33
+ border-top-width: 8px;
34
+ border-right-color: transparent;
35
+ border-bottom-color: transparent;
36
+ border-left-color: transparent;
37
+ }
38
+
39
+ /* Eastward tooltips */
40
+ .d3-tip.e:after {
41
+ top: calc(50% - 4px);
42
+ left: -12px;
43
+ border-top-color: transparent;
44
+ border-right-width: 8px;
45
+ border-bottom-color: transparent;
46
+ border-left-color: transparent;
47
+ }
48
+
49
+ /* Southward tooltips */
50
+ .d3-tip.s {
51
+ margin-top: 8px;
52
+ }
53
+
54
+ .d3-tip.s:after {
55
+ top: -12px;
56
+ left: calc(50% - 4px);
57
+ border-top-color: transparent;
58
+ border-right-color: transparent;
59
+ border-bottom-width: 8px;
60
+ border-left-color: transparent;
61
+ }
62
+
63
+ /* Westward tooltips */
64
+ .d3-tip.w:after {
65
+ top: calc(50% - 4px);
66
+ left: 100%;
67
+ border-top-color: transparent;
68
+ border-right-color: transparent;
69
+ border-bottom-color: transparent;
70
+ border-left-width: 8px;
71
+ }
72
+
73
+ .d3-tip.notick:after {
74
+ border-color: transparent !important;
75
+ }
76
+
77
+ .common_Widget .over {
78
+ stroke: rgba(0, 0, 0, 0.66);
79
+ opacity: 0.66;
80
+ }
81
+
82
+ .d3-tip.ITooltip-tooltipStyle-series-table {
83
+ padding: 0;
84
+ }
85
+
86
+ .d3-tip .ITooltip-series-table th,
87
+ .d3-tip .ITooltip-series-table td {
88
+ padding: 6px;
89
+ text-align: left;
90
+ border: 1px solid #D1D1D1;
91
+ }
92
+
93
+ .d3-tip .ITooltip-series-table .series-table-row-color {
94
+ display: inline-block;
95
+ height: 10px;
96
+ width: 10px;
97
+ margin-right: 10px;
98
+ }
99
+
100
+ .d3-tip .ITooltip-series-table .series-table-row-label {
101
+ display: inline-block;
102
+ }
103
+
104
+ .d3-tip .ITooltip-series-table th {
105
+ background-color: #B3B3B3;
106
+ }
107
+
108
+ .d3-tip .ITooltip-series-table td {
109
+ background-color: #FFF;
110
+ color: #555;
111
+ font-weight: normal;
112
+ }
113
+
114
+ .d3-tip .ITooltip-series-table td:first-child {
115
+ border-right: 0;
116
+ }
117
+
118
+ table.ITooltip-series-table td:last-child {
119
+ border-left: 1px dotted #A3A3A3;
120
120
  }